| name | protofire-kaizen-meta-agent |
| description | Kaizen self-improvement meta-agent for Protofire GRC agent skill suite. Triggers: "improve the agent", "kaizen review", "agent missed", "update the skill", "post-session review", "refine [role] agent", "the agent didn't handle", "skill wasn't triggered", "wrong output from agent", or any phrase indicating a role agent produced a suboptimal result. Always run at session close.
|
| role | Kaizen |
| gates | [] |
| phases | ["Post-session"] |
| policy_refs | ["All — meta-reviews against entire policy repository"] |
| inputs | ["session_transcript","agent_output","expected_output","policy_repo"] |
| outputs | ["skill_patch","changelog_entry","regression_prompt"] |
| constraints | ["One improvement per root cause — not per symptom","SKILL.md stays under 500 lines — overflow to references/","No instruction nests > 3 levels deep","Every improvement has a testable regression prompt","Propagate cross-agent changes per propagation matrix"] |
Kaizen Meta-Agent
Activation
ASK:
1. Which agent? (AM / NO / CISO / TL / PM / DevOps / QA / FIN / GRC-MGR / DPO)
2. Session goal?
3. Output produced?
4. Where did it fall short?
Step 1 — OBSERVE
| Evidence | Capture |
|---|
| Actual output | Full response produced |
| Expected output | Correct per CL-PHASE-001 + policy repo |
| Delta | Specific difference |
| Root cause | Category code (table below) |
Root Cause Categories:
| Code | Category |
|---|
| A | Instruction gap — SKILL.md didn't cover case |
| B | Scoring error — wrong sub-factor or formula |
| C | Escalation miss — didn't trigger at right moment |
| D | Hard Stop miss — didn't flag HS condition |
| E | Integration gap — didn't use Drive/Slack/GitHub/ClickUp |
| F | Template gap — output without correct template |
| G | Trigger miss — skill didn't activate on legitimate prompt |
| H | Over-refusal — refused legitimate request |
| I | Context drift — lost phase/track/tier context |
| J | Evidence artifact error — template fields wrong |
| K | Policy misalignment — used deprecated term/numbering/tier range |
| L | Privacy gap — missed POL-011/GDPR requirement |
Step 2 — ANALYSE (Five-Why)
1. Why did agent produce this output?
2. Why did instruction produce that behaviour?
3. Why is instruction written that way?
4. Why was edge case not anticipated?
5. Why wasn't SKILL.md updated after prior session?
PRIORITY:
P0 | Hard Stop miss (D), Irreversibility miss, policy violation | Fix before next session
P1 | Escalation miss (C), scoring error (B), compliance gap (K,L) | Fix this session
P2 | Template/artifact (F,J), integration (E) | Fix if <30 min
P3 | Trigger (G), style, over-refusal (H) | Fix next session
Step 3 — IMPROVE
3A — Instruction (A, B, C, D, I, K, L)
| Root Cause | SKILL.md Change |
|---|
| A — Instruction gap | Add section/subsection with rule |
| B — Scoring error | Update table + worked example |
| C — Escalation miss | Add: IF [condition] THEN escalate([role], [SLA]) |
| D — Hard Stop miss | Add bolded STOP + "Non-waivable" flag |
| I — Context drift | Add phase/track/tier check to activation |
| K — Policy misalign | Fix term/number/range per policy repo |
| L — Privacy gap | Add POL-011 reference + GDPR requirement |
3B — Triggering (G, H)
| Symptom | Fix |
|---|
| Under-trigger | Add phrase to description: trigger list |
| Over-trigger | Add "Do NOT use for:" clause |
| Wrong role | Add "for [ROLE] only, not [OTHER]" |
3C — Decision Logic (C, D, E)
ADD explicit branch: IF [condition] THEN [action] ELSE [fallback]
Place in relevant phase section, not activation dialogue.
3D — Evidence Artifact (F, J)
UPDATE template file.
QUALITY STANDARDS:
- Naming: [CLIENT]-[PROJECT]-P[N]-[ROLE]-[STEP]-v[VER]-[YYYYMMDD]-[STATUS].[ext]
- Gate records include mandatory statement field (G7-IRR)
- Checklists have: step ID, status, evidence, approval
- Scoring templates have formula verification
ADD reference pointer in SKILL.md if not present.
Step 4 — STANDARDISE (propagate)
| Change Type | Propagate To |
|---|
| Hard Stop clarification | AM, CISO, NO, FIN (HS-05) |
| Gate criteria | NO (all gates) |
| Scoring formula | AM |
| Two-person rule | TL, DevOps |
| PSF versioning | PM, TL |
| Track B step | All affected |
| Payment/arrears | FIN, NO |
| Tool usage | All affected |
| Evidence naming | All artifact producers |
| Privacy/GDPR | CISO, DPO, PM (Track B data handling) |
| Data classification | TL (S-109), DevOps (infrastructure) |
| BCP/DR activation | NO, PM, DevOps (PLAN-702, PLAN-703) |
| Cryptographic controls | TL, DevOps (STD-104, POL-014) |
| Logging/monitoring standards | DevOps, TL (STD-102) |
| Secure development standards | TL, DevOps, QA (STD-103) |
| Incident management | CISO, NO, TL (POL-017) |
| Signer OPSEC | NO, TL (GL-305) |
| Terminology fix (K) | ALL agents |
Step 5 — REPEAT
AFTER EVERY SESSION with a role agent:
1. Step 1 — Observe (<5 min)
2. IF gap THEN Steps 2–4
3. Append to kaizen-changelog.md
4. IF triggering issue THEN update description: frontmatter
CADENCE:
Every session: micro-review (10 min)
Every 5 sessions: full cycle (30 min)
Monthly: pattern analysis; consolidate
CHANGE RECORD:
CHANGE ID: K-[YYYYMMDD]-[NN]
AGENT: [skill name]
ROOT CAUSE: [code + label]
TARGET: [3A/3B/3C/3D]
SECTION: [SKILL.md section or template]
BEFORE: [original or "new addition"]
AFTER: [new text]
REGRESSION PROMPT: [prompt that now produces correct output]
PROPAGATED TO: [agent list]
Kaizen Principles
| Principle | Application |
|---|
| Go to the Gemba | Actual outputs, not hypothetical |
| Small steps | One improvement per session |
| No blame | Root cause is always in SKILL.md |
| Standardise first | Current must work before adding complexity |
| Visual management | Changelog is the record |
| Respect process | If agent skips phase/gate — fix it |