Overview
Specialized agents are custom configurations that modify how any base AI agent behaves. Apply “personas” like “security expert” or “test writer” to any LLM for task-specific optimization.Key Concept: Specialized agents are prompts + configurations, not separate models. They work with ANY base LLM!
How They Work
Built-in Specialized Agents
Security Expert
Focus on security best practices and vulnerability prevention.- Always validates input
- Considers injection attacks
- Implements proper sanitization
- Adds rate limiting
- Includes security headers
- Documents security decisions
Test Writer
Comprehensive test coverage with edge cases.- Writes tests first (TDD)
- Covers edge cases
- Tests error handling
- Adds integration tests
- Achieves 90%+ coverage
- Documents test scenarios
Performance Optimizer
Optimize for speed and efficiency.- Profiles bottlenecks
- Adds caching
- Optimizes queries
- Reduces allocations
- Implements lazy loading
- Measures improvements
Documentation Writer
Clear, comprehensive documentation.- Writes clear JSDoc/docstrings
- Includes usage examples
- Explains edge cases
- Creates README sections
- Adds inline comments
- Documents assumptions
Code Reviewer
Thorough code review with suggestions.- Checks code style
- Identifies bugs
- Suggests improvements
- Reviews tests
- Validates architecture
- Provides constructive feedback
Accessibility Expert
WCAG-compliant accessible interfaces.- Adds ARIA labels
- Ensures keyboard navigation
- Proper focus management
- Screen reader support
- Color contrast compliance
- Semantic HTML
Creating Custom Agents
Configuration File
Create.forge/agents.yaml:
Using Custom Agents
Agent Combinations
Apply multiple agents to same task:Agent Templates
Frontend Component Agent
Backend API Agent
Infrastructure Agent
SDK Usage
JavaScript/TypeScript
Best Practices
Match Agent to Task
Combine Strategically
Don’t use all agents at once:Good: security-expert + test-writer
Bad: All 8 agents (conflicting priorities)
Create Team Agents
Codify your team’s style:
Iterate and Refine
Test agent configs:
Agent Configuration Options
Temperature
Controls creativity vs consistency:Max Tokens
Control response length:Examples
Provide examples for better results:Measuring Agent Effectiveness
Track which agents work best:Troubleshooting
Agent not applying
Agent not applying
Issue: Agent behavior not visibleSolutions:
- Check agent config is loaded
- Verify agent name matches
- Inspect system prompt in logs
- Try more explicit instructions
Conflicting agents
Conflicting agents
Issue: Multiple agents conflictSolution: Limit to 2-3 compatible agents:Good: security + testing
Bad: performance + comprehensive-docs (conflicting goals)
Agent too strict
Agent too strict
Issue: Agent over-optimizes for one aspectSolution: Adjust temperature or prompt:
Real-World Examples
Example 1: Secure Payment Processing
- Input validation on all endpoints
- Webhook signature verification
- Idempotency keys
- Error handling
- Comprehensive tests (95% coverage)
- Security documentation
Example 2: Public API
- RESTful URL design
- Proper HTTP methods
- OpenAPI specification
- Request/response examples
- Error documentation
- Rate limiting docs
Next Steps
Task Templates
Reusable task patterns
Parallel Execution
Run multiple agents simultaneously
AI Agents Overview
Learn about base AI agents
Workflows
Complete development workflows

