Specialized Agents
Specialized Agents
Specialized Agents are persona-driven configurations that transform Claude Code from a general-purpose assistant into a dedicated team member with a specific role. While Skills provide the "how-to," Agents define the "who"—carrying out complex workflows, enforcing standards, and managing integrations.
The Persona-Driven Approach
Instead of providing generic instructions for every prompt, specialized agents use dedicated markdown files in .claude/agents/ to define their scope, authority, and checklists. This ensures that when Claude acts as a "Code Reviewer," it focuses on architecture and edge cases, rather than just syntax.
Key Specialized Agents
1. The Code Reviewer
Located at .claude/agents/code-reviewer.md, this agent is designed to validate changes against your specific project standards. It doesn't just look for bugs; it follows a strict checklist:
- Strict Mode Compliance: Ensures TypeScript types are sound.
- UX Consistency: Checks for loading states and error handling in UI components.
- Pattern Matching: Validates that mutations and data fetching follow the project's GraphQL or API standards.
Usage: You can invoke the reviewer manually during a session, or let the GitHub Action trigger it automatically when a Pull Request is opened.
2. Workflow & Maintenance Agents
These agents live within your CI/CD pipeline, acting as "Scheduled Maintainers" to handle the repetitive tasks that usually fall through the cracks.
| Agent | Schedule | Task | | :--- | :--- | :--- | | Docs Sync | Monthly | Scans commits and updates documentation to match implementation. | | Quality Auditor | Weekly | Performs "chaos" reviews on random directories to find technical debt. | | Dependency Auditor | Bi-weekly | Safely updates dependencies and verifies them against the test suite. |
3. The Issue Integrator (/ticket)
By utilizing MCP (Model Context Protocol) servers, Claude Code connects directly to your project management tools like JIRA or Linear.
The /ticket agent can:
- Read ticket requirements and acceptance criteria.
- Implement the feature based on the codebase's existing skills.
- Update the ticket status and link the resulting PR.
Intelligent Agent Activation
You don't always need to tell Claude which persona to adopt. The Skill Evaluation Engine (.claude/hooks/skill-eval.js) acts as a router. It analyzes your prompt and file context to suggest the right agent or skill automatically.
// Example of how the engine detects intent for agent activation
const triggers = {
keywords: ['review', 'audit', 'check', 'pr'],
keywordPatterns: [/fix.*issue/i, /update.*docs/i],
priority: 10
};
Creating Your Own Agent
To create a new specialized agent, add a markdown file to the .claude/agents/ directory defining its mission:
- Role Definition: Define who the agent is (e.g., "Security Auditor").
- Context: Point to relevant
.claude/skills/it should always have active. - Checklist: Provide a set of mandatory validation steps.
- Action Rules: Define what the agent is allowed to do (e.g., "Always run
npm testbefore finishing").
Once defined, you can point Claude to this agent file to initialize a specialized session.