AI Agent Configuration Patterns
CLAUDE.md, skills, hooks, and agent architecture at scale
AI agent configuration has evolved from simple system prompts to multi-layered architectures. CLAUDE.md acts as a project constitution, skills provide hot-reloadable capabilities, hooks automate lifecycle events, and agent profiles define specialized roles. The ACOS pattern demonstrates scaling to 500+ skills without chaos through lazy loading, context-aware activation, and explicit handoff protocols.
40+
Specialized agents
ACOS Agent Library
4
Configuration layers
Architecture
3
Trigger dimensions
Skill System
The Configuration Hierarchy
Production AI agent systems use a four-layer configuration hierarchy. Each layer serves a distinct purpose, and the layers compose — lower layers provide defaults, higher layers override for specific contexts.
CLAUDE.md (Constitution)
Layer 1Project-level identity: brand voice, decision frameworks, anti-patterns, content standards. Every agent inherits this context. Acts as the "constitution" all agents swear to.
Skill Profiles (Context)
Layer 2Context-aware activation rules. A web development profile loads React/Next.js skills; a content profile loads SEO/writing skills. Triggers: file patterns, keywords, commands.
Individual Skills (Capability)
Layer 3Hot-reloadable markdown files with specific expertise. Types: domain, technical, creative. Enforcement: suggest or enforce. Priority: critical to low.
Commands (Workflow)
Layer 4Slash-command playbooks (25+ in ACOS). Each command is a complete workflow: prerequisites, decision matrices, step-by-step process, quality gates.
Skill Activation System
Skills activate through three independent trigger dimensions. When any dimension matches, the skill loads. This multi-dimensional approach ensures the right skills are available without manual selection.
Keyword Triggers
Dimension 1Simple word matching in user prompts. Example: "blog", "seo", "deploy" activate content or deployment skills.
Intent Patterns
Dimension 2Regex-based semantic matching. Example: "write.*(article|blog|post)" detects writing intent regardless of exact phrasing.
File Triggers
Dimension 3Glob patterns on files being edited. Example: "app/**/*.tsx" activates React skills, "content/**/*.mdx" activates content skills.
Agent Specialization Architecture
Each agent is a markdown file with YAML frontmatter defining its role, tools, memory limits, and workflows. The key principle: single responsibility. A research agent doesn't write code. A coding agent doesn't do SEO. Clear boundaries prevent agent confusion and improve output quality.
Mission & Expertise
IdentityClear 1-2 sentence purpose and enumerated domain expertise. Prevents scope creep.
Workflow Contracts
ContractsEach workflow defines inputs, outputs, and processing steps. Agents know what they receive and what they deliver.
Memory Architecture
MemoryWorking memory (current task), episodic (past sessions), semantic (knowledge base). Each agent gets explicit memory allocation.
Handoff Protocols
CoordinationExplicit rules for passing work between agents. Prevents dropped context and duplicate work.
Hook-Based Lifecycle Automation
Hooks are shell commands triggered at specific points in the agent lifecycle: PreToolUse (validation, logging), PostToolUse (cleanup, metrics), SessionStart (context loading), and Stop (reporting). Hooks enable quality gates, automated testing after code changes, and session logging — all without modifying the agent itself.
PreToolUse
BeforeRuns before any tool executes. Use for: input validation, permission checks, audit logging.
PostToolUse
AfterRuns after tool completes. Use for: linting, test execution, metric collection, notifications.
UserPromptSubmit
InputRuns when user sends a message. Use for: context injection, skill activation, routing decisions.
Stop
EndRuns when agent session ends. Use for: session logging, cleanup, summary generation.
Scaling to 500+ Skills
The ACOS pattern solves the "too many skills" problem through lazy loading, priority ordering, and exclusion patterns. Only 5 skills load concurrently (max_concurrent_skills). Skills are priority-ranked (critical > high > medium > low). Exclude patterns filter irrelevant skills (e.g., exclude Shopify skills in a non-commerce project). The result: 500+ skills available, but only the relevant 3-5 are active at any time.
Practical Implementation Guide
To implement this pattern in your own projects: (1) Start with CLAUDE.md — define your project identity, voice, and anti-patterns. (2) Create 2-3 skill profiles for your main work contexts. (3) Add individual skills as markdown files with clear trigger patterns. (4) Build commands for workflows you repeat weekly. (5) Add hooks for quality automation. This can start small and grow organically.
For Solo Developers
StarterCLAUDE.md + 5-10 skills + 3 commands. Focus on your most common workflows.
For Teams
TeamShared CLAUDE.md + role-based profiles + 20-50 skills + 10 commands. Version control everything.
For Enterprise
EnterpriseMulti-repo CLAUDE.md hierarchy + profile library + 100+ skills + routing commands + hooks for compliance.
Key Findings
CLAUDE.md acts as a "project constitution" that all agents inherit — brand voice, decision frameworks, and anti-patterns
Multi-dimensional skill activation (keywords + intent + file patterns) ensures the right skills load without manual selection
Lazy loading with max 5 concurrent skills scales to 500+ without overwhelming the agent
Agent specialization with single responsibility and explicit handoff protocols prevents confusion
Hooks automate quality gates (linting, testing, logging) at lifecycle boundaries without modifying agent behavior
Commands are complete workflow playbooks, not just function calls — they include decision trees and quality checklists
The four-layer hierarchy (CLAUDE.md → profiles → skills → commands) provides clear separation of concerns
Arcanea Gates demonstrate gamification of skill progression — mapping technical skills to narrative milestones
Frequently Asked Questions
CLAUDE.md acts as a project constitution that all AI agents inherit — defining brand voice, decision frameworks, anti-patterns, and content standards.
Sources & References
10 validated sources · Last updated 2026-02-06