From 592bb2da6b02f655fb97087362b1e25f26b65238 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 23:06:33 +0000 Subject: [PATCH] feat(bugfix-tdd): add enforcement-candidate guidance to learning step Extend step 5 to require agents to climb to the highest actionable contract per bug fix: root cause, principle, anti-pattern, and a candidate enforcement artifact (test, lint rule, schema scan, helper, or checklist). A bug class without a candidate enforcement artifact is only partially learned. --- .agents/skills/bugfix-tdd/SKILL.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.agents/skills/bugfix-tdd/SKILL.md b/.agents/skills/bugfix-tdd/SKILL.md index eb07e65..8090971 100644 --- a/.agents/skills/bugfix-tdd/SKILL.md +++ b/.agents/skills/bugfix-tdd/SKILL.md @@ -62,6 +62,15 @@ class, missing guardrail, or project-specific workflow lesson. The canonical record is `docs/learnings/`; legacy files such as `BUG_PATTERNS.md` and `LESSONS_LEARNED.md` may be candidate artifacts when a project still uses them. +For each captured learning, climb to the highest actionable contract: + +- **Root cause** — not the symptom; trace to what structural gap allowed it. +- **Principle** — the violated contract, stated broadly enough to catch sibling bugs. +- **Anti-pattern** — the thought pattern or shortcut that produced the bug. +- **Enforcement candidate** — at least one mechanical check that would prevent recurrence: a test, lint rule, schema scan, shared helper, or checklist item. + +A bug class is only fully learned when it leaves behind a candidate enforcement artifact, not just a narrative note. If no mechanical check is immediately practical, name the one that would be and record it as a candidate. + ### 6. Summarize Tell the user: