itsmejay18/ai-skills-for-my-development-stack/settings-system
Claude Code and agent skill by itsmejay18/ai-skills-for-my-development-stack
- community
Checking that the SKILL.md file is still in the repository.
Multi-tenant polymorphic settings system with agency-scoped records and global fallback chain. Create, read, update settings records. Use when working with App\Models\Setting, App\Enumerations\SettingType, the settings table migration, the polymorphic settings system, or the fallback chain (agency-specific → global default). Also use when integrating third-party services (Xero, Stripe, etc.) that need per-agency configuration storage.
Install
npx vskill@latest install itsmejay18/ai-skills-for-my-development-stack/settings-systemSKILL.md
The same SKILL.md was published earlier as itsmejay18/ai-skills-for-my-development-stack/settings-system.
Settings System
Quick Start
Model
App\Models\Setting extends TenantModel. Key details:
datacolumn is JSON, cast toarrayon read$guarded = []— all fields mass-assignableTenantModelauto-populatesagency_idon create viaAgencyScopingtrait (can override by explicitly setting it)
Fallback Chain Resolution
Settings resolve in priority order, returning the first match:
- Agency-specific (
agency_id= current agency) - Global default (
agency_id=Agency::SystemAgencyId, which is 1)
Use Setting::forAgency($agencyId, $type) for this. To query a specific level directly, use scopeOfType() and/or scopeForAgency().
Composite Unique Constraint
The migration enforces unique(agency_id, type) — one record per setting type per agency. Use updateOrCreate() for upsert scenarios:
Data Payload & Encryption
- Only secrets (
access_token,refresh_token, API keys) are encrypted via Laravel'sencrypt()/decrypt() - Non-sensitive fields (
expires_at,connected_at, tenant IDs) are plaintext - The
dataJSON column stores everything together
Adding a New Setting Type
- Add case to
App\Enumerations\SettingType - Create/update a settings record via the model — no schema changes needed
Creating Global vs Agency-Specific Records
When creating via Setting::create(), the AgencyScoping trait auto-sets agency_id to the current tenant. To create a global record (agency 1), explicitly set the agency_id:
See Also
docs/WIP/Mike/settings-system.md— detailed human-readable documentationapp/Models/Setting.php— model with scopes and helpersapp/Enumerations/SettingType.php— enum of available setting typesdatabase/migrations/2026_05_15_000000_create_settings_table.php— table schema
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking17-Software-Architecture/settings-system/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/itsmejay18/ai-skills-for-my-development-stack/settings-system)