|
| 1 | +# Agent System Quick Start Guide |
| 2 | + |
| 3 | +This guide helps you quickly understand and use the GitHub Copilot coding agent system in the Actions Runner Controller repository. |
| 4 | + |
| 5 | +## What Are These Agents? |
| 6 | + |
| 7 | +These are specialized AI assistant configurations that help with different aspects of development in this project. Think of them as expert teammates who know specific domains really well. |
| 8 | + |
| 9 | +## The Three Types of Agents |
| 10 | + |
| 11 | +### 1. Main Coordinator |
| 12 | +- **coding-agent**: Your starting point for any development task |
| 13 | + |
| 14 | +### 2. Management Agents (Meta-Agents) |
| 15 | +- **agent-manager**: Keeps the agent system healthy and up-to-date |
| 16 | +- **agent-recruiter**: Creates new agents when needed |
| 17 | + |
| 18 | +### 3. Specialist Agents (The Experts) |
| 19 | +- **go-expert-agent**: Everything Go-related |
| 20 | +- **kubernetes-expert-agent**: Kubernetes, Helm, CRDs, RBAC |
| 21 | +- **documentation-agent**: All documentation |
| 22 | +- **test-specialist-agent**: All testing |
| 23 | + |
| 24 | +## How To Use This System |
| 25 | + |
| 26 | +### For Quick Tasks |
| 27 | + |
| 28 | +``` |
| 29 | +Question: "How do I add a new field to the AutoscalingRunnerSet CRD?" |
| 30 | +→ Check: kubernetes-expert-agent.md |
| 31 | +→ Section: "Adding/Modifying CRDs" |
| 32 | +``` |
| 33 | + |
| 34 | +``` |
| 35 | +Question: "How do I write a controller test?" |
| 36 | +→ Check: test-specialist-agent.md |
| 37 | +→ Section: "Writing Controller Tests" |
| 38 | +``` |
| 39 | + |
| 40 | +``` |
| 41 | +Question: "How do I handle errors in Go code?" |
| 42 | +→ Check: go-expert-agent.md |
| 43 | +→ Section: "Error Handling" |
| 44 | +``` |
| 45 | + |
| 46 | +### For Complex Tasks |
| 47 | + |
| 48 | +``` |
| 49 | +Task: "Add a new autoscaling metric" |
| 50 | +Steps: |
| 51 | +1. coding-agent coordinates the work |
| 52 | +2. go-expert-agent implements the logic |
| 53 | +3. kubernetes-expert-agent updates CRDs |
| 54 | +4. test-specialist-agent adds tests |
| 55 | +5. documentation-agent documents it |
| 56 | +``` |
| 57 | + |
| 58 | +## Quick Reference Card |
| 59 | + |
| 60 | +| I Need To... | Look Here | |
| 61 | +|--------------|-----------| |
| 62 | +| Add Go code | go-expert-agent.md | |
| 63 | +| Modify a CRD | kubernetes-expert-agent.md | |
| 64 | +| Update Helm chart | kubernetes-expert-agent.md | |
| 65 | +| Write tests | test-specialist-agent.md | |
| 66 | +| Update docs | documentation-agent.md | |
| 67 | +| Create new agent | agent-recruiter.md | |
| 68 | +| Evaluate agents | agent-manager.md | |
| 69 | +| General guidance | coding-agent.md | |
| 70 | + |
| 71 | +## Common Commands By Agent |
| 72 | + |
| 73 | +### Go Expert |
| 74 | +```bash |
| 75 | +make test # Run tests |
| 76 | +make lint # Run linters |
| 77 | +make build # Build binary |
| 78 | +make generate # Generate code |
| 79 | +``` |
| 80 | + |
| 81 | +### Kubernetes Expert |
| 82 | +```bash |
| 83 | +make manifests # Generate CRDs |
| 84 | +helm lint charts/* # Lint charts |
| 85 | +make install # Install CRDs |
| 86 | +make deploy # Deploy controller |
| 87 | +``` |
| 88 | + |
| 89 | +### Test Specialist |
| 90 | +```bash |
| 91 | +ginkgo -r # Run all Ginkgo tests |
| 92 | +go test -cover # Coverage report |
| 93 | +ginkgo -focus # Run specific tests |
| 94 | +``` |
| 95 | + |
| 96 | +## File Location Patterns |
| 97 | + |
| 98 | +``` |
| 99 | +Need to modify... → Use agent... |
| 100 | +/controllers/*.go → go-expert-agent |
| 101 | +/apis/*.go → go-expert-agent + kubernetes-expert-agent |
| 102 | +/charts/* → kubernetes-expert-agent |
| 103 | +/config/crd/* → kubernetes-expert-agent |
| 104 | +/config/rbac/* → kubernetes-expert-agent |
| 105 | +*.md files → documentation-agent |
| 106 | +*_test.go files → test-specialist-agent |
| 107 | +/test_e2e_arc/* → test-specialist-agent |
| 108 | +``` |
| 109 | + |
| 110 | +## Agent Philosophy |
| 111 | + |
| 112 | +### Key Principles |
| 113 | + |
| 114 | +1. **Specialization**: Each agent is an expert in their domain |
| 115 | +2. **Delegation**: Main agent delegates to specialists |
| 116 | +3. **Minimal Overlap**: Clear boundaries between agents |
| 117 | +4. **Living Documents**: Agents evolve with the project |
| 118 | +5. **Self-Managing**: Agents manage their own ecosystem |
| 119 | + |
| 120 | +### Why This Matters |
| 121 | + |
| 122 | +- **Faster Onboarding**: New contributors find answers quickly |
| 123 | +- **Consistent Quality**: Best practices are documented |
| 124 | +- **Less Context Switching**: Focus on one domain at a time |
| 125 | +- **Better Collaboration**: Clear handoff protocols |
| 126 | +- **Reduced Errors**: Domain experts catch domain-specific issues |
| 127 | + |
| 128 | +## Examples of Agent Usage |
| 129 | + |
| 130 | +### Example 1: Bug Fix in Controller |
| 131 | + |
| 132 | +``` |
| 133 | +Problem: Runner pods not getting created |
| 134 | +
|
| 135 | +Steps: |
| 136 | +1. Read go-expert-agent for controller patterns |
| 137 | +2. Read test-specialist-agent for test approach |
| 138 | +3. Write failing test (test-specialist-agent guides) |
| 139 | +4. Fix bug (go-expert-agent guides) |
| 140 | +5. Update documentation (documentation-agent guides) |
| 141 | +``` |
| 142 | + |
| 143 | +### Example 2: New Helm Chart Value |
| 144 | + |
| 145 | +``` |
| 146 | +Task: Add new chart value for resource limits |
| 147 | +
|
| 148 | +Steps: |
| 149 | +1. Read kubernetes-expert-agent section on Helm |
| 150 | +2. Update values.yaml with new option |
| 151 | +3. Update values.schema.json |
| 152 | +4. Update templates to use new value |
| 153 | +5. Document in chart README (documentation-agent) |
| 154 | +6. Test with helm template |
| 155 | +``` |
| 156 | + |
| 157 | +### Example 3: Adding New Feature |
| 158 | + |
| 159 | +``` |
| 160 | +Feature: Add webhook for custom validation |
| 161 | +
|
| 162 | +Steps: |
| 163 | +1. coding-agent reviews overall approach |
| 164 | +2. go-expert-agent implements webhook logic |
| 165 | +3. kubernetes-expert-agent updates webhook config |
| 166 | +4. kubernetes-expert-agent adds RBAC rules |
| 167 | +5. test-specialist-agent adds webhook tests |
| 168 | +6. documentation-agent documents the feature |
| 169 | +``` |
| 170 | + |
| 171 | +## Troubleshooting Agent Usage |
| 172 | + |
| 173 | +### "I don't know which agent to use" |
| 174 | +Start with coding-agent.md - it will point you to the right specialist. |
| 175 | + |
| 176 | +### "Multiple agents seem relevant" |
| 177 | +That's normal for cross-cutting tasks. Use coding-agent to coordinate between them. |
| 178 | + |
| 179 | +### "Agent information is outdated" |
| 180 | +Update the agent spec and note what changed. Consider informing agent-manager. |
| 181 | + |
| 182 | +### "I need an agent that doesn't exist" |
| 183 | +Review agent-manager.md to understand if a new agent is warranted, then check agent-recruiter.md for how to create one. |
| 184 | + |
| 185 | +### "Agent boundaries are unclear" |
| 186 | +Check the "Boundaries" section in each agent - it explicitly states what they don't do. |
| 187 | + |
| 188 | +## Best Practices |
| 189 | + |
| 190 | +### DO |
| 191 | +- ✓ Read the relevant agent spec before starting work |
| 192 | +- ✓ Follow the guidelines in the agent specs |
| 193 | +- ✓ Update agent specs when patterns change |
| 194 | +- ✓ Use agents as onboarding material |
| 195 | +- ✓ Suggest improvements to agent specs |
| 196 | + |
| 197 | +### DON'T |
| 198 | +- ✗ Ignore agent boundaries |
| 199 | +- ✗ Let agent specs become outdated |
| 200 | +- ✗ Create overlapping agents |
| 201 | +- ✗ Skip testing because the agent didn't mention it |
| 202 | +- ✗ Follow agent advice blindly - use judgment |
| 203 | + |
| 204 | +## Measuring Success |
| 205 | + |
| 206 | +The agent system is working when: |
| 207 | + |
| 208 | +- [ ] New contributors find answers in agent specs |
| 209 | +- [ ] PRs follow conventions documented in agents |
| 210 | +- [ ] Less time spent on code review for style/conventions |
| 211 | +- [ ] Fewer bugs in specialist areas |
| 212 | +- [ ] Faster feature development |
| 213 | +- [ ] More consistent code quality |
| 214 | + |
| 215 | +## Evolution |
| 216 | + |
| 217 | +This agent system will evolve as the project evolves: |
| 218 | + |
| 219 | +- **New technology?** → Consider new specialist agent |
| 220 | +- **Pattern changes?** → Update relevant agent specs |
| 221 | +- **Agent unused?** → Consider retirement |
| 222 | +- **Agent confusion?** → Clarify or split |
| 223 | +- **Missing coverage?** → Add new agent |
| 224 | + |
| 225 | +## Getting Help |
| 226 | + |
| 227 | +- **About this project**: Read coding-agent.md |
| 228 | +- **Specific domain**: Read relevant specialist agent |
| 229 | +- **Agent system itself**: Read this guide and README.md |
| 230 | +- **Creating agents**: Read agent-recruiter.md |
| 231 | +- **Managing agents**: Read agent-manager.md |
| 232 | + |
| 233 | +## Summary |
| 234 | + |
| 235 | +The agent system is your AI-powered development guide. Each agent is a specialist who helps you work effectively in their domain. Start with the coding-agent, delegate to specialists, and keep the specs updated as the project grows. |
| 236 | + |
| 237 | +--- |
| 238 | + |
| 239 | +**Remember**: These agents are tools to help you succeed. Use them as guides, but always apply your own judgment and expertise. |
0 commit comments