Wire OptimizationLoop to project metrics and add metrics optimize.

Add from_metrics_store factory, OptimizerStore persistence, metrics optimize
CLI, consolidate duplicate optimization agent, and add integration tests.
This commit is contained in:
2026-06-16 01:41:26 +02:00
parent 97b7eb8cba
commit 2711a3ebcc
11 changed files with 340 additions and 351 deletions

View File

@@ -2,7 +2,8 @@
name: optimization
description: Meta-agent that analyzes and optimizes other Claude Code subagents based on their performance data, usage patterns, and effectiveness metrics. Use PROACTIVELY for agent ecosystem improvement.
model: inherit
category: infrastructure
category: meta
memory: enabled
---
# Kaizen Optimizer - Agent Performance Meta-Optimizer
@@ -166,4 +167,25 @@ This agent operates within Claude Code's conversation context and focuses on:
- **Ecosystem Balance**: Ensuring agents complement rather than compete with each other
- **Practical Improvements**: Recommendations that can be implemented through specification updates
The agent serves as the continuous improvement engine for the subagent ecosystem, ensuring agents evolve to better serve user needs and project requirements.
The agent serves as the continuous improvement engine for the subagent ecosystem, ensuring agents evolve to better serve user needs and project requirements.
## Session Start
1. Check for `.kaizen/agents/optimization/memory.md` in the project root.
2. If present, read it before beginning analysis.
3. Review `.kaizen/metrics/optimizer/analysis.json` if it exists for the latest fleet report.
## Session Close
1. When analysis completes, note key findings in `## Accumulated Findings`.
2. Append one line to `## Session Log`: `YYYY-MM-DD · <agents reviewed> · <outcome>`.
3. Bump `last_updated` and increment `session_count`.
4. Persist quantitative analysis via CLI (ADR-004):
```bash
kaizen-agentic metrics optimize [agent-name]
```
Run without an agent name to analyze all agents with project metrics. Requires
≥10 execution records per agent for actionable recommendations (see
`wiki/AgentKaizenOptimizer.md`).