cc-codeconductor 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/README.md +326 -87
  2. package/dist/core/compilation/compile-checker.d.ts +2 -0
  3. package/dist/core/loop/loop-engine.d.ts +3 -0
  4. package/dist/core/verification/verification-runner.d.ts +7 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +3825 -597
  7. package/dist/library.js +195 -18
  8. package/dist/validation/schemas.d.ts +461 -44
  9. package/package.json +4 -1
  10. package/presets/agy/AGENTS.md +13 -9
  11. package/presets/agy/gates/pre-commit/GATE.md +5 -4
  12. package/presets/agy/hooks.json +2 -2
  13. package/presets/agy/scripts/invoke-hook.cjs +115 -0
  14. package/presets/agy/skills/backlog/SKILL.md +61 -0
  15. package/presets/agy/skills/cc-spec-mutation/SKILL.md +165 -0
  16. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +3 -0
  17. package/presets/agy/skills/evaluation/SKILL.md +61 -2
  18. package/presets/agy/skills/openspec/SKILL.md +50 -16
  19. package/presets/agy/skills/security-ai-llm/SKILL.md +43 -0
  20. package/presets/agy/skills/security-blue-team/SKILL.md +43 -0
  21. package/presets/agy/skills/security-cloud/SKILL.md +43 -0
  22. package/presets/agy/skills/security-crypto/SKILL.md +43 -0
  23. package/presets/agy/skills/security-exploit-dev/SKILL.md +45 -0
  24. package/presets/agy/skills/security-grc/SKILL.md +43 -0
  25. package/presets/agy/skills/security-incident-response/SKILL.md +45 -0
  26. package/presets/agy/skills/security-log-analysis/SKILL.md +43 -0
  27. package/presets/agy/skills/security-malware-analysis/SKILL.md +44 -0
  28. package/presets/agy/skills/security-mobile/SKILL.md +43 -0
  29. package/presets/agy/skills/security-network/SKILL.md +43 -0
  30. package/presets/agy/skills/security-ot-ics/SKILL.md +43 -0
  31. package/presets/agy/skills/security-recon/SKILL.md +45 -0
  32. package/presets/agy/skills/security-red-team/SKILL.md +44 -0
  33. package/presets/agy/skills/security-reverse-engineering/SKILL.md +44 -0
  34. package/presets/agy/skills/security-soc-automation/SKILL.md +43 -0
  35. package/presets/agy/skills/security-threat-hunting/SKILL.md +43 -0
  36. package/presets/agy/skills/security-vuln-assessment/SKILL.md +45 -0
  37. package/presets/agy/skills/security-web/SKILL.md +44 -0
  38. package/presets/agy/skills/testing-tdd/SKILL.md +53 -0
  39. package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
  40. package/presets/agy/workflows/cc-api-contract.md +14 -0
  41. package/presets/agy/workflows/cc-ask.md +2 -1
  42. package/presets/agy/workflows/cc-backlog.md +69 -0
  43. package/presets/agy/workflows/cc-db-migration.md +14 -0
  44. package/presets/agy/workflows/cc-explore.md +1 -1
  45. package/presets/agy/workflows/cc-feature.md +18 -0
  46. package/presets/agy/workflows/cc-fix.md +14 -0
  47. package/presets/agy/workflows/cc-iterative.md +14 -0
  48. package/presets/agy/workflows/cc-openspec.md +17 -1
  49. package/presets/agy/workflows/cc-scorecard.md +2 -0
  50. package/presets/agy/workflows/cc-security.md +180 -0
  51. package/presets/agy/workflows/cc-spec-mutation.md +191 -0
  52. package/presets/agy/workflows/cc-tdd-cycle.md +14 -0
  53. package/presets/claude/CLAUDE.md +4 -0
  54. package/presets/claude/commands/cc/api-contract.md +14 -0
  55. package/presets/claude/commands/cc/ask.md +2 -1
  56. package/presets/claude/commands/cc/backlog.md +104 -0
  57. package/presets/claude/commands/cc/db-migration.md +14 -0
  58. package/presets/claude/commands/cc/explore.md +1 -1
  59. package/presets/claude/commands/cc/feature.md +18 -0
  60. package/presets/claude/commands/cc/fix.md +17 -0
  61. package/presets/claude/commands/cc/iterative.md +14 -0
  62. package/presets/claude/commands/cc/openspec.md +30 -1
  63. package/presets/claude/commands/cc/review.md +3 -0
  64. package/presets/claude/commands/cc/scorecard.md +2 -0
  65. package/presets/claude/commands/cc/security.md +179 -0
  66. package/presets/claude/commands/cc/spec-mutation.md +190 -0
  67. package/presets/claude/commands/cc/tdd-cycle.md +17 -0
  68. package/presets/claude/gates/pre-commit/GATE.md +5 -4
  69. package/presets/claude/settings.json +13 -11
  70. package/presets/claude/skills/backlog/SKILL.md +61 -0
  71. package/presets/claude/skills/evaluation/SKILL.md +47 -24
  72. package/presets/claude/skills/openspec/SKILL.md +46 -34
  73. package/presets/claude/skills/security/SKILL.md +382 -0
  74. package/presets/claude/skills/security-ai-llm/SKILL.md +43 -0
  75. package/presets/claude/skills/security-blue-team/SKILL.md +43 -0
  76. package/presets/claude/skills/security-cloud/SKILL.md +43 -0
  77. package/presets/claude/skills/security-crypto/SKILL.md +43 -0
  78. package/presets/claude/skills/security-exploit-dev/SKILL.md +45 -0
  79. package/presets/claude/skills/security-grc/SKILL.md +43 -0
  80. package/presets/claude/skills/security-incident-response/SKILL.md +45 -0
  81. package/presets/claude/skills/security-log-analysis/SKILL.md +43 -0
  82. package/presets/claude/skills/security-malware-analysis/SKILL.md +44 -0
  83. package/presets/claude/skills/security-mobile/SKILL.md +43 -0
  84. package/presets/claude/skills/security-network/SKILL.md +43 -0
  85. package/presets/claude/skills/security-ot-ics/SKILL.md +43 -0
  86. package/presets/claude/skills/security-recon/SKILL.md +45 -0
  87. package/presets/claude/skills/security-red-team/SKILL.md +44 -0
  88. package/presets/claude/skills/security-reverse-engineering/SKILL.md +44 -0
  89. package/presets/claude/skills/security-soc-automation/SKILL.md +43 -0
  90. package/presets/claude/skills/security-threat-hunting/SKILL.md +43 -0
  91. package/presets/claude/skills/security-vuln-assessment/SKILL.md +45 -0
  92. package/presets/claude/skills/security-web/SKILL.md +44 -0
  93. package/presets/claude/skills/testing-tdd/SKILL.md +53 -0
  94. package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
  95. package/presets/codex/AGENTS.md +16 -12
  96. package/presets/codex/commands/cc-ask.md +2 -1
  97. package/presets/codex/gates/pre-commit/GATE.md +5 -4
  98. package/presets/codex/skills/backlog/SKILL.md +61 -0
  99. package/presets/codex/skills/cc-api-contract/SKILL.md +87 -0
  100. package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
  101. package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
  102. package/presets/codex/skills/cc-council/SKILL.md +92 -0
  103. package/presets/codex/skills/cc-db-migration/SKILL.md +88 -0
  104. package/presets/codex/skills/cc-explore/SKILL.md +40 -0
  105. package/presets/codex/skills/cc-feature/SKILL.md +154 -0
  106. package/presets/codex/skills/cc-fix/SKILL.md +165 -0
  107. package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
  108. package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
  109. package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
  110. package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
  111. package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
  112. package/presets/codex/skills/cc-refactor/SKILL.md +163 -0
  113. package/presets/codex/skills/cc-review/SKILL.md +152 -0
  114. package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
  115. package/presets/codex/skills/cc-security/SKILL.md +182 -0
  116. package/presets/codex/skills/cc-spec-mutation/SKILL.md +192 -0
  117. package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
  118. package/presets/codex/skills/cc-test-plan/SKILL.md +153 -0
  119. package/presets/codex/skills/cc-triage/SKILL.md +38 -0
  120. package/presets/codex/skills/evaluation/SKILL.md +65 -0
  121. package/presets/codex/skills/openspec/SKILL.md +66 -0
  122. package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
  123. package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
  124. package/presets/cursor/AGENTS.md +2 -2
  125. package/presets/cursor/commands/cc/api-contract.md +14 -0
  126. package/presets/cursor/commands/cc/ask.md +2 -1
  127. package/presets/cursor/commands/cc/backlog.md +105 -0
  128. package/presets/cursor/commands/cc/db-migration.md +14 -0
  129. package/presets/cursor/commands/cc/explore.md +1 -1
  130. package/presets/cursor/commands/cc/feature.md +18 -0
  131. package/presets/cursor/commands/cc/fix.md +17 -0
  132. package/presets/cursor/commands/cc/iterative.md +14 -0
  133. package/presets/cursor/commands/cc/openspec.md +30 -1
  134. package/presets/cursor/commands/cc/scorecard.md +2 -0
  135. package/presets/cursor/commands/cc/security.md +179 -0
  136. package/presets/cursor/commands/cc/spec-mutation.md +190 -0
  137. package/presets/cursor/commands/cc/tdd-cycle.md +14 -0
  138. package/presets/cursor/gates/pre-commit/GATE.md +5 -4
  139. package/presets/cursor/skills/backlog/SKILL.md +61 -0
  140. package/presets/cursor/skills/evaluation/SKILL.md +61 -4
  141. package/presets/cursor/skills/openspec/SKILL.md +47 -33
  142. package/presets/cursor/skills/security-ai-llm/SKILL.md +43 -0
  143. package/presets/cursor/skills/security-blue-team/SKILL.md +43 -0
  144. package/presets/cursor/skills/security-cloud/SKILL.md +43 -0
  145. package/presets/cursor/skills/security-crypto/SKILL.md +43 -0
  146. package/presets/cursor/skills/security-exploit-dev/SKILL.md +45 -0
  147. package/presets/cursor/skills/security-grc/SKILL.md +43 -0
  148. package/presets/cursor/skills/security-incident-response/SKILL.md +45 -0
  149. package/presets/cursor/skills/security-log-analysis/SKILL.md +43 -0
  150. package/presets/cursor/skills/security-malware-analysis/SKILL.md +44 -0
  151. package/presets/cursor/skills/security-mobile/SKILL.md +43 -0
  152. package/presets/cursor/skills/security-network/SKILL.md +43 -0
  153. package/presets/cursor/skills/security-ot-ics/SKILL.md +43 -0
  154. package/presets/cursor/skills/security-recon/SKILL.md +45 -0
  155. package/presets/cursor/skills/security-red-team/SKILL.md +44 -0
  156. package/presets/cursor/skills/security-reverse-engineering/SKILL.md +44 -0
  157. package/presets/cursor/skills/security-soc-automation/SKILL.md +43 -0
  158. package/presets/cursor/skills/security-threat-hunting/SKILL.md +43 -0
  159. package/presets/cursor/skills/security-vuln-assessment/SKILL.md +45 -0
  160. package/presets/cursor/skills/security-web/SKILL.md +44 -0
  161. package/presets/cursor/skills/testing-tdd/SKILL.md +35 -574
  162. package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
  163. package/presets/gemini/commands/cc/api-contract.toml +82 -0
  164. package/presets/gemini/commands/cc/ask.toml +54 -0
  165. package/presets/gemini/commands/cc/backlog.toml +103 -0
  166. package/presets/gemini/commands/cc/clarify.toml +31 -0
  167. package/presets/gemini/commands/cc/council.toml +87 -0
  168. package/presets/gemini/commands/cc/db-migration.toml +83 -0
  169. package/presets/gemini/commands/cc/explore.toml +35 -0
  170. package/presets/gemini/commands/cc/feature.toml +153 -0
  171. package/presets/gemini/commands/cc/fix.toml +163 -0
  172. package/presets/gemini/commands/cc/handoff.toml +40 -0
  173. package/presets/gemini/commands/cc/iterative.toml +145 -0
  174. package/presets/gemini/commands/cc/openspec.toml +186 -0
  175. package/presets/gemini/commands/cc/pagespeed.toml +119 -0
  176. package/presets/gemini/commands/cc/prototype.toml +37 -0
  177. package/presets/gemini/commands/cc/refactor.toml +158 -0
  178. package/presets/gemini/commands/cc/review.toml +150 -0
  179. package/presets/gemini/commands/cc/scorecard.toml +77 -0
  180. package/presets/gemini/commands/cc/security.toml +177 -0
  181. package/presets/gemini/commands/cc/spec-mutation.toml +187 -0
  182. package/presets/gemini/commands/cc/tdd-cycle.toml +264 -0
  183. package/presets/gemini/commands/cc/test-plan.toml +148 -0
  184. package/presets/gemini/commands/cc/triage.toml +33 -0
  185. package/presets/opencode/README.md +24 -21
  186. package/presets/opencode/agents/architect.md +6 -0
  187. package/presets/opencode/agents/implementer.md +7 -0
  188. package/presets/opencode/agents/reviewer.md +6 -0
  189. package/presets/opencode/agents/tester.md +6 -0
  190. package/presets/opencode/commands/cc-api-contract.md +14 -0
  191. package/presets/opencode/commands/cc-ask.md +2 -1
  192. package/presets/opencode/commands/cc-backlog.md +68 -0
  193. package/presets/opencode/commands/cc-db-migration.md +14 -0
  194. package/presets/opencode/commands/cc-explore.md +1 -1
  195. package/presets/opencode/commands/cc-feature.md +18 -0
  196. package/presets/opencode/commands/cc-fix.md +17 -0
  197. package/presets/opencode/commands/cc-iterative.md +14 -0
  198. package/presets/opencode/commands/cc-openspec.md +17 -1
  199. package/presets/opencode/commands/cc-scorecard.md +2 -0
  200. package/presets/opencode/commands/cc-security.md +179 -0
  201. package/presets/opencode/commands/cc-spec-mutation.md +190 -0
  202. package/presets/opencode/commands/cc-tdd-cycle.md +14 -0
  203. package/presets/opencode/gates/pre-commit/GATE.md +5 -4
  204. package/presets/opencode/opencode.jsonc +1 -1
  205. package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
  206. package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
  207. package/presets/opencode/prompts/v1.0.0/reviewer.md +6 -0
  208. package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
  209. package/presets/opencode/skills/backlog/SKILL.md +61 -0
  210. package/presets/opencode/skills/evaluation/SKILL.md +61 -2
  211. package/presets/opencode/skills/openspec/SKILL.md +47 -31
  212. package/presets/opencode/skills/security-ai-llm/SKILL.md +43 -0
  213. package/presets/opencode/skills/security-blue-team/SKILL.md +43 -0
  214. package/presets/opencode/skills/security-cloud/SKILL.md +43 -0
  215. package/presets/opencode/skills/security-crypto/SKILL.md +43 -0
  216. package/presets/opencode/skills/security-exploit-dev/SKILL.md +45 -0
  217. package/presets/opencode/skills/security-grc/SKILL.md +43 -0
  218. package/presets/opencode/skills/security-incident-response/SKILL.md +45 -0
  219. package/presets/opencode/skills/security-log-analysis/SKILL.md +43 -0
  220. package/presets/opencode/skills/security-malware-analysis/SKILL.md +44 -0
  221. package/presets/opencode/skills/security-mobile/SKILL.md +43 -0
  222. package/presets/opencode/skills/security-network/SKILL.md +43 -0
  223. package/presets/opencode/skills/security-ot-ics/SKILL.md +43 -0
  224. package/presets/opencode/skills/security-recon/SKILL.md +45 -0
  225. package/presets/opencode/skills/security-red-team/SKILL.md +44 -0
  226. package/presets/opencode/skills/security-reverse-engineering/SKILL.md +44 -0
  227. package/presets/opencode/skills/security-soc-automation/SKILL.md +43 -0
  228. package/presets/opencode/skills/security-threat-hunting/SKILL.md +43 -0
  229. package/presets/opencode/skills/security-vuln-assessment/SKILL.md +45 -0
  230. package/presets/opencode/skills/security-web/SKILL.md +44 -0
  231. package/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
  232. package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
  233. package/presets/shared/__pycache__/mutation_runner.cpython-314.pyc +0 -0
  234. package/presets/shared/invoke-hook.cjs +115 -0
  235. package/presets/shared/mutation_runner.py +273 -0
  236. package/src/presets/council/council.yml +12 -0
  237. package/src/presets/manifests/agy.yml +2 -0
  238. package/src/presets/manifests/claude.yml +3 -0
  239. package/src/presets/manifests/gemini.yml +15 -0
  240. package/src/presets/models/agy.yml +24 -24
  241. package/src/presets/models/claude.yml +10 -10
  242. package/src/presets/models/codex.yml +10 -10
  243. package/src/presets/models/cursor.yml +10 -10
  244. package/src/presets/models/gemini.yml +10 -10
  245. package/src/presets/models/opencode.yml +10 -10
  246. package/presets/agy/scripts/post-tool.sh +0 -25
  247. package/presets/agy/scripts/pre-tool.sh +0 -56
