Add metrics CLI for project-scoped agent performance records.
Implement record, show, list, and export commands; document session-close protocol template; extend cheat sheet and agency-framework docs; add CLI tests.
This commit is contained in:
@@ -48,6 +48,27 @@ kaizen-agentic status # Show current project status
|
||||
kaizen-agentic validate # Validate agent installation
|
||||
```
|
||||
|
||||
### Project Metrics (ADR-004)
|
||||
```bash
|
||||
# Record outcome at session close
|
||||
kaizen-agentic metrics record tdd-workflow --success --time 120 --quality 0.9
|
||||
kaizen-agentic metrics record tdd-workflow --failure --time 45
|
||||
|
||||
# Full JSON record from stdin
|
||||
echo '{"success": true, "quality_score": 1.0}' | kaizen-agentic metrics record tdd-workflow --json
|
||||
|
||||
# Inspect metrics
|
||||
kaizen-agentic metrics show tdd-workflow
|
||||
kaizen-agentic metrics list
|
||||
kaizen-agentic metrics export tdd-workflow
|
||||
|
||||
# Scaffold memory + metrics together
|
||||
kaizen-agentic memory init tdd-workflow
|
||||
kaizen-agentic memory init tdd-workflow --no-metrics # memory only
|
||||
```
|
||||
|
||||
Session-close template: `docs/templates/session-close-protocol.md`
|
||||
|
||||
### Information
|
||||
```bash
|
||||
# List templates
|
||||
|
||||
@@ -265,6 +265,10 @@ kaizen-agentic metrics optimize [agent] # Run optimizer on project metrics
|
||||
`memory brief` includes a `## Performance Summary` when metrics exist (WP-0003
|
||||
Part 4).
|
||||
|
||||
`memory init` scaffolds `.kaizen/metrics/<agent>/` by default (`--no-metrics` to
|
||||
skip). Record outcomes at session close per
|
||||
[session-close protocol template](templates/session-close-protocol.md).
|
||||
|
||||
### Fleet correlation
|
||||
|
||||
Project metrics correlate with **Helix Forge** fleet session metrics in
|
||||
|
||||
33
docs/templates/session-close-protocol.md
vendored
Normal file
33
docs/templates/session-close-protocol.md
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# Session-Close Protocol Template
|
||||
|
||||
Reference template for memory-enabled agents. Copy the **Session Close** block
|
||||
into `agents/agent-<name>.md` and adapt the metrics line to the agent.
|
||||
|
||||
## Session Close
|
||||
|
||||
1. Update `## Accumulated Findings`, `## What Worked`, and `## Watch Points` as needed.
|
||||
2. Append one line to `## Session Log`: `YYYY-MM-DD · <summary> · <outcome>`.
|
||||
3. Bump `last_updated` to today and increment `session_count` in memory frontmatter.
|
||||
4. Record session metrics (adjust flags to match outcome):
|
||||
|
||||
```bash
|
||||
kaizen-agentic metrics record <agent-name> --success --time <seconds> --quality <0.0-1.0>
|
||||
# or on failure:
|
||||
kaizen-agentic metrics record <agent-name> --failure --time <seconds>
|
||||
```
|
||||
|
||||
Optional: pass a full JSON record (ADR-004 schema) via stdin:
|
||||
|
||||
```bash
|
||||
echo '{"success": true, "quality_score": 0.9, "primary_metric": {"name": "...", "value": 1.0, "target": 1.0}}' \
|
||||
| kaizen-agentic metrics record <agent-name> --json
|
||||
```
|
||||
|
||||
Use `--idempotency-key <session-id>` to avoid duplicate records if the close
|
||||
protocol runs more than once for the same session.
|
||||
|
||||
## Pilot agents
|
||||
|
||||
`tdd-workflow` is the reference implementation (WP-0003 Part 5). Other
|
||||
memory-enabled agents should adopt this block as the metrics CLI becomes available
|
||||
in their workflows.
|
||||
Reference in New Issue
Block a user