Skip to main content

Specialized Agents in claude-setup

The claude-setup framework includes several specialized agents, each designed to handle specific aspects of development with expertise and consistency.

git-workflow-expert

The Git workflow expert encapsulates years of best practices for version control.

Capabilities

  • Intelligent Commit Messages: Generates clear, conventional commits
  • Branch Management: Creates and manages feature branches
  • PR Creation: Crafts comprehensive pull requests
  • History Analysis: Understands project commit patterns
  • Conflict Resolution: Guides through merge conflicts

Usage Example

You: We need to commit these authentication changes

git-workflow-expert: Analyzing changes...

Found modifications in 5 files:
- src/auth/login.ts (new feature)
- src/auth/validate.ts (enhancement)
- tests/auth.test.ts (test coverage)
- README.md (documentation)
- package.json (new dependencies)

I'll create atomic commits following conventional commit format:

1. feat(auth): implement JWT-based login system
2. enhance(auth): add email validation rules
3. test(auth): add comprehensive auth test suite
4. docs: update README with auth endpoints
5. chore: add jsonwebtoken and bcrypt dependencies

Shall I proceed with these commits?

Configuration

The agent follows these conventions:

  • Conventional commit format
  • Atomic commits (one concern per commit)
  • Clear scope identification
  • Detailed commit bodies when needed
  • Co-author attribution

project-architect

Designs and maintains scalable project structures.

Capabilities

  • Structure Analysis: Evaluates existing architectures
  • Pattern Recognition: Identifies design patterns
  • Scalability Planning: Designs for growth
  • Dependency Management: Optimizes package structure
  • Module Organization: Creates logical boundaries

Usage Example

You: /agent:architect analyze

project-architect: Analyzing project structure...

Current Architecture:
├── Monolithic Express app (12,847 LOC)
├── Mixed concerns in routes/
├── No clear domain boundaries
└── Circular dependencies detected

Recommended Structure:
├── src/
│ ├── domains/ # Domain-driven modules
│ │ ├── auth/
│ │ ├── users/
│ │ └── products/
│ ├── infrastructure/ # Cross-cutting concerns
│ │ ├── database/
│ │ ├── cache/
│ │ └── logger/
│ ├── interfaces/ # API layer
│ │ ├── http/
│ │ ├── graphql/
│ │ └── websocket/
│ └── shared/ # Shared utilities

Benefits:
- Clear separation of concerns
- Parallel development capability
- Easy testing boundaries
- Microservice-ready

Shall I create a migration plan?

Design Principles

  • Domain-Driven Design (DDD)
  • SOLID principles
  • Dependency injection
  • Clean architecture
  • Testability first

test-engineer

Creates comprehensive test strategies and implementations.

Capabilities

  • Test Planning: Designs test strategies
  • Coverage Analysis: Identifies testing gaps
  • Test Generation: Creates unit/integration/e2e tests
  • Mock Creation: Generates realistic test data
  • Performance Testing: Adds benchmark suites

Usage Example

You: We need tests for the payment module

test-engineer: Analyzing payment module...

Test Strategy:
1. Unit Tests (target: 90% coverage)
- Payment validation logic
- Currency conversion
- Fee calculations

2. Integration Tests
- Stripe API integration
- Database transactions
- Event publishing

3. E2E Tests
- Complete payment flow
- Refund scenarios
- Webhook handling

4. Edge Cases
- Network failures
- Invalid currencies
- Concurrent transactions

Generating test suite...

✓ Created 24 unit tests
✓ Created 8 integration tests
✓ Created 3 E2E scenarios
✓ Added test fixtures and mocks

Coverage Report:
- Statements: 92.4%
- Branches: 88.1%
- Functions: 95.0%
- Lines: 91.8%

Testing Philosophy

  • Test behavior, not implementation
  • Meaningful test names
  • Isolated test environments
  • Realistic test data
  • Fast feedback loops

devops-automator

Manages CI/CD pipelines and deployment procedures.

Capabilities

  • Pipeline Creation: Generates CI/CD workflows
  • Environment Management: Configures staging/production
  • Security Scanning: Implements security checks
  • Performance Monitoring: Adds observability
  • Rollback Procedures: Creates safety mechanisms

Usage Example

You: Set up CI/CD for this project

devops-automator: Analyzing project requirements...

Creating Multi-Stage Pipeline:

1. Build Stage
- Dependency installation
- TypeScript compilation
- Asset optimization

2. Quality Gates
- Linting (ESLint, Prettier)
- Unit tests (Jest)
- Integration tests
- Security scan (npm audit)

3. Deployment Stages
- Development (on every commit)
- Staging (on PR merge)
- Production (on tag)

4. Post-Deployment
- Health checks
- Smoke tests
- Rollback triggers

Generated:
- .github/workflows/ci.yml
- .github/workflows/deploy.yml
- scripts/health-check.js
- scripts/rollback.sh

Environment variables needed:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- SENTRY_DSN
- SLACK_WEBHOOK

DevOps Standards

  • Infrastructure as Code
  • Immutable deployments
  • Blue-green deployments
  • Comprehensive monitoring
  • Automated rollbacks

code-reviewer

Performs thorough code reviews with consistent standards.

Capabilities

  • Style Checking: Enforces coding standards
  • Security Analysis: Identifies vulnerabilities
  • Performance Review: Spots bottlenecks
  • Best Practices: Suggests improvements
  • Documentation: Ensures code clarity

Usage Example

You: Review the user service changes

