Files
APAW/.kilo/shared/self-evolution.md
¨NW¨ 28a3b648cc refactor(prompts): compress 29 agents (-77%) and 7 rules (-55%), delete 2 duplicates
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
2026-04-18 13:49:24 +01:00

80 lines
2.3 KiB
Markdown

# Self-Evolution Protocol
When task requirements exceed existing agent capabilities.
## Trigger Conditions
1. No agent matches task requirements
2. Required domain knowledge not in any skill
3. Complex multi-step task needs new workflow pattern
4. `@capability-analyst` reports 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
1. ONLY modify own permission whitelist
2. NEVER modify other agents' definitions
3. ALWAYS create milestone before changes
4. ALWAYS verify access after changes
5. ALWAYS log results to `.kilo/EVOLUTION_LOG.md`
6. 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)
1. Create `.kilo/agents/{new-agent}.md` (or skill/workflow)
2. Update `.kilo/agents/orchestrator.md` (add permission)
3. Update `.kilo/capability-index.yaml` (register capabilities)
4. Update `.kilo/KILO_SPEC.md` (document)
5. Update `AGENTS.md` (reference)
6. 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