|
| 1 | +# Agent System Optimization Guide |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This guide documents the agent system model and tool optimization implemented to |
| 6 | +achieve cost efficiency while maintaining quality through appropriate model |
| 7 | +selection and tool permissions. |
| 8 | + |
| 9 | +## Model Specifications |
| 10 | + |
| 11 | +### YAML Frontmatter Schema |
| 12 | + |
| 13 | +```yaml |
| 14 | +--- |
| 15 | +name: agent-name |
| 16 | +model: opus # or sonnet, or haiku |
| 17 | +tools: Read, Grep, Glob, LS, NotebookRead, WebSearch, WebFetch |
| 18 | +description: Agent description |
| 19 | +color: agent-color |
| 20 | +--- |
| 21 | +``` |
| 22 | + |
| 23 | +### Model Assignments |
| 24 | + |
| 25 | +**Opus (Highest capability, highest cost)**: |
| 26 | + |
| 27 | +- elixir-expert, research-agent, architecture-agent |
| 28 | +- Complex analysis, expert knowledge, architectural decisions |
| 29 | + |
| 30 | +**Sonnet (Balanced capability and cost)**: |
| 31 | + |
| 32 | +- All reviewer agents, all planning agents, all implementation agents |
| 33 | +- Analysis, planning, comprehensive review tasks, and complex implementation |
| 34 | + |
| 35 | +**Haiku (Fast, cost-effective)**: |
| 36 | + |
| 37 | +- Currently unused - all agents require reasoning capabilities |
| 38 | +- Reserved for future simple automation tasks |
| 39 | + |
| 40 | +## Tool Permission Categories |
| 41 | + |
| 42 | +### No Permission Required |
| 43 | + |
| 44 | +- Glob, Grep, LS, NotebookRead, Read, Task, TodoWrite |
| 45 | + |
| 46 | +### Permission Required |
| 47 | + |
| 48 | +- Bash, Edit, MultiEdit, NotebookEdit, WebFetch, WebSearch, Write |
| 49 | + |
| 50 | +## Agent Tool Sets |
| 51 | + |
| 52 | +### Expert Agents (opus model) |
| 53 | + |
| 54 | +**Tools**: `Read, Grep, Glob, LS, NotebookRead, Task, WebSearch, WebFetch` |
| 55 | + |
| 56 | +- Read-only access to files |
| 57 | +- Can perform web research |
| 58 | +- Can consult other agents via Task |
| 59 | +- **Special case**: elixir-expert also has Bash for mix commands |
| 60 | + |
| 61 | +### Reviewer Agents (sonnet model) |
| 62 | + |
| 63 | +**Tools**: `Read, Grep, Glob, LS, NotebookRead, WebSearch, WebFetch` |
| 64 | + |
| 65 | +- Read-only access to files and web research |
| 66 | +- Analyze and return findings |
| 67 | + |
| 68 | +### Planning Agents (sonnet model) |
| 69 | + |
| 70 | +**Tools**: `Task, Read, Write, TodoWrite, Grep, Glob, LS, NotebookRead` |
| 71 | + |
| 72 | +- Can create planning documents |
| 73 | +- Can consult other agents |
| 74 | +- Cannot modify existing code files |
| 75 | + |
| 76 | +### Implementation Agents (sonnet model) |
| 77 | + |
| 78 | +**Tools**: All tools including `Bash, Edit, MultiEdit, NotebookEdit, Write` |
| 79 | + |
| 80 | +- Full access to implement changes |
| 81 | +- Balanced reasoning capability for complex implementation decisions |
| 82 | +- Coordinate effectively with expert agents |
| 83 | + |
| 84 | +## Expert Guidance Workflow |
| 85 | + |
| 86 | +### Standard Expert Response Format |
| 87 | + |
| 88 | +````markdown |
| 89 | +## Analysis Summary |
| 90 | + |
| 91 | +Brief overview of findings |
| 92 | + |
| 93 | +## Guidance |
| 94 | + |
| 95 | +- Step-by-step implementation instructions |
| 96 | +- Code patterns to follow |
| 97 | +- Configuration requirements |
| 98 | + |
| 99 | +## Code Examples |
| 100 | + |
| 101 | +```language |
| 102 | +// Concrete examples following best practices |
| 103 | +``` |
| 104 | +```` |
| 105 | + |
| 106 | +## Important Considerations |
| 107 | + |
| 108 | +- Performance, security, testing concerns |
| 109 | +- Common pitfalls to avoid |
| 110 | + |
| 111 | +## Next Steps |
| 112 | + |
| 113 | +1. Specific action items |
| 114 | +2. Files to create/modify |
| 115 | +3. Commands to run |
| 116 | + |
| 117 | +```` |
| 118 | +
|
| 119 | +### Implementation Agent Request Pattern |
| 120 | +
|
| 121 | +```markdown |
| 122 | +## Expert Consultation Request |
| 123 | +
|
| 124 | +**Context**: [current situation] |
| 125 | +**Goal**: [what needs to be implemented] |
| 126 | +**Specific Questions**: |
| 127 | +1. [implementation approach] |
| 128 | +2. [best practices] |
| 129 | +3. [potential issues] |
| 130 | +
|
| 131 | +Please provide detailed implementation guidance. |
| 132 | +```` |
| 133 | + |
| 134 | +## Cost Optimization Benefits |
| 135 | + |
| 136 | +- **Balanced cost and capability** across all agents |
| 137 | +- **Expert models** (opus) for specialized domain knowledge |
| 138 | +- **Balanced models** (sonnet) for analysis, planning, and implementation |
| 139 | +- **Clear role separation** between analysis and execution |
| 140 | +- **Quality maintained** through appropriate model selection for task complexity |
| 141 | + |
| 142 | +## Tool Limitations by Agent Type |
| 143 | + |
| 144 | +### Read-Only Agents (Experts/Reviewers) |
| 145 | + |
| 146 | +``` |
| 147 | +## Tool Limitations |
| 148 | +
|
| 149 | +You have read-only access to files and can perform web research. You cannot modify files or execute commands. |
| 150 | +Your role is to analyze and return detailed findings and recommendations. |
| 151 | +The calling agent will implement any necessary changes based on your guidance. |
| 152 | +``` |
| 153 | + |
| 154 | +### Planning Agents |
| 155 | + |
| 156 | +``` |
| 157 | +## Tool Limitations |
| 158 | +
|
| 159 | +You can create planning documents and consult other agents but cannot modify existing code files. |
| 160 | +Your role is to create comprehensive plans that implementation agents will execute. |
| 161 | +``` |
| 162 | + |
| 163 | +### Implementation Agents |
| 164 | + |
| 165 | +``` |
| 166 | +## Working with Expert Guidance |
| 167 | +
|
| 168 | +Before making significant changes, consult appropriate expert agents for guidance: |
| 169 | +- Request detailed implementation instructions |
| 170 | +- Follow expert recommendations precisely |
| 171 | +- Report back on implementation results |
| 172 | +``` |
| 173 | + |
| 174 | +## Agent Selection Guide |
| 175 | + |
| 176 | +**elixir-expert**: Elixir/Phoenix/Ecto questions, OTP patterns, testing |
| 177 | +strategies **architecture-agent**: Project structure, module design, component |
| 178 | +boundaries **research-agent**: Unknown libraries, API integration, technology |
| 179 | +evaluation **documentation-expert**: Creating documentation with industry |
| 180 | +methodologies **documentation-reviewer**: Documentation quality assurance and |
| 181 | +standards compliance **security-reviewer**: Authentication, data validation, |
| 182 | +vulnerability assessment **implementation-agent**: Execute planning documents, |
| 183 | +implement expert guidance **test-developer**: Systematic test development with |
| 184 | +expert consultation **test-fixer**: Test failure diagnosis and resolution |
| 185 | + |
| 186 | +This system optimizes costs while maintaining quality through appropriate model |
| 187 | +selection and clear role separation between analysis and implementation. |
0 commit comments