@@ -20,6 +20,20 @@ Command: `api-contract` (fixed for this workflow — do not infer from user text
20
20
 
21
21
  ---
22
22
 
23
+ ## Step 0b — OpenSpec quality gates
24
+
25
+ If `openspec status` reports an active change folder:
26
+
27
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
28
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
29
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
30
+ 4. Next command spelling on this runner: `/cc:api-contract`
31
+
32
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
33
+
34
+ ---
35
+
36
+
23
37
  ## Step 1 — Task Card validation (Task Coach role)
24
38
 
25
39
  Invoke the `task-coach` subagent via the Task tool.
@@ -36,10 +36,11 @@ The catalog is only:
36
36
  | `/cc:refactor` | structure, no behavior change |
37
37
  | `/cc:review` | inspect a diff/PR |
38
38
  | `/cc:tdd-cycle` | red → green → refactor |
39
+ | `/cc:backlog` | create or append BACKLOG.md / objectives |
39
40
  | `/cc:openspec` | BACKLOG / BC-xxx delivery |
40
41
 
41
42
  If the CLI is unavailable, apply the same catalog and the same priority:
42
- openspec → tdd-cycle → review → refactor → fix → feature (default).
43
+ backlog (author) vs openspec (deliver) → tdd-cycle → review → refactor → fix → feature (default).
43
44
 
44
45
  ---
45
46
 
@@ -0,0 +1,105 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Author BACKLOG.md — wayfinding, grilling, create or append items,
4
+ validate with openspec, and plan OpenSpec change folders for /cc-openspec.
5
+ ---
6
+
7
+ # Backlog Authoring Workflow
8
+
9
+ Objectives: $ARGUMENTS
10
+
11
+ Create or append valid `BACKLOG.md` items and OpenSpec change docs. Do **not**
12
+ deliver implementation — that is `/cc-openspec`.
13
+
14
+ ---
15
+
16
+ ## Step 0 — CCEP Bootstrap
17
+
18
+ Command: `backlog` (fixed for this workflow — do not infer from user text)
19
+
20
+ 1. Run: `npx cc-codeconductor ccep parse --command backlog "$ARGUMENTS" --output json`
21
+ 2. Run: `npx cc-codeconductor ccep resolve --command backlog "$ARGUMENTS" --output json`
22
+ 3. Run: `npx cc-codeconductor ccep profile backlog --output json`
23
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command backlog --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
24
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
25
+
26
+ ---
27
+
28
+ ## Step 1 — Wayfinding (repo-explorer)
29
+
30
+ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
31
+ `graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`
32
+ to map modules, conventions, and impact radius. Do not write `BACKLOG.md` in
33
+ this step. Record a Repo Map so Scope names real files or modules.
34
+
35
+ ---
36
+
37
+ ## Step 2 — Relentless Grilling (task-coach)
38
+
39
+ Invoke `task-coach`. Produce complete backlog item fields: title, type, risk,
40
+ scope, description, out of scope, measurable acceptance criteria.
41
+
42
+ Every assumption must survive one grilling question. Reject vague acceptance
43
+ ("improve UX", "fix bugs").
44
+
45
+ If any field is missing or ambiguous, ask one clarifying question at a time.
46
+
47
+ **STOP here.** Unresolved grilling questions populate `questionsForUser` in the
48
+ CCEP-1 `planner-output`; `ccep evaluate --command backlog` halts until a human
49
+ answers. Do not write `BACKLOG.md` until that confirmation.
50
+
51
+ ---
52
+
53
+ ## Step 3 — Write or append BACKLOG.md (docs)
54
+
55
+ Apply skill `backlog`.
56
+
57
+ - If `BACKLOG.md` is absent, create it from the canonical template
58
+ (`presets/templates/BACKLOG.md`). Set Global `Product` from `package.json`
59
+ `name` when present.
60
+ - If it exists, append new `### BC-xxx` items under `## Items`. Do not rewrite
61
+ `## Global` or `## Archive`.
62
+ - Next ID = max `BC-NNN` across Items and Archive, plus one.
63
+ - New items: Status `READY`, Progress `0%`, measurable Acceptance checklist.
64
+
65
+ Do **not** `git add` `BACKLOG.md` or `openspec/`.
66
+
67
+ ---
68
+
69
+ ## Step 4 — Validate (mandatory gate)
70
+
71
+ Run:
72
+
73
+ ```bash
74
+ npx cc-codeconductor openspec validate
75
+ ```
76
+
77
+ If validation fails:
78
+
79
+ 1. List all errors and recommendations from the CLI output.
80
+ 2. Show the canonical BACKLOG.md structure (## Global, ## Items, ### BC-001 | Title, Priority, Status, Type, Depends on, Description, Scope, Acceptance).
81
+ 3. Fix the file and re-run validate. **STOP** planning until valid.
82
+
83
+ ---
84
+
85
+ ## Step 5 — Plan new items
86
+
87
+ For each **new** `BC-xxx` from this run:
88
+
89
+ ```bash
90
+ npx cc-codeconductor openspec plan <BC-id>
91
+ ```
92
+
93
+ Show TaskCards and `openspec/changes/<slug>/` (proposal, design, tasks, specs).
94
+
95
+ ---
96
+
97
+ ## Completion
98
+
99
+ Report: item IDs added, validate result, change folder paths.
100
+
101
+ Tell the user to run `/cc-openspec` (optionally `/cc-openspec BC-xxx`) to
102
+ deliver. Do not start delivery in this workflow.
103
+
104
+ Apply skill `backlog` for create/append rules. Apply skill `openspec` only for
105
+ format and state-machine reference.
@@ -21,6 +21,20 @@ Command: `db-migration` (fixed for this workflow — do not infer from user text
21
21
 
22
22
  ---
23
23
 
24
+ ## Step 0b — OpenSpec quality gates
25
+
26
+ If `openspec status` reports an active change folder:
27
+
28
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
29
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
30
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
31
+ 4. Next command spelling on this runner: `/cc:db-migration`
32
+
33
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
34
+
35
+ ---
36
+
37
+
24
38
  ## Step 1 — Task Card validation (Task Coach role)
25
39
 
26
40
  Invoke the `task-coach` subagent via the Task tool.
@@ -27,7 +27,7 @@ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"`. Invoke `
27
27
 
28
28
  ## Step 2 — Suggest next command (orchestrator)
29
29
 
30
- Recommend exactly one next slash command (`/cc:feature`, `/cc:fix`, `/cc:refactor`, `/cc:review`, `/cc:triage`, …) with a one-sentence rationale. Do not start that workflow.
30
+ Recommend exactly one next slash command (`/cc:feature`, `/cc:fix`, `/cc:refactor`, `/cc:review`, `/cc:backlog`, `/cc:openspec`, `/cc:triage`, …) with a one-sentence rationale. Do not start that workflow.
31
31
 
32
32
  ---
33
33
 
@@ -23,6 +23,24 @@ Command: `feature` (fixed for this workflow — do not infer from user text)
23
23
 
24
24
  ---
25
25
 
26
+ ## Step 0b — OpenSpec quality gates
27
+
28
+ If `openspec status` reports an active change folder:
29
+
30
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
31
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
32
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
33
+ 4. Next command spelling on this runner: `/cc:feature`
34
+
35
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
36
+
37
+ Skills: `using-cc-skills`, `openspec`, `testing-tdd`, `evaluation`.
38
+ Do not skip `openspec analyze` when a change folder is active.
39
+ "I'll add tests later" is not allowed — tester before implementer.
40
+
41
+ ---
42
+
43
+
26
44
  ## Step 1 — Wayfinding (repo-explorer)
27
45
 
28
46
  If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
@@ -31,6 +31,20 @@ Command: `fix` (fixed for this workflow — do not infer from user text)
31
31
 
32
32
  ---
33
33
 
34
+ ## Step 0b — OpenSpec quality gates
35
+
36
+ If `openspec status` reports an active change folder:
37
+
38
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
39
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
40
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
41
+ 4. Next command spelling on this runner: `/cc:fix`
42
+
43
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
44
+
45
+ ---
46
+
47
+
34
48
  ## Step 1 — Wayfinding (repo-explorer)
35
49
 
36
50
  If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
@@ -146,3 +160,6 @@ Report: Task Card, Implementation Summary, regression test added, Review Report
146
160
 
147
161
  The fix is complete only when: the regression test passes, the full suite
148
162
  passes, and no CRITICAL review findings remain.
163
+
164
+ Skills: `testing-tdd`, `evaluation`. Record `scorecard create --from-diff`.
165
+ A small fix still needs a Task Card and a failing regression test first.
@@ -23,6 +23,20 @@ Command: `iterative` (fixed for this workflow — do not infer from user text)
23
23
 
24
24
  ---
25
25
 
26
+ ## Step 0b — OpenSpec quality gates
27
+
28
+ If `openspec status` reports an active change folder:
29
+
30
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
31
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
32
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
33
+ 4. Next command spelling on this runner: `/cc:iterative`
34
+
35
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
36
+
37
+ ---
38
+
39
+
26
40
  ## Step 1 — Wayfinding (repo-explorer)
27
41
 
28
42
  If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
@@ -27,6 +27,20 @@ Command: `openspec` (fixed for this workflow — do not infer from user text)
27
27
 
28
28
  ---
29
29
 
30
+ ## Step 0b — OpenSpec quality gates
31
+
32
+ If `openspec status` reports an active change folder:
33
+
34
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
35
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
36
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
37
+ 4. Next command spelling on this runner: `/cc:openspec`
38
+
39
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
40
+
41
+ ---
42
+
43
+
30
44
  ## Step 1 — Validate (mandatory gate)
31
45
 
32
46
  Run:
@@ -86,6 +100,21 @@ Update BACKLOG item status to `PLANNED` (CLI does this automatically).
86
100
 
87
101
  ---
88
102
 
103
+ ## Drive card status (CLI)
104
+
105
+ Do not edit `.codeconductor/openspec-state.json` by hand.
106
+
107
+ ```bash
108
+ npx cc-codeconductor openspec start <cardId>
109
+ npx cc-codeconductor openspec done <cardId>
110
+ npx cc-codeconductor openspec block <cardId> --reason "waiting on design"
111
+ npx cc-codeconductor openspec archive <itemId>
112
+ ```
113
+
114
+ `start` moves the card `pending → doing` and the item `PLANNED → IN_PROGRESS`. `done` marks the card complete, updates Progress, and moves the item to `REVIEW` when every card is done and review is required. `archive` requires all cards done (and review evidence when Global review is required) and moves `openspec/changes/<slug>` to `archive/`.
115
+
116
+ ---
117
+
89
118
  ## Step 5 — Model matrix and execute loop
90
119
 
91
120
  Before executing phases, show resolved models:
@@ -115,7 +144,7 @@ Use the model configured in the installed preset for each agent role.
115
144
  After each phase:
116
145
 
117
146
  - Mark progress in deliverable summary.
118
- - Set TaskCard status to `done` in `.codeconductor/openspec-state.json` when phase completes.
147
+ - Run `npx cc-codeconductor openspec done <cardId>` when the phase completes. Do not edit openspec-state.json by hand.
119
148
 
120
149
  Implementer: create a Git worktree before editing (`git worktree add ../<branch>-session <branch>`).
121
150
 
@@ -26,6 +26,8 @@ Command: `scorecard` (fixed for this workflow — do not infer from user text)
26
26
 
27
27
  Use `$ARGUMENTS` as task id (e.g. `BC-001`) or read active item from `npx cc-codeconductor openspec status`.
28
28
 
29
+ If a change folder exists, run `npx cc-codeconductor openspec analyze --output json` first. `--from-diff` overlays FR/SC coverage onto `acceptance` and TDD evidence onto `tests`.
30
+
29
31
  ---
30
32
 
31
33
  ## Step 2 — Create scorecard with auto-signals
@@ -0,0 +1,179 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Run the authorized defensive security workflow — domain
4
+ security-* skills, authorization gate, risk-based routing, hardening, and review.
5
+ ---
6
+
7
+ # Defensive Security Workflow
8
+
9
+ Security objective: $ARGUMENTS
10
+
11
+ Provide the following information in $ARGUMENTS:
12
+
13
+ - What must be reviewed or hardened, and why
14
+ - Domain: a `security-*` skill id (recon, vuln-assessment, web, cloud, IR,
15
+ hunting, GRC, …) or `web-app` / `api` / `cloud-config` /
16
+ `dependency-supply-chain` / `secrets`
17
+ - Authorization: who authorized this work on this target, and the scope boundary
18
+ - Risk classification (`low`, `medium`, or `high`), if known
19
+ - Scope: which files, modules, repos, or environments are in and out of bounds
20
+
21
+ ---
22
+
23
+ ## Scope and authorization
24
+
25
+ This workflow performs **authorized defensive security work only**: threat
26
+ modeling, hardening, secure configuration, dependency and supply-chain review,
27
+ secret hygiene, and detection coverage.
28
+
29
+ Refuse outright and offer the defensive equivalent instead (threat model,
30
+ hardening, detection coverage, dependency audit):
31
+
32
+ - Exploit or proof-of-concept development
33
+ - Malware authoring, or malware analysis intended for reuse
34
+ - Reverse engineering aimed at bypassing a control
35
+ - Red-team playbooks
36
+ - Any unauthorized-access procedure
37
+
38
+ Scope is limited to the repository under analysis. Do not scan, probe, or
39
+ perform reconnaissance against third-party hosts.
40
+
41
+ Do not proceed without an authorization statement. Do not produce exploit
42
+ payloads, malware, or attack procedures.
43
+
44
+ ---
45
+
46
+ ## Step 0 — CCEP Bootstrap
47
+
48
+ Command: `security` (fixed for this workflow — do not infer from user text)
49
+
50
+ 1. Run: `npx cc-codeconductor ccep parse --command security "$ARGUMENTS" --output json`
51
+ 2. Run: `npx cc-codeconductor ccep resolve --command security "$ARGUMENTS" --output json`
52
+ 3. Run: `npx cc-codeconductor ccep profile security --output json`
53
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command security --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
54
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
55
+ Canonical delivery order is test-before-implement whenever both phases apply.
56
+
57
+ ---
58
+
59
+ ## Step 1 — Wayfinding (repo-explorer)
60
+
61
+ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
62
+ `graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`
63
+ to map modules, conventions, and impact radius. Do not write code in this step.
64
+ Record a Repo Map artifact before intake. Load the matching `security-*` skill
65
+ for the named domain (see `.claude/skills/security-*/SKILL.md`). Keep the OWASP
66
+ `security` skill for application-security reviews.
67
+
68
+ ---
69
+
70
+ ## Step 2 — Task Card validation (task-coach)
71
+
72
+ Invoke `task-coach` with the security objective above.
73
+
74
+ task-coach must produce a Task Card that includes:
75
+
76
+ - Objective: what must be reviewed or hardened, in one sentence
77
+ - Domain: which `security-*` skill applies, or `web-app` / `api` /
78
+ `cloud-config` / `dependency-supply-chain` / `secrets`
79
+ - Authorization: who authorized this work on this target, and the scope boundary
80
+ - Risk classification: `low`, `medium`, or `high`
81
+ - Scope: which files or modules are likely affected
82
+
83
+ If authorization is absent, unclear, or names a system the requester does not
84
+ own or operate, **STOP and refuse. Do not route the task.**
85
+
86
+ Redact secrets, tokens, and credentials from any evidence before it enters the
87
+ Task Card. Summarize logs; do not paste env files.
88
+
89
+ **STOP here. Show the Task Card and wait for human confirmation.**
90
+
91
+ ---
92
+
93
+ ## Step 3 — Route by risk
94
+
95
+ Read the risk field from the Task Card and follow the corresponding route.
96
+
97
+ ### Low-risk route
98
+
99
+ Applies when: the weakness is isolated, not exploitable in the current
100
+ configuration, and no authentication, secret, or dependency boundary is
101
+ involved.
102
+
103
+ Route: `task-coach` → `tester` → `implementer`
104
+
105
+ Proceed directly to Step 4 (tests), then Step 5a.
106
+
107
+ ### Medium or high-risk route
108
+
109
+ Applies when: the work touches authentication, authorization, secrets,
110
+ cryptography, trust-boundary input validation, or a dependency upgrade.
111
+
112
+ Route: `task-coach` → `architect` → `tester` → `implementer` → `reviewer`
113
+
114
+ Invoke `architect` before implementation. architect must:
115
+
116
+ - Identify the weakness and the affected trust boundary
117
+ - Define the hardening approach and affected files
118
+ - Flag any regression risk to adjacent components
119
+ - Produce a Technical Plan
120
+
121
+ On **high** risk, also invoke `security-reviewer` before Reviewer.
122
+
123
+ **STOP here if high-risk. Show the Technical Plan and wait for human approval
124
+ before continuing.**
125
+
126
+ ---
127
+
128
+ ## Step 4 — Tests (tester)
129
+
130
+ Invoke `tester` for all risk levels.
131
+
132
+ tester must:
133
+
134
+ 1. Write a regression test that proves the weakness exists and confirm it fails
135
+ before any change (RED)
136
+ 2. Verify that existing tests still pass
137
+ 3. Produce a Coverage Summary: test added, case covered
138
+
139
+ ---
140
+
141
+ ## Step 5a — Implementation, low-risk (implementer)
142
+
143
+ Invoke `implementer` with the Task Card.
144
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
145
+
146
+ implementer must:
147
+
148
+ 1. Apply the minimal hardening change — no unrelated changes
149
+ 2. Run the suite and make the RED regression test pass
150
+ 3. Produce an Implementation Summary: weakness, change applied, files changed
151
+
152
+ ---
153
+
154
+ ## Step 5b — Implementation, medium/high-risk (implementer)
155
+
156
+ Invoke `implementer` with the approved Technical Plan and the Task Card.
157
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
158
+
159
+ implementer must follow the plan exactly. Any deviation requires a new Technical
160
+ Plan approval. After implementation, run the full test suite. No exploit code.
161
+
162
+ ---
163
+
164
+ ## Step 6 — Review (Reviewer role) — medium/high-risk only
165
+
166
+ Invoke `reviewer` with the diff and Task Card. The Reviewer must apply the OWASP
167
+ rules in the `security` skill.
168
+
169
+ reviewer produces a Review Report with CRITICAL / WARNING / SUGGESTION findings.
170
+ If any CRITICAL findings exist, **STOP**. Do not close the task until they are
171
+ resolved.
172
+
173
+ ---
174
+
175
+ ## Completion
176
+
177
+ Report: Task Card, Implementation Summary, regression test added, Review Report
178
+ (if applicable). The task is complete only when: the regression test passes, the
179
+ full suite passes, and no CRITICAL review findings remain.
@@ -0,0 +1,190 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Spec-locked TDD with a mutation-testing gate — refine the intent
4
+ into an immutable Gherkin contract (SHA-256 frozen), implement under the
5
+ three laws of TDD, pass a judge audit, and merge only if every mutant dies.
6
+ ---
7
+
8
+ # Spec-Mutation — Hard Spec → TDD → Judge → Mutation Gate
9
+
10
+ Scope: $ARGUMENTS
11
+
12
+ Describe what behavior you want to implement. Include:
13
+
14
+ - The function, method, or feature to implement
15
+ - The expected behavior (inputs, outputs, invariants, edge cases)
16
+ - The allowed file scope (production files that may change)
17
+ - The test command for the affected suite (e.g. `pytest tests/test_billing.py`)
18
+
19
+ ---
20
+
21
+ ## Step 0 — CCEP Bootstrap
22
+
23
+ Command: `spec-mutation` (fixed for this workflow — do not infer from user text)
24
+
25
+ 1. Run: `npx cc-codeconductor ccep parse --command spec-mutation "$ARGUMENTS" --output json`
26
+ 2. Run: `npx cc-codeconductor ccep resolve --command spec-mutation "$ARGUMENTS" --output json`
27
+ 3. Run: `npx cc-codeconductor ccep profile spec-mutation --output json`
28
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command spec-mutation --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
29
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
30
+ Canonical delivery order is test-before-implement whenever both phases apply.
31
+
32
+ ---
33
+
34
+ ## Step 0b — OpenSpec quality gates
35
+
36
+ If `openspec status` reports an active change folder:
37
+
38
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
39
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
40
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
41
+ 4. Next command spelling on this runner: `/cc:spec-mutation`
42
+
43
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
44
+
45
+ ---
46
+
47
+ ## Contract
48
+
49
+ The Gherkin specification is the **immutable contract** of the system. No code
50
+ merges unless it survives intentional source mutations. The loop is closed:
51
+
52
+ ```
53
+ [Human + spec_partner] ──> [gherkin_author] ──> [Test Freeze: SHA-256]
54
+
55
+ ┌──────────────────────────────────────────────────────┘
56
+
57
+ [tdd_craftsman] <───────────────┐ (surviving mutant)
58
+ (Red-Green-Refactor) │
59
+ │ │
60
+ ▼ │
61
+ [judge] ───────────> [mutation_testing] ───> [Safe Merge]
62
+ ```
63
+
64
+ Role mapping onto Conductor Agents (AGENTS.md):
65
+
66
+ | Workflow role | Conductor Agent | Deliverable |
67
+ | ------------------ | ----------------- | ------------------------------------------ |
68
+ | `craftsman_lead` | `orchestrator` | Routed Task Cards, per-stage scorecards |
69
+ | `spec_partner` | `task-coach` | Spec draft with invariants and boundaries |
70
+ | `gherkin_author` | `contract-builder`| Strict `.feature` file (Given/When/Then) |
71
+ | `tdd_craftsman` | `tester` → `implementer` | Failing test, then minimal production code |
72
+ | `judge` | `reviewer` | Binary verdict (PASS/REJECT) with scoring |
73
+ | `mutation_testing` | `tester` (runner) | Killed/survived mutant report |
74
+
75
+ ## Stage 1 — Interactive refinement (`spec_partner` / task-coach)
76
+
77
+ Do not jump to implementation. Apply Socratic questioning to the initial intent:
78
+
79
+ - Preconditions, postconditions, and edge cases.
80
+ - Invariant matrix: what must always be true.
81
+ - Scope boundaries: explicit `Scope / Files` and `Scope / Out` for the Task Card.
82
+
83
+ Stop gate: human confirms the draft before formalization.
84
+
85
+ ## Stage 2 — Hard Spec formalization (`gherkin_author` / contract-builder)
86
+
87
+ Formalize the agreed draft into `specs/<task>.feature` using strict Gherkin:
88
+
89
+ - No vague language ("must respond fast" is forbidden — use measurable Then steps).
90
+ - Every scenario declares preconditions (`Given`), actions (`When`), and
91
+ observable states (`Then`).
92
+ - Once the human approves the `.feature`, freeze it:
93
+
94
+ ```bash
95
+ shasum -a 256 specs/<task>.feature tests/ > .codeconductor/tasks/<task_id>.lock
96
+ ```
97
+
98
+ From this point `specs/` and `tests/` are **read-only** for implementation
99
+ agents. Before every later gate, recompute the hash; any single-byte difference
100
+ aborts the pipeline with scorecard 0 (Specification Gaming).
101
+
102
+ ## Stage 3 — TDD under the three laws (`tdd_craftsman`)
103
+
104
+ Delegates to the `/cc:tdd-cycle` state machine (`tddCycleStateMachine` in
105
+ `domain/loop`). Evidence must be captured with `captureTddSuiteEvidence` — do
106
+ not hand-edit JSON under `.codeconductor/evidence/`.
107
+
108
+ 1. **Law 1 (RED):** no production code except to make a failing test pass. A
109
+ compile error from a missing interface counts as a failure.
110
+ 2. **Law 2:** write exactly one failing assertion or scenario at a time.
111
+ 3. **Law 3 (GREEN):** write only the minimal production code to pass. No
112
+ speculative code, no preventive heuristics, stdlib-first.
113
+
114
+ Hard rule: any write attempt against `specs/` or `tests/` during GREEN/REFACTOR
115
+ is a harness violation — stop execution and report.
116
+
117
+ ## Stage 4 — Judge audit (`judge` / reviewer)
118
+
119
+ Deterministic gates before spending compute on mutation:
120
+
121
+ - Clean compile / diagnostics exit code 0.
122
+ - Traceability: every Gherkin step maps to an implemented test step.
123
+ - Scope Gaming audit: `git diff --name-only` must match the Task Card
124
+ `Scope / Files` exactly. Relaxed types, weakened assertions, or out-of-scope
125
+ edits → REJECT with findings.
126
+
127
+ Verdict is binary: PASS continues to the mutation gate; REJECT returns to the
128
+ `implement` phase with the findings attached.
129
+
130
+ ## Stage 5 — Mutation gate (`mutation_testing`)
131
+
132
+ Run the deterministic AST mutator shipped with this preset:
133
+
134
+ ```bash
135
+ python3 presets/shared/mutation_runner.py \
136
+ --target <production_file.py> \
137
+ --test-command "<test command>" \
138
+ --spec-folder specs
139
+ ```
140
+
141
+ The runner applies deterministic operator mutations (`>` → `<=`, `==` → `!=`,
142
+ `is` → `is not`, …) one at a time, re-runs the suite per mutant, and restores
143
+ the original source unconditionally (`finally` rollback).
144
+
145
+ - **Mutant killed (tests fail):** the suite detects the corruption. Continue.
146
+ - **Mutant survived (tests pass):** the tests are blind to this branch. The
147
+ runner writes `specs/handover.md` + appends to
148
+ `specs/implementation-summary.md` and exits with code **2**.
149
+
150
+ Non-Python stacks: substitute Stryker (JS/TS), PITest (JVM), or Mutmut
151
+ (Python full-suite) with the same contract — 100% kill rate or hands-off.
152
+
153
+ ### Hands-off protocol (exit code 2)
154
+
155
+ 1. Do NOT modify production code to "fix" a surviving mutant.
156
+ 2. Route back to `tdd_craftsman` with `specs/handover.md` as input: write the
157
+ missing failing test (Law 1 & 2) that asserts the mutated branch.
158
+ 3. Re-run stages 3–5.
159
+
160
+ ### Circuit breaker (max 3 loops)
161
+
162
+ The orchestrator keeps a persistent counter per Task Card. If the
163
+ `tdd_craftsman ↔ mutation_testing` loop does not reach a 100% kill rate after
164
+ **3 iterations**:
165
+
166
+ - Cancel active subagents (stop token/context spend).
167
+ - `git checkout -- <scope>` rollback to the last clean state.
168
+ - Scorecard: `STATUS = BLOCKED`; escalate to a human operator. The branch stays
169
+ frozen until human arbitration.
170
+
171
+ ## Guardrails (harness-enforced, not prompt-enforced)
172
+
173
+ - **Test Freezing:** SHA-256 of `specs/` + `tests/` stored in
174
+ `.codeconductor/tasks/<task_id>.lock`; hash mismatch aborts the pipeline.
175
+ - **Scope Guardian:** `fs_write`/`fs_patch` paths are validated against the Task
176
+ Card `Scope / Files`; path escapes (`../`) and critical files (`**/.env*`,
177
+ `**/credentials*`, infrastructure roots) are denied per `policy.yml`.
178
+ - **RBAC per role:** `gherkin_author` writes only `specs/`; `tdd_craftsman`
179
+ reads specs/tests and writes only scoped `src/`; `judge` and
180
+ `mutation_testing` are read-only except the runner's rolled-back patch.
181
+ - **Worktree isolation:** run the whole flow in a dedicated `git worktree`;
182
+ protected branches (`main`, `master`, `develop`) are never touched.
183
+
184
+ ## Completion criteria
185
+
186
+ - [ ] `.feature` approved and frozen (SHA-256 lock file exists and matches).
187
+ - [ ] RED → GREEN → REFACTOR evidence captured per phase.
188
+ - [ ] Judge verdict PASS (compile clean, traceability complete, scope clean).
189
+ - [ ] Mutation runner exits 0 with `total_mutants_killed == total_points`.
190
+ - [ ] Scorecard records the kill rate and iteration count (≤ 3).