Implement record, show, list, and export commands; document session-close protocol template; extend cheat sheet and agency-framework docs; add CLI tests.
33 lines
1.2 KiB
Markdown
33 lines
1.2 KiB
Markdown
# 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. |