Agents: 6,235 → 1,454 lines (-77%). Each agent compressed to Role/Behavior/Delegates/Output/Handoff format. Gitea commenting extracted to shared block (.kilo/shared/gitea-commenting.md). Self-evolution protocol extracted to shared block (.kilo/shared/self-evolution.md). Gitea API client centralized (.kilo/shared/gitea-api.md). Rules: 2,358 → 1,189 lines (-50%). Deleted sdet-engineer.md (duplicate of agent) and orchestrator-self-evolution.md (moved to shared/). Compressed docker (549→26), flutter (521→28), go (283→21), nodejs (271→27), code-skeptic (59→14) to checklists with skill references. Fitness: 54/54 tests pass, 29/29 agents validated, fitness=0.92
2.3 KiB
2.3 KiB
Self-Evolution Protocol
When task requirements exceed existing agent capabilities.
Trigger Conditions
- No agent matches task requirements
- Required domain knowledge not in any skill
- Complex multi-step task needs new workflow pattern
@capability-analystreports critical gap
Evolution Flow
[Gap Detected]
↓
1. Create Gitea Milestone → "[Evolution] {gap_description}"
↓
2. Create Research Issue → Track research phase
↓
3. Run History Search → @history-miner checks git history
↓
4. Analyze Gap → @capability-analyst classifies gap
↓
5. Design Component → @agent-architect creates specification
↓
6. Decision: Agent/Skill/Workflow?
↓
7. Create File → .kilo/agents/{name}.md (or skill/workflow)
↓
8. Self-Modify → Add permission to orchestrator.md whitelist
↓
9. Update capability-index.yaml → Register capabilities
↓
10. Verify Access → Test call to new agent
↓
11. Update Documentation → KILO_SPEC.md, AGENTS.md, EVOLUTION_LOG.md
↓
12. Close Milestone → Record results in Gitea
↓
[New Capability Available]
Self-Modification Rules
- ONLY modify own permission whitelist
- NEVER modify other agents' definitions
- ALWAYS create milestone before changes
- ALWAYS verify access after changes
- ALWAYS log results to
.kilo/EVOLUTION_LOG.md - NEVER skip verification step
Evolution Triggers
- Task type not in capability Routing Map
- capability-analyst reports critical gap
- Repeated task failures for same reason
- User requests new specialized capability
File Modifications (in order)
- Create
.kilo/agents/{new-agent}.md(or skill/workflow) - Update
.kilo/agents/orchestrator.md(add permission) - Update
.kilo/capability-index.yaml(register capabilities) - Update
.kilo/KILO_SPEC.md(document) - Update
AGENTS.md(reference) - Append to
.kilo/EVOLUTION_LOG.md(log entry)
Verification Checklist
After each evolution:
- Agent file created and valid YAML frontmatter
- Permission added to orchestrator.md
- Capability registered in capability-index.yaml
- Test call succeeds (Task tool returns valid response)
- KILO_SPEC.md updated with new agent
- AGENTS.md updated with new agent
- EVOLUTION_LOG.md updated with entry
- Gitea milestone closed with results