feat(agency): add session protocols to agents and memory field to schema

- CONTRIBUTING.md: add Session Start/Close protocol reference with YAML
  frontmatter schema (including new memory: enabled|disabled field)
- agents: add ## Session Start / ## Session Close blocks to
  project-management, tdd-workflow, requirements-engineering, scope-analyst
- registry.py: add AgentCategory.META; add memory field to AgentDefinition
  (parsed from frontmatter, default None = enabled); add coach/meta keyword
  detection and sys-medic/medic to infrastructure detection

WP-0002 T09, T10, T11 done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-18 23:33:14 +00:00
parent 4b4b1ff1f1
commit 260b9b27e9
7 changed files with 103 additions and 4 deletions

View File

@@ -71,6 +71,40 @@ For contributing new agents or improving existing ones:
- Define explicit scope and authority boundaries
- Follow existing agent patterns in `agents/` directory
#### YAML frontmatter schema
```yaml
---
name: <agent-name>
description: <one-line description>
category: testing | quality | process | infrastructure | release | docs | support | meta
memory: enabled # optional; default enabled. Set to disabled for stateless utility agents
---
```
#### Session-start protocol (for session-bound agents)
Agents that do ongoing work across sessions should include a session-start block:
1. Check for `.kaizen/agents/<name>/memory.md` in the project root
2. If present, read it and acknowledge relevant context in the opening brief
3. Optionally invoke `kaizen-agentic memory brief <name>` for cross-agent orientation
Include this block in the agent prompt under a `## Session Start` heading.
#### Session-close protocol (for session-bound agents)
At the end of each session the agent should:
1. Update `## Accumulated Findings`, `## What Worked`, `## Watch Points` as needed
2. Append one line to `## Session Log` (format: `YYYY-MM-DD · <summary> · <outcome>`)
3. Bump `last_updated` and `session_count` in the frontmatter
Include this block in the agent prompt under a `## Session Close` heading.
Agents for which session state is irrelevant (e.g. `keepaTodofile`, `keepaChangelog`)
should set `memory: disabled` in their frontmatter and omit these sections.
## Types of Contributions
We welcome various types of contributions: