Add metrics frontmatter and session-close recording to tdd-workflow, document the reference implementation in wiki/AboutKaizenAgents.md, and add an e2e test covering record → show → optimize → brief.
2.7 KiB
About Kaizen Agents
Basic concepts of Kaizen Agents.
All Kaizen Agents follow the KaizenAgentTemplate definition. That template provides a comprehensive structure for defining Kaizen Agent subagents.
Key sections:
- Specification — declarative outcomes rather than implementation steps
- Idempotency design — detect and handle already-completed work
- Metrics — measurable success criteria from day one
- Testing — scenarios that feed the optimization loop
- Evolution tracking — improvement history and performance trends
The template enforces separation of concerns, testability, and measurability while keeping agent definitions consistent across the fleet.
Metrics-enabled pilot: tdd-workflow
tdd-workflow is the reference implementation for project-scoped metrics (WP-0003).
Use it as a template when adding metrics to other agents.
What is measured
| Metric | Role | How |
|---|---|---|
test_pass_rate |
Primary | Passing tests ÷ total tests at PUBLISH (target: 1.0) |
cycle_time_s |
Secondary | Session duration (execution_time_s in ADR-004) |
Definitions live in the agent frontmatter (agents/agent-tdd-workflow.md).
Where data lives
<project>/.kaizen/metrics/tdd-workflow/
executions.jsonl # append-only per-session records
summary.json # rolling aggregates (auto-generated)
Scaffolded by kaizen-agentic memory init tdd-workflow alongside
.kaizen/agents/tdd-workflow/memory.md.
Session-close loop
At the end of each TDD8 session:
- Update qualitative memory (
## Session Log, findings, watch points). - Record quantitative outcome:
kaizen-agentic metrics record tdd-workflow --success --time <seconds> --quality <0.0-1.0>
Or pass a full ADR-004 record with primary_metric via --json (see agent spec).
Analysis and orientation
| Command | Purpose |
|---|---|
kaizen-agentic metrics show tdd-workflow |
Summary + recent executions |
kaizen-agentic metrics optimize tdd-workflow |
Evidence-based recommendations (≥10 records) |
kaizen-agentic memory brief tdd-workflow |
Qualitative memory + ## Performance Summary |
Fleet-level session analytics remain in agentic-resources (Helix Forge); project
metrics stay in .kaizen/metrics/ per ADR-004
and EcosystemIntegration.
Adopting metrics on another agent
- Add a
metrics:block to frontmatter (primary + secondary + collection). - Copy the session-close
metrics recordstep fromagent-tdd-workflow.md. - Run
kaizen-agentic memory init <agent>to scaffold storage. - Verify with
metrics showafter one session.