code-reviewer: Reviewing 8 changed files...

SECURITY ISSUES (High Priority):
1. SQL injection vulnerability in userSearch()
- Using string concatenation for queries
- Suggested: Use parameterized queries

PERFORMANCE CONCERNS:
1. N+1 query problem in getUsersWithRoles()
- Fetching roles in a loop
- Suggested: Use JOIN or batch fetch

CODE QUALITY:
1. Complex method: updateUserProfile() (complexity: 15)
- Suggested: Extract validation logic
2. Missing error handling in deleteUser()
3. Inconsistent naming: userId vs user_id

POSITIVE NOTES:
✓ Good test coverage
✓ Clear function documentation
✓ Proper TypeScript types

Overall: Needs revision before merge

Creating Custom Agents

You can extend claude-setup with custom agents:

// agents/security-auditor.ts
export const securityAuditor = {
name: 'security-auditor',
description: 'Performs security audits',

capabilities: [
'dependency-scanning',
'code-analysis',
'penetration-testing',
'compliance-checking'
],

prompts: {
analyze: `Perform a comprehensive security audit...`,
fix: `Fix the identified security issues...`
}
};

Agent Collaboration

Agents can work together:

You: Prepare this feature for production

project-architect: Designing optimal structure...
test-engineer: Creating test suite...
code-reviewer: Reviewing implementation...
devops-automator: Setting up deployment...
git-workflow-expert: Organizing commits...

All agents have completed their tasks.
Ready for production deployment.

Advanced Agent Techniques

Split Role Sub-Agents

For complex analysis, use multiple agents with different perspectives:

You: Analyze this API design for scalability

api-architect: From a design perspective...
- REST endpoints follow proper naming
- Resource hierarchies are logical
- Missing pagination for collections

performance-engineer: From a performance perspective...
- Missing caching headers
- No rate limiting configured
- Database queries not optimized

security-analyst: From a security perspective...
- Authentication required for all endpoints
- Input validation implemented
- Missing CSRF protection

Orchestrator Agent Coordination

Chain agents for comprehensive workflows:

You: Prepare this microservice for production

orchestrator: Coordinating production readiness...

1. project-architect: Analyzing service boundaries
2. test-engineer: Implementing test coverage
3. security-auditor: Running security scan
4. performance-engineer: Load testing
5. devops-automator: Setting up deployment
6. code-reviewer: Final code review

All agents report: ✓ Production ready

Agent Memory and Context

Agents maintain context across interactions:

You: Create a user management system

project-architect: I'll design the structure...
[Designs architecture]

Later...

You: Add role-based permissions

project-architect: Building on the previous user system design...
[Extends existing architecture with RBAC]

Custom Agent Creation

Basic Agent Template

// agents/custom-agent.ts
export const customAgent = {
name: 'custom-agent',
description: 'Your agent description',

expertise: [
'domain-knowledge',
'specific-skills',
'technical-areas'
],

prompts: {
analyze: `System prompt for analysis tasks...`,
implement: `System prompt for implementation...`,
review: `System prompt for review tasks...`
},

tools: [
'code-generation',
'file-analysis',
'pattern-matching'
]
};

Agent Specialization Examples

// Database optimization specialist
export const dbOptimizer = {
name: 'db-optimizer',
description: 'Database performance and optimization expert',

capabilities: [
'query-analysis',
'index-optimization',
'schema-design',
'performance-tuning'
]
};

// API documentation specialist
export const apiDocumenter = {
name: 'api-documenter',
description: 'API documentation and specification expert',

capabilities: [
'openapi-generation',
'endpoint-documentation',
'example-creation',
'schema-validation'
]
};

Agent Communication Patterns

Direct Delegation

You: /agent:architect design the auth system
project-architect: [Designs complete auth architecture]

Collaborative Workflows

You: Implement and test the payment system

project-architect: Designing payment module structure...
test-engineer: Creating comprehensive test suite...
code-reviewer: Reviewing implementation quality...
devops-automator: Setting up deployment pipeline...

Result: Production-ready payment system

Context Handoffs

project-architect → test-engineer:
"I've designed a modular auth system with 3 services.
Please create tests for the JWT service, OAuth provider,
and user management endpoints."

test-engineer → code-reviewer:
"I've created 47 tests covering all auth scenarios.
Please review the test quality and implementation."

Best Practices

1. Use the Right Agent

Each agent has specific expertise:

  • Architecture questions → project-architect
  • Git operations → git-workflow-expert
  • Test creation → test-engineer
  • Security concerns → security-auditor
  • Performance issues → performance-engineer

2. Chain Agents Strategically

Complex tasks benefit from multiple agents:

1. project-architect: Designs structure
2. test-engineer: Creates test strategy
3. code-reviewer: Reviews implementation
4. devops-automator: Sets up pipelines

3. Trust Agent Decisions

Agents encapsulate best practices—trust their recommendations unless you have specific requirements.

4. Provide Clear Context

Give agents enough context to make informed decisions:

Good: "Optimize this React component for mobile performance"
Better: "This ProductList component renders 1000+ items and is slow on mobile devices with limited memory"

5. Use Agent Memory

Leverage agents' ability to remember previous interactions within a session for continuity.

Agent Performance Metrics

Agents track their effectiveness:

  • Task Completion Rate: Successfully completed requests
  • Context Retention: Maintaining conversation context
  • Solution Quality: Code quality and best practices adherence
  • Response Time: Time to provide solutions

Next Steps