Skip to main content

Architecture

In one line: Global specialists carry broad expertise; project reviewers enforce a codebase's exact contracts — and the project tier is the load-bearing one.

What: Two tiers. Global specialist agents (an OPTIONAL pattern — some projects forbid them, preferring direct work to preserve context) live in ~/.claude/agents/ and provide broad domain expertise: security, database design, AI/ML, frontend, testing. Project-specific reviewer agents live in PROJECT/.claude/agents/ and provide checklists calibrated to the project's patterns, conventions, and requirements.

Why: Same reason as the instruction hierarchy (Section 4): different scopes need different specificity.

A global security agent knows OWASP Top 10, JWT validation, injection prevention, PII protection — applicable anywhere. But it does not know that this project authenticates via a specific dependency, accesses the database through a tenant-scoped session helper, or enforces row-level security on its tenant tables. A project security reviewer knows these conventions and checks them explicitly.

Global agents catch categories of issues (missing authentication); project reviewers catch convention violations (using the unscoped session helper instead of the tenant-scoped one). Project reviewers are the load-bearing tier; global specialists are optional reinforcement.

Global Specialist Agents (optional):

AgentDomainWhen to Dispatch
Code ArchitectSystem architecture, DDD, module boundariesNew feature design, refactoring strategy
AI EngineerLLM integration, ML pipelines, RAG, vector databasesAI feature implementation
Security EngineerAuth, authorization, injection prevention, PIISecurity-sensitive changes
Database EngineerSchema design, query optimization, migrationsDatabase changes
Frontend DeveloperReact, Next.js, component architectureFrontend implementation
UI DesignerVisual design, layout, design system applicationUI component creation
UX ResearcherUser flows, interaction patterns, accessibilityUX design decisions
Python ExpertPython idioms, async patterns, performanceComplex Python implementation
Test Writer & FixerTest coverage, failure analysis, test repairTest creation and debugging
Code ReviewerGeneral code quality, patterns, maintainabilityCode review
DebuggerRoot cause analysis, systematic investigationComplex bugs
Deployment EngineerCI/CD, containerization, infrastructureDeployment and ops
MCP ExpertMCP server integration, tool configurationMCP setup and troubleshooting
Research AgentInformation gathering, technology evaluationResearch tasks

Project-Specific Reviewer Agents (4):

These are detailed in Section 5.3.

Evidence: Each agent is a markdown file with YAML frontmatter (name, description, model, tools), a role, a domain checklist, and an output format. Project reviewers are calibrated to the project's patterns — the API reviewer checks the tenant-context dependency, the migration reviewer checks for row-level-security clauses, the compliance reviewer checks the project's regulatory requirements. Reproducible: the checks live in the agent's SKILL.md/definition, not in a reviewer's head. See Section 5.3.

How: Agent definitions are markdown files with YAML frontmatter placed in ~/.claude/agents/ (global) or PROJECT/.claude/agents/ (project). Claude Code discovers them automatically. For the full agent architecture specification, see Section 5.