cc-codeconductor 1.1.0 → 1.3.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 (355) hide show
  1. package/README.md +34 -12
  2. package/dist/core/config/codeconductor-config.d.ts +2 -1
  3. package/dist/core/presets/package-paths.d.ts +1 -0
  4. package/dist/core/runner/runner-target.d.ts +32 -0
  5. package/dist/core/verification/verification-runner.d.ts +7 -0
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +2934 -761
  8. package/dist/library.js +103 -14
  9. package/dist/validation/schemas.d.ts +294 -61
  10. package/package.json +4 -1
  11. package/presets/agy/AGENTS.md +11 -10
  12. package/presets/agy/hooks.json +3 -3
  13. package/presets/agy/scripts/invoke-hook.cjs +119 -0
  14. package/presets/agy/skills/backlog/SKILL.md +40 -70
  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 +49 -19
  19. package/presets/agy/skills/testing-tdd/SKILL.md +53 -0
  20. package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
  21. package/presets/agy/workflows/cc-api-contract.md +18 -0
  22. package/presets/agy/workflows/cc-ask.md +10 -10
  23. package/presets/agy/workflows/cc-council.md +4 -0
  24. package/presets/agy/workflows/cc-db-migration.md +18 -0
  25. package/presets/agy/workflows/cc-explore.md +2 -2
  26. package/presets/agy/workflows/cc-feature.md +22 -0
  27. package/presets/agy/workflows/cc-fix.md +18 -0
  28. package/presets/agy/workflows/cc-handoff.md +1 -1
  29. package/presets/agy/workflows/cc-iterative.md +14 -0
  30. package/presets/agy/workflows/cc-openspec.md +14 -0
  31. package/presets/agy/workflows/cc-prototype.md +1 -1
  32. package/presets/agy/workflows/cc-refactor.md +5 -1
  33. package/presets/agy/workflows/cc-review.md +5 -1
  34. package/presets/agy/workflows/cc-scorecard.md +2 -0
  35. package/presets/agy/workflows/cc-security.md +4 -0
  36. package/presets/agy/workflows/cc-spec-mutation.md +195 -0
  37. package/presets/agy/workflows/cc-tdd-cycle.md +15 -1
  38. package/presets/agy/workflows/cc-test-plan.md +5 -1
  39. package/presets/claude/commands/cc/api-contract.md +19 -1
  40. package/presets/claude/commands/cc/ask.md +1 -1
  41. package/presets/claude/commands/cc/backlog.md +1 -1
  42. package/presets/claude/commands/cc/clarify.md +1 -1
  43. package/presets/claude/commands/cc/council.md +4 -0
  44. package/presets/claude/commands/cc/db-migration.md +19 -1
  45. package/presets/claude/commands/cc/explore.md +1 -1
  46. package/presets/claude/commands/cc/feature.md +23 -1
  47. package/presets/claude/commands/cc/fix.md +22 -1
  48. package/presets/claude/commands/cc/handoff.md +1 -1
  49. package/presets/claude/commands/cc/iterative.md +15 -1
  50. package/presets/claude/commands/cc/openspec.md +15 -1
  51. package/presets/claude/commands/cc/prototype.md +1 -1
  52. package/presets/claude/commands/cc/refactor.md +5 -1
  53. package/presets/claude/commands/cc/review.md +8 -1
  54. package/presets/claude/commands/cc/scorecard.md +3 -1
  55. package/presets/claude/commands/cc/security.md +5 -1
  56. package/presets/claude/commands/cc/spec-mutation.md +194 -0
  57. package/presets/claude/commands/cc/tdd-cycle.md +18 -1
  58. package/presets/claude/commands/cc/test-plan.md +5 -1
  59. package/presets/claude/commands/cc/triage.md +1 -1
  60. package/presets/claude/settings.json +13 -11
  61. package/presets/claude/skills/android/SKILL.md +0 -1
  62. package/presets/claude/skills/api-versioning/SKILL.md +0 -1
  63. package/presets/claude/skills/backlog/SKILL.md +40 -70
  64. package/presets/claude/skills/django-orm/SKILL.md +0 -1
  65. package/presets/claude/skills/django-testing/SKILL.md +0 -1
  66. package/presets/claude/skills/evaluation/SKILL.md +47 -24
  67. package/presets/claude/skills/jpa-postgres/SKILL.md +0 -1
  68. package/presets/claude/skills/openspec/SKILL.md +46 -38
  69. package/presets/claude/skills/pagespeed-perf/SKILL.md +1 -2
  70. package/presets/claude/skills/python/SKILL.md +0 -1
  71. package/presets/claude/skills/python-django-stack/SKILL.md +0 -1
  72. package/presets/claude/skills/python-fastapi-stack/SKILL.md +0 -1
  73. package/presets/claude/skills/security/SKILL.md +0 -1
  74. package/presets/claude/skills/spring-boot-feature/SKILL.md +0 -1
  75. package/presets/claude/skills/spring-boot-kotlin/SKILL.md +0 -1
  76. package/presets/claude/skills/sqlalchemy/SKILL.md +0 -1
  77. package/presets/claude/skills/testing-strategy/SKILL.md +0 -1
  78. package/presets/claude/skills/testing-tdd/SKILL.md +53 -0
  79. package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
  80. package/presets/codex/AGENTS.md +19 -14
  81. package/presets/codex/commands/cc-ask.md +10 -10
  82. package/presets/codex/skills/android/SKILL.md +0 -1
  83. package/presets/codex/skills/api-versioning/SKILL.md +0 -1
  84. package/presets/codex/skills/backlog/SKILL.md +61 -0
  85. package/presets/codex/skills/cc-api-contract/SKILL.md +91 -0
  86. package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
  87. package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
  88. package/presets/codex/skills/cc-council/SKILL.md +96 -0
  89. package/presets/codex/skills/cc-db-migration/SKILL.md +92 -0
  90. package/presets/codex/skills/cc-explore/SKILL.md +40 -0
  91. package/presets/codex/skills/cc-feature/SKILL.md +162 -0
  92. package/presets/codex/skills/cc-fix/SKILL.md +172 -0
  93. package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
  94. package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
  95. package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
  96. package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
  97. package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
  98. package/presets/codex/skills/cc-refactor/SKILL.md +167 -0
  99. package/presets/codex/skills/cc-review/SKILL.md +156 -0
  100. package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
  101. package/presets/codex/skills/cc-security/SKILL.md +186 -0
  102. package/presets/codex/skills/cc-spec-mutation/SKILL.md +196 -0
  103. package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
  104. package/presets/codex/skills/cc-test-plan/SKILL.md +157 -0
  105. package/presets/codex/skills/cc-triage/SKILL.md +38 -0
  106. package/presets/codex/skills/django-orm/SKILL.md +0 -1
  107. package/presets/codex/skills/django-testing/SKILL.md +0 -1
  108. package/presets/codex/skills/evaluation/SKILL.md +65 -0
  109. package/presets/codex/skills/jpa-postgres/SKILL.md +0 -1
  110. package/presets/codex/skills/openspec/SKILL.md +66 -0
  111. package/presets/codex/skills/pagespeed-perf/SKILL.md +1 -2
  112. package/presets/codex/skills/python/SKILL.md +0 -1
  113. package/presets/codex/skills/python-django-stack/SKILL.md +0 -1
  114. package/presets/codex/skills/python-fastapi-stack/SKILL.md +0 -1
  115. package/presets/codex/skills/spring-boot-feature/SKILL.md +0 -1
  116. package/presets/codex/skills/spring-boot-kotlin/SKILL.md +0 -1
  117. package/presets/codex/skills/sqlalchemy/SKILL.md +0 -1
  118. package/presets/codex/skills/testing-strategy/SKILL.md +0 -1
  119. package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
  120. package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
  121. package/presets/cursor/agents/architect.md +1 -1
  122. package/presets/cursor/agents/complexity-auditor.md +1 -1
  123. package/presets/cursor/agents/contract-builder.md +1 -1
  124. package/presets/cursor/agents/docs.md +1 -1
  125. package/presets/cursor/agents/goal-planner.md +1 -1
  126. package/presets/cursor/agents/implementer.md +2 -2
  127. package/presets/cursor/agents/orchestrator.md +3 -3
  128. package/presets/cursor/agents/reviewer.md +4 -4
  129. package/presets/cursor/agents/security-reviewer.md +1 -1
  130. package/presets/cursor/agents/task-coach.md +1 -1
  131. package/presets/cursor/agents/tester.md +1 -1
  132. package/presets/cursor/commands/cc/api-contract.md +19 -1
  133. package/presets/cursor/commands/cc/ask.md +1 -1
  134. package/presets/cursor/commands/cc/backlog.md +1 -1
  135. package/presets/cursor/commands/cc/clarify.md +1 -1
  136. package/presets/cursor/commands/cc/council.md +4 -0
  137. package/presets/cursor/commands/cc/db-migration.md +19 -1
  138. package/presets/cursor/commands/cc/explore.md +1 -1
  139. package/presets/cursor/commands/cc/feature.md +23 -1
  140. package/presets/cursor/commands/cc/fix.md +22 -1
  141. package/presets/cursor/commands/cc/handoff.md +1 -1
  142. package/presets/cursor/commands/cc/iterative.md +15 -1
  143. package/presets/cursor/commands/cc/openspec.md +15 -1
  144. package/presets/cursor/commands/cc/prototype.md +1 -1
  145. package/presets/cursor/commands/cc/refactor.md +5 -1
  146. package/presets/cursor/commands/cc/review.md +5 -1
  147. package/presets/cursor/commands/cc/scorecard.md +3 -1
  148. package/presets/cursor/commands/cc/security.md +5 -1
  149. package/presets/cursor/commands/cc/spec-mutation.md +194 -0
  150. package/presets/cursor/commands/cc/tdd-cycle.md +15 -1
  151. package/presets/cursor/commands/cc/test-plan.md +5 -1
  152. package/presets/cursor/commands/cc/triage.md +1 -1
  153. package/presets/cursor/skills/android/SKILL.md +0 -1
  154. package/presets/cursor/skills/api-versioning/SKILL.md +0 -1
  155. package/presets/cursor/skills/astro/SKILL.md +0 -1
  156. package/presets/cursor/skills/auth-token-inspector/SKILL.md +0 -1
  157. package/presets/cursor/skills/backlog/SKILL.md +40 -70
  158. package/presets/cursor/skills/code-review/SKILL.md +0 -1
  159. package/presets/cursor/skills/django-orm/SKILL.md +0 -1
  160. package/presets/cursor/skills/django-testing/SKILL.md +0 -1
  161. package/presets/cursor/skills/django-uv/SKILL.md +0 -1
  162. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +0 -1
  163. package/presets/cursor/skills/evaluation/SKILL.md +61 -4
  164. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +0 -1
  165. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +0 -1
  166. package/presets/cursor/skills/jpa-postgres/SKILL.md +0 -1
  167. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +0 -1
  168. package/presets/cursor/skills/nextjs-typescript/SKILL.md +0 -1
  169. package/presets/cursor/skills/openspec/SKILL.md +46 -36
  170. package/presets/cursor/skills/pagespeed-perf/SKILL.md +1 -2
  171. package/presets/cursor/skills/python/SKILL.md +0 -1
  172. package/presets/cursor/skills/python-django-stack/SKILL.md +0 -1
  173. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +0 -1
  174. package/presets/cursor/skills/security/SKILL.md +0 -1
  175. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +0 -1
  176. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +0 -1
  177. package/presets/cursor/skills/spring-boot-feature/SKILL.md +0 -1
  178. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +0 -1
  179. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +0 -1
  180. package/presets/cursor/skills/sqlalchemy/SKILL.md +0 -1
  181. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +0 -1
  182. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +0 -1
  183. package/presets/cursor/skills/testing-tdd/SKILL.md +35 -574
  184. package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
  185. package/presets/gemini/GEMINI.md +38 -0
  186. package/presets/gemini/commands/cc/api-contract.toml +86 -0
  187. package/presets/gemini/commands/cc/ask.toml +54 -0
  188. package/presets/gemini/commands/cc/backlog.toml +103 -0
  189. package/presets/gemini/commands/cc/clarify.toml +31 -0
  190. package/presets/gemini/commands/cc/council.toml +91 -0
  191. package/presets/gemini/commands/cc/db-migration.toml +87 -0
  192. package/presets/gemini/commands/cc/explore.toml +35 -0
  193. package/presets/gemini/commands/cc/feature.toml +157 -0
  194. package/presets/gemini/commands/cc/fix.toml +167 -0
  195. package/presets/gemini/commands/cc/handoff.toml +40 -0
  196. package/presets/gemini/commands/cc/iterative.toml +145 -0
  197. package/presets/gemini/commands/cc/openspec.toml +186 -0
  198. package/presets/gemini/commands/cc/pagespeed.toml +119 -0
  199. package/presets/gemini/commands/cc/prototype.toml +37 -0
  200. package/presets/gemini/commands/cc/refactor.toml +162 -0
  201. package/presets/gemini/commands/cc/review.toml +151 -0
  202. package/presets/gemini/commands/cc/scorecard.toml +77 -0
  203. package/presets/gemini/commands/cc/security.toml +181 -0
  204. package/presets/gemini/commands/cc/spec-mutation.toml +191 -0
  205. package/presets/gemini/commands/cc/tdd-cycle.toml +261 -0
  206. package/presets/gemini/commands/cc/test-plan.toml +152 -0
  207. package/presets/gemini/commands/cc/triage.toml +33 -0
  208. package/presets/gemini/settings.json +3 -0
  209. package/presets/opencode/README.md +24 -21
  210. package/presets/opencode/agents/architect.md +6 -0
  211. package/presets/opencode/agents/docs.md +1 -1
  212. package/presets/opencode/agents/implementer.md +7 -0
  213. package/presets/opencode/agents/reviewer.md +7 -1
  214. package/presets/opencode/agents/tester.md +6 -0
  215. package/presets/opencode/commands/cc-api-contract.md +18 -0
  216. package/presets/opencode/commands/cc-ask.md +10 -10
  217. package/presets/opencode/commands/cc-council.md +4 -0
  218. package/presets/opencode/commands/cc-db-migration.md +18 -0
  219. package/presets/opencode/commands/cc-explore.md +2 -2
  220. package/presets/opencode/commands/cc-feature.md +22 -0
  221. package/presets/opencode/commands/cc-fix.md +21 -0
  222. package/presets/opencode/commands/cc-handoff.md +1 -1
  223. package/presets/opencode/commands/cc-iterative.md +14 -0
  224. package/presets/opencode/commands/cc-openspec.md +14 -0
  225. package/presets/opencode/commands/cc-prototype.md +1 -1
  226. package/presets/opencode/commands/cc-refactor.md +5 -1
  227. package/presets/opencode/commands/cc-review.md +5 -1
  228. package/presets/opencode/commands/cc-scorecard.md +2 -0
  229. package/presets/opencode/commands/cc-security.md +4 -0
  230. package/presets/opencode/commands/cc-spec-mutation.md +194 -0
  231. package/presets/opencode/commands/cc-tdd-cycle.md +15 -1
  232. package/presets/opencode/commands/cc-test-plan.md +5 -1
  233. package/presets/opencode/opencode.jsonc +1 -1
  234. package/presets/opencode/prompts/v1.0.0/README.md +1 -1
  235. package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
  236. package/presets/opencode/prompts/v1.0.0/docs.md +1 -1
  237. package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
  238. package/presets/opencode/prompts/v1.0.0/reviewer.md +7 -1
  239. package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
  240. package/presets/opencode/skills/android/SKILL.md +0 -1
  241. package/presets/opencode/skills/api-versioning/SKILL.md +0 -1
  242. package/presets/opencode/skills/astro/SKILL.md +0 -1
  243. package/presets/opencode/skills/auth-token-inspector/SKILL.md +0 -1
  244. package/presets/opencode/skills/backlog/SKILL.md +40 -70
  245. package/presets/opencode/skills/code-review/SKILL.md +0 -1
  246. package/presets/opencode/skills/django-orm/SKILL.md +0 -1
  247. package/presets/opencode/skills/django-testing/SKILL.md +0 -1
  248. package/presets/opencode/skills/django-uv/SKILL.md +0 -1
  249. package/presets/opencode/skills/drizzle-schema-architect/SKILL.md +0 -1
  250. package/presets/opencode/skills/evaluation/SKILL.md +61 -2
  251. package/presets/opencode/skills/fastapi-pydantic-strict/SKILL.md +0 -1
  252. package/presets/opencode/skills/jpa-nplusone-detector/SKILL.md +0 -1
  253. package/presets/opencode/skills/jpa-postgres/SKILL.md +0 -1
  254. package/presets/opencode/skills/livewire-alpine-bridge/SKILL.md +0 -1
  255. package/presets/opencode/skills/nextjs-typescript/SKILL.md +0 -1
  256. package/presets/opencode/skills/openspec/SKILL.md +46 -34
  257. package/presets/opencode/skills/pagespeed-perf/SKILL.md +1 -2
  258. package/presets/opencode/skills/python/SKILL.md +0 -1
  259. package/presets/opencode/skills/python-django-stack/SKILL.md +0 -1
  260. package/presets/opencode/skills/python-fastapi-stack/SKILL.md +0 -1
  261. package/presets/opencode/skills/security/SKILL.md +0 -1
  262. package/presets/opencode/skills/seo-analytics-injector/SKILL.md +0 -1
  263. package/presets/opencode/skills/spring-auth-auditor/SKILL.md +0 -1
  264. package/presets/opencode/skills/spring-boot-feature/SKILL.md +0 -1
  265. package/presets/opencode/skills/spring-boot-kotlin/SKILL.md +0 -1
  266. package/presets/opencode/skills/spring-boot-testing-strategy/SKILL.md +0 -1
  267. package/presets/opencode/skills/sqlalchemy/SKILL.md +0 -1
  268. package/presets/opencode/skills/tailwind-responsive-auditor/SKILL.md +0 -1
  269. package/presets/opencode/skills/tdd-mutation-tester/SKILL.md +0 -1
  270. package/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
  271. package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
  272. package/presets/pi/AGENTS.md +43 -0
  273. package/presets/pi/settings.json +3 -0
  274. package/presets/seo-hotel/skills/astro-seo/SKILL.md +0 -1
  275. package/presets/seo-hotel/skills/geo-readiness/SKILL.md +0 -1
  276. package/presets/seo-hotel/skills/off-page/SKILL.md +0 -1
  277. package/presets/seo-hotel/skills/schema-validator/SKILL.md +0 -1
  278. package/presets/seo-hotel/skills/seo-audit/SKILL.md +0 -1
  279. package/presets/shared/invoke-hook.cjs +119 -0
  280. package/presets/shared/mutation_runner.py +273 -0
  281. package/src/presets/council/council.yml +12 -9
  282. package/src/presets/manifests/agy.yml +3 -1
  283. package/src/presets/manifests/claude.yml +3 -0
  284. package/src/presets/manifests/gemini.yml +15 -0
  285. package/src/presets/manifests/pi.yml +25 -0
  286. package/src/presets/models/agy.yml +2 -128
  287. package/src/presets/models/claude.yml +2 -144
  288. package/src/presets/models/codex.yml +2 -144
  289. package/src/presets/models/cursor.yml +2 -144
  290. package/src/presets/models/gemini.yml +2 -144
  291. package/src/presets/models/opencode.yml +3 -101
  292. package/src/presets/models/pi.yml +5 -0
  293. package/src/presets/models/roles.yml +193 -0
  294. package/src/presets/shared-skills.yml +64 -0
  295. package/src/presets/targets/agy.yml +11 -0
  296. package/src/presets/targets/claude.yml +12 -0
  297. package/src/presets/targets/codex.yml +14 -0
  298. package/src/presets/targets/cursor.yml +11 -0
  299. package/src/presets/targets/gemini.yml +15 -0
  300. package/src/presets/targets/opencode.yml +13 -0
  301. package/src/presets/targets/pi.yml +12 -0
  302. package/presets/agy/scripts/post-tool.sh +0 -25
  303. package/presets/agy/scripts/pre-tool.sh +0 -56
  304. package/presets/opencode/prompts/v0.1.0/DEPRECATED.md +0 -11
  305. package/presets/opencode/prompts/v0.1.0/architect.md +0 -213
  306. package/presets/opencode/prompts/v0.1.0/docs.md +0 -181
  307. package/presets/opencode/prompts/v0.1.0/implementer.md +0 -154
  308. package/presets/opencode/prompts/v0.1.0/orchestrator.md +0 -169
  309. package/presets/opencode/prompts/v0.1.0/repo-explorer.md +0 -102
  310. package/presets/opencode/prompts/v0.1.0/reviewer.md +0 -183
  311. package/presets/opencode/prompts/v0.1.0/task-coach.md +0 -142
  312. package/presets/opencode/prompts/v0.1.0/tester.md +0 -160
  313. package/presets/opencode/prompts/v0.2.0/DEPRECATED.md +0 -11
  314. package/presets/opencode/prompts/v0.2.0/architect.md +0 -219
  315. package/presets/opencode/prompts/v0.2.0/docs.md +0 -187
  316. package/presets/opencode/prompts/v0.2.0/implementer.md +0 -160
  317. package/presets/opencode/prompts/v0.2.0/orchestrator.md +0 -238
  318. package/presets/opencode/prompts/v0.2.0/repo-explorer.md +0 -108
  319. package/presets/opencode/prompts/v0.2.0/reviewer.md +0 -190
  320. package/presets/opencode/prompts/v0.2.0/task-coach.md +0 -153
  321. package/presets/opencode/prompts/v0.2.0/tester.md +0 -249
  322. package/presets/opencode/prompts/v0.3.0/DEPRECATED.md +0 -11
  323. package/presets/opencode/prompts/v0.3.0/architect.md +0 -221
  324. package/presets/opencode/prompts/v0.3.0/docs.md +0 -189
  325. package/presets/opencode/prompts/v0.3.0/implementer.md +0 -162
  326. package/presets/opencode/prompts/v0.3.0/orchestrator.md +0 -360
  327. package/presets/opencode/prompts/v0.3.0/repo-explorer.md +0 -110
  328. package/presets/opencode/prompts/v0.3.0/reviewer.md +0 -225
  329. package/presets/opencode/prompts/v0.3.0/task-coach.md +0 -155
  330. package/presets/opencode/prompts/v0.3.0/tester.md +0 -251
  331. package/presets/opencode/prompts/v0.4.0/DEPRECATED.md +0 -11
  332. package/presets/opencode/prompts/v0.4.0/architect.md +0 -221
  333. package/presets/opencode/prompts/v0.4.0/complexity-auditor.md +0 -89
  334. package/presets/opencode/prompts/v0.4.0/docs.md +0 -189
  335. package/presets/opencode/prompts/v0.4.0/implementer.md +0 -162
  336. package/presets/opencode/prompts/v0.4.0/orchestrator.md +0 -348
  337. package/presets/opencode/prompts/v0.4.0/repo-explorer.md +0 -110
  338. package/presets/opencode/prompts/v0.4.0/reviewer.md +0 -225
  339. package/presets/opencode/prompts/v0.4.0/task-coach.md +0 -155
  340. package/presets/opencode/prompts/v0.4.0/tester.md +0 -251
  341. package/presets/opencode/prompts/v0.5.0/architect.md +0 -222
  342. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +0 -91
  343. package/presets/opencode/prompts/v0.5.0/contract-builder.md +0 -84
  344. package/presets/opencode/prompts/v0.5.0/docs.md +0 -190
  345. package/presets/opencode/prompts/v0.5.0/goal-planner.md +0 -80
  346. package/presets/opencode/prompts/v0.5.0/implementer.md +0 -171
  347. package/presets/opencode/prompts/v0.5.0/orchestrator.md +0 -388
  348. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +0 -111
  349. package/presets/opencode/prompts/v0.5.0/reviewer.md +0 -248
  350. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +0 -123
  351. package/presets/opencode/prompts/v0.5.0/task-coach.md +0 -156
  352. package/presets/opencode/prompts/v0.5.0/tester.md +0 -252
  353. package/presets/opencode/prompts/v0.6.0/implementer.md +0 -35
  354. package/presets/opencode/prompts/v0.6.0/planner.md +0 -36
  355. package/presets/opencode/prompts/v0.6.0/reviewer.md +0 -40
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: cc-review
3
+ description: Run a structured code review — produces a Review Report with CRITICAL, WARNING, and SUGGESTION findings; CRITICAL findings block merge.
4
+ ---
5
+
6
+ # review
7
+
8
+ Invoke as `$cc-review`. The user request follows the skill mention.
9
+
10
+ # Code Review Workflow
11
+
12
+ Review target: $ARGUMENTS
13
+
14
+ Specify what to review. Accepted formats:
15
+
16
+ - A branch name: `feature/my-branch`
17
+ - A file or set of files: `src/api/UserController.kt`
18
+ - A pull request reference: `PR #42`
19
+ - Empty — defaults to the current working diff (`git diff`)
20
+
21
+ ---
22
+
23
+ ## Step 0 — CCEP Bootstrap
24
+
25
+ Command: `review` (fixed for this workflow — do not infer from user text)
26
+
27
+ 1. Run: `npx cc-codeconductor ccep parse --command review "$ARGUMENTS" --output json`
28
+ 2. Run: `npx cc-codeconductor ccep resolve --command review "$ARGUMENTS" --output json`
29
+ 3. Run: `npx cc-codeconductor ccep profile review --output json`
30
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command review --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
31
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
32
+
33
+ ---
34
+
35
+ ## Step 1 — Diff collection
36
+
37
+ Before adopting the Reviewer role, collect the diff for the specified target.
38
+
39
+ If $ARGUMENTS is empty or not provided:
40
+
41
+ - Use `git diff HEAD` as the review target.
42
+
43
+ If $ARGUMENTS is a branch name:
44
+
45
+ - Use `git diff main...$ARGUMENTS` (or `develop` if main is not the base).
46
+
47
+ If $ARGUMENTS is a PR reference:
48
+
49
+ - Retrieve the PR diff and the PR description for context.
50
+
51
+ If $ARGUMENTS is a file path:
52
+
53
+ - Use `git diff HEAD -- $ARGUMENTS`.
54
+
55
+ Show the diff summary (files changed, lines added/removed) before proceeding.
56
+
57
+ ---
58
+
59
+ ## Step 2 — Code review (Reviewer role)
60
+
61
+ Adopt the `reviewer` role as defined in `AGENTS.md`.
62
+
63
+ Evaluate the diff against the following checklist:
64
+
65
+ **Correctness**
66
+
67
+ - Does the implementation match the stated intent?
68
+ - Are there logic errors, off-by-one errors, or unhandled edge cases?
69
+
70
+ **Architecture alignment**
71
+
72
+ - Does the change follow existing module boundaries?
73
+ - Does it introduce unplanned coupling or layering violations?
74
+
75
+ **Security**
76
+
77
+ - Are inputs validated before use?
78
+ - Is there any credential, token, or secret in the diff?
79
+ - Are there SQL injection, XSS, or injection risks?
80
+
81
+ **Performance**
82
+
83
+ - Does the change introduce N+1 queries, blocking I/O, or O(n²) loops?
84
+
85
+ **Test coverage**
86
+
87
+ - Do tests exist for the new or changed behavior?
88
+ - Are assertions meaningful (not just checking that no exception is thrown)?
89
+
90
+ **Documentation**
91
+
92
+ - Are public interfaces documented?
93
+ - Is CHANGELOG updated if behavior changed?
94
+
95
+ ---
96
+
97
+ ## Step 3 — Review Report
98
+
99
+ Produce a structured Review Report with findings in three categories:
100
+
101
+ ```markdown
102
+ ## Review Report
103
+
104
+ ### CRITICAL
105
+ [Findings that must be fixed before merge — file:line, description, suggested resolution]
106
+
107
+ ### WARNING
108
+ [Findings that should be resolved before merge — same format as CRITICAL]
109
+
110
+ ### SUGGESTION
111
+ [Optional improvements — style, readability, future-proofing. These do not block merge.]
112
+
113
+ ### Summary
114
+ - Files reviewed: N
115
+ - Total findings: N (X critical, Y warnings, Z suggestions)
116
+ - Merge recommendation: APPROVED | BLOCKED
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Step 4 — Merge decision
122
+
123
+ If any CRITICAL findings exist:
124
+
125
+ - The Review Report status is **BLOCKED**.
126
+ - Report all CRITICAL findings.
127
+ - Do not proceed until each CRITICAL finding is resolved.
128
+ - After resolution, run `/review` again on the same target.
129
+
130
+ If no CRITICAL findings exist:
131
+
132
+ - The Review Report status is **APPROVED**.
133
+ - Report any WARNINGs and SUGGESTIONs for human awareness.
134
+ - The human makes the final merge decision.
135
+
136
+ ---
137
+
138
+ ## Completion
139
+
140
+ Deliver the complete Review Report. Never summarize or omit findings.
141
+
142
+ ---
143
+
144
+ ## Step 5 — Scorecard and outcome
145
+
146
+ ```bash
147
+ npx cc-codeconductor scorecard create --from-diff --agent reviewer
148
+ npx cc-codeconductor scorecard record --verdict PASS|REVISE|REJECT --score <weighted>
149
+ npx cc-codeconductor scorecard regression
150
+ ```
151
+
152
+ Map merge recommendation to scorecard verdict. Record outcome for trend tracking.
153
+
154
+ ## Next
155
+
156
+ Approved: merge. Blocked: return the findings to `$cc-fix` or `$cc-feature`.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: cc-scorecard
3
+ description: Evaluate deliverable quality — scorecard, outcome tracking, regression checklist, and aggregate stats.
4
+ ---
5
+
6
+ # scorecard
7
+
8
+ Invoke as `$cc-scorecard`. The user request follows the skill mention.
9
+
10
+ # Scorecard Evaluation Workflow
11
+
12
+ Scope: $ARGUMENTS
13
+
14
+ ---
15
+
16
+ ## Step 0 — CCEP Bootstrap
17
+
18
+ Command: `scorecard` (fixed for this workflow — do not infer from user text)
19
+
20
+ 1. Run: `npx cc-codeconductor ccep parse --command scorecard "$ARGUMENTS" --output json`
21
+ 2. Run: `npx cc-codeconductor ccep resolve --command scorecard "$ARGUMENTS" --output json`
22
+ 3. Run: `npx cc-codeconductor ccep profile scorecard --output json`
23
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command scorecard --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 — Identify task
29
+
30
+ Use `$ARGUMENTS` as task id (e.g. `BC-001`) or read active item from `npx cc-codeconductor openspec status`.
31
+
32
+ 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`.
33
+
34
+ ---
35
+
36
+ ## Step 2 — Create scorecard with auto-signals
37
+
38
+ ```bash
39
+ npx cc-codeconductor scorecard create --task <id> --agent reviewer --from-diff
40
+ ```
41
+
42
+ Review auto-suggested criteria (minimal diff, cc-gain). Complete remaining scores 0–3 per [`docs/agent-scorecard.md`](docs/agent-scorecard.md).
43
+
44
+ ---
45
+
46
+ ## Step 3 — Regression (optional)
47
+
48
+ ```bash
49
+ npx cc-codeconductor scorecard regression
50
+ ```
51
+
52
+ If required checks fail, **STOP** and report failures.
53
+
54
+ ---
55
+
56
+ ## Step 4 — Record outcome
57
+
58
+ ```bash
59
+ npx cc-codeconductor scorecard record --task <id> --agent reviewer --model <model> --verdict PASS --score 2.5
60
+ ```
61
+
62
+ Include `--cost` and `--tokens` when available from session metrics.
63
+
64
+ ---
65
+
66
+ ## Step 5 — Aggregate
67
+
68
+ ```bash
69
+ npx cc-codeconductor scorecard aggregate
70
+ ```
71
+
72
+ Report pass rate and average weighted score.
73
+
74
+ ---
75
+
76
+ ## Routing on verdict
77
+
78
+ - **PASS** — accept deliverable; update backlog if applicable
79
+ - **REVISE** — return to implementer/tester with findings
80
+ - **REJECT** — route to task-coach for re-scoping
81
+
82
+ Apply skill `evaluation`.
@@ -0,0 +1,186 @@
1
+ ---
2
+ name: cc-security
3
+ description: Run the authorized defensive security workflow — domain security-* skills, authorization gate, risk-based routing, hardening, and review.
4
+ ---
5
+
6
+ # security
7
+
8
+ Invoke as `$cc-security`. The user request follows the skill mention.
9
+
10
+ # Defensive Security Workflow
11
+
12
+ Security objective: $ARGUMENTS
13
+
14
+ Provide the following information in $ARGUMENTS:
15
+
16
+ - What must be reviewed or hardened, and why
17
+ - Domain: a `security-*` skill id (recon, vuln-assessment, web, cloud, IR,
18
+ hunting, GRC, …) or `web-app` / `api` / `cloud-config` /
19
+ `dependency-supply-chain` / `secrets`
20
+ - Authorization: who authorized this work on this target, and the scope boundary
21
+ - Risk classification (`low`, `medium`, or `high`), if known
22
+ - Scope: which files, modules, repos, or environments are in and out of bounds
23
+
24
+ ---
25
+
26
+ ## Scope and authorization
27
+
28
+ This workflow performs **authorized defensive security work only**: threat
29
+ modeling, hardening, secure configuration, dependency and supply-chain review,
30
+ secret hygiene, and detection coverage.
31
+
32
+ Refuse outright and offer the defensive equivalent instead (threat model,
33
+ hardening, detection coverage, dependency audit):
34
+
35
+ - Exploit or proof-of-concept development
36
+ - Malware authoring, or malware analysis intended for reuse
37
+ - Reverse engineering aimed at bypassing a control
38
+ - Red-team playbooks
39
+ - Any unauthorized-access procedure
40
+
41
+ Scope is limited to the repository under analysis. Do not scan, probe, or
42
+ perform reconnaissance against third-party hosts.
43
+
44
+ Do not proceed without an authorization statement. Do not produce exploit
45
+ payloads, malware, or attack procedures.
46
+
47
+ ---
48
+
49
+ ## Step 0 — CCEP Bootstrap
50
+
51
+ Command: `security` (fixed for this workflow — do not infer from user text)
52
+
53
+ 1. Run: `npx cc-codeconductor ccep parse --command security "$ARGUMENTS" --output json`
54
+ 2. Run: `npx cc-codeconductor ccep resolve --command security "$ARGUMENTS" --output json`
55
+ 3. Run: `npx cc-codeconductor ccep profile security --output json`
56
+ 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.
57
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
58
+ Canonical delivery order is test-before-implement whenever both phases apply.
59
+
60
+ ---
61
+
62
+ ## Step 1 — Wayfinding (repo-explorer)
63
+
64
+ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
65
+ `graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`
66
+ to map modules, conventions, and impact radius. Do not write code in this step.
67
+ Record a Repo Map artifact before intake. Load the matching `security-*` skill
68
+ for the named domain (see `.claude/skills/security-*/SKILL.md`). Keep the OWASP
69
+ `security` skill for application-security reviews.
70
+
71
+ ---
72
+
73
+ ## Step 2 — Task Card validation (task-coach)
74
+
75
+ Invoke `task-coach` with the security objective above.
76
+
77
+ task-coach must produce a Task Card that includes:
78
+
79
+ - Objective: what must be reviewed or hardened, in one sentence
80
+ - Domain: which `security-*` skill applies, or `web-app` / `api` /
81
+ `cloud-config` / `dependency-supply-chain` / `secrets`
82
+ - Authorization: who authorized this work on this target, and the scope boundary
83
+ - Risk classification: `low`, `medium`, or `high`
84
+ - Scope: which files or modules are likely affected
85
+
86
+ If authorization is absent, unclear, or names a system the requester does not
87
+ own or operate, **STOP and refuse. Do not route the task.**
88
+
89
+ Redact secrets, tokens, and credentials from any evidence before it enters the
90
+ Task Card. Summarize logs; do not paste env files.
91
+
92
+ **STOP here. Show the Task Card and wait for human confirmation.**
93
+
94
+ ---
95
+
96
+ ## Step 3 — Route by risk
97
+
98
+ Read the risk field from the Task Card and follow the corresponding route.
99
+
100
+ ### Low-risk route
101
+
102
+ Applies when: the weakness is isolated, not exploitable in the current
103
+ configuration, and no authentication, secret, or dependency boundary is
104
+ involved.
105
+
106
+ Route: `task-coach` → `tester` → `implementer`
107
+
108
+ Proceed directly to Step 4 (tests), then Step 5a.
109
+
110
+ ### Medium or high-risk route
111
+
112
+ Applies when: the work touches authentication, authorization, secrets,
113
+ cryptography, trust-boundary input validation, or a dependency upgrade.
114
+
115
+ Route: `task-coach` → `architect` → `tester` → `implementer` → `reviewer`
116
+
117
+ Invoke `architect` before implementation. architect must:
118
+
119
+ - Identify the weakness and the affected trust boundary
120
+ - Define the hardening approach and affected files
121
+ - Flag any regression risk to adjacent components
122
+ - Produce a Technical Plan
123
+
124
+ On **high** risk, also invoke `security-reviewer` before Reviewer.
125
+
126
+ **STOP here if high-risk. Show the Technical Plan and wait for human approval
127
+ before continuing.**
128
+
129
+ ---
130
+
131
+ ## Step 4 — Tests (tester)
132
+
133
+ Invoke `tester` for all risk levels.
134
+
135
+ tester must:
136
+
137
+ 1. Write a regression test that proves the weakness exists and confirm it fails
138
+ before any change (RED)
139
+ 2. Verify that existing tests still pass
140
+ 3. Produce a Coverage Summary: test added, case covered
141
+
142
+ ---
143
+
144
+ ## Step 5a — Implementation, low-risk (implementer)
145
+
146
+ Invoke `implementer` with the Task Card.
147
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
148
+
149
+ implementer must:
150
+
151
+ 1. Apply the minimal hardening change — no unrelated changes
152
+ 2. Run the suite and make the RED regression test pass
153
+ 3. Produce an Implementation Summary: weakness, change applied, files changed
154
+
155
+ ---
156
+
157
+ ## Step 5b — Implementation, medium/high-risk (implementer)
158
+
159
+ Invoke `implementer` with the approved Technical Plan and the Task Card.
160
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
161
+
162
+ implementer must follow the plan exactly. Any deviation requires a new Technical
163
+ Plan approval. After implementation, run the full test suite. No exploit code.
164
+
165
+ ---
166
+
167
+ ## Step 6 — Review (Reviewer role) — medium/high-risk only
168
+
169
+ Invoke `reviewer` with the diff and Task Card. The Reviewer must apply the OWASP
170
+ rules in the `security` skill.
171
+
172
+ reviewer produces a Review Report with CRITICAL / WARNING / SUGGESTION findings.
173
+ If any CRITICAL findings exist, **STOP**. Do not close the task until they are
174
+ resolved.
175
+
176
+ ---
177
+
178
+ ## Completion
179
+
180
+ Report: Task Card, Implementation Summary, regression test added, Review Report
181
+ (if applicable). The task is complete only when: the regression test passes, the
182
+ full suite passes, and no CRITICAL review findings remain.
183
+
184
+ ## Next
185
+
186
+ Run `$cc-review` on the diff before merging.
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: cc-spec-mutation
3
+ description: Spec-locked TDD with a mutation-testing gate — refine the intent into an immutable Gherkin contract (SHA-256 frozen), implement under the three laws of TDD, pass a judge audit, and merge only if every mutant dies.
4
+ ---
5
+
6
+ # spec-mutation
7
+
8
+ Invoke as `$cc-spec-mutation`. The user request follows the skill mention.
9
+
10
+ # Spec-Mutation — Hard Spec → TDD → Judge → Mutation Gate
11
+
12
+ Scope: $ARGUMENTS
13
+
14
+ Describe what behavior you want to implement. Include:
15
+
16
+ - The function, method, or feature to implement
17
+ - The expected behavior (inputs, outputs, invariants, edge cases)
18
+ - The allowed file scope (production files that may change)
19
+ - The test command for the affected suite (e.g. `pytest tests/test_billing.py`)
20
+
21
+ ---
22
+
23
+ ## Step 0 — CCEP Bootstrap
24
+
25
+ Command: `spec-mutation` (fixed for this workflow — do not infer from user text)
26
+
27
+ 1. Run: `npx cc-codeconductor ccep parse --command spec-mutation "$ARGUMENTS" --output json`
28
+ 2. Run: `npx cc-codeconductor ccep resolve --command spec-mutation "$ARGUMENTS" --output json`
29
+ 3. Run: `npx cc-codeconductor ccep profile spec-mutation --output json`
30
+ 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.
31
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
32
+ Canonical delivery order is test-before-implement whenever both phases apply.
33
+
34
+ ---
35
+
36
+ ## Step 0b — OpenSpec quality gates
37
+
38
+ If `openspec status` reports an active change folder:
39
+
40
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
41
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
42
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
43
+ 4. Next command spelling on this runner: `$cc-spec-mutation`
44
+
45
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
46
+
47
+ ---
48
+
49
+ ## Contract
50
+
51
+ The Gherkin specification is the **immutable contract** of the system. No code
52
+ merges unless it survives intentional source mutations. The loop is closed:
53
+
54
+ ```
55
+ [Human + spec_partner] ──> [gherkin_author] ──> [Test Freeze: SHA-256]
56
+ │
57
+ ┌──────────────────────────────────────────────────────┘
58
+ ▼
59
+ [tdd_craftsman] <───────────────┐ (surviving mutant)
60
+ (Red-Green-Refactor) │
61
+ │ │
62
+ ▼ │
63
+ [judge] ───────────> [mutation_testing] ───> [Safe Merge]
64
+ ```
65
+
66
+ Role mapping onto Conductor Agents (AGENTS.md):
67
+
68
+ | Workflow role | Conductor Agent | Deliverable |
69
+ | ------------------ | ----------------- | ------------------------------------------ |
70
+ | `craftsman_lead` | `orchestrator` | Routed Task Cards, per-stage scorecards |
71
+ | `spec_partner` | `task-coach` | Spec draft with invariants and boundaries |
72
+ | `gherkin_author` | `contract-builder`| Strict `.feature` file (Given/When/Then) |
73
+ | `tdd_craftsman` | `tester` → `implementer` | Failing test, then minimal production code |
74
+ | `judge` | `reviewer` | Binary verdict (PASS/REJECT) with scoring |
75
+ | `mutation_testing` | `tester` (runner) | Killed/survived mutant report |
76
+
77
+ ## Stage 1 — Interactive refinement (`spec_partner` / task-coach)
78
+
79
+ Do not jump to implementation. Apply Socratic questioning to the initial intent:
80
+
81
+ - Preconditions, postconditions, and edge cases.
82
+ - Invariant matrix: what must always be true.
83
+ - Scope boundaries: explicit `Scope / Files` and `Scope / Out` for the Task Card.
84
+
85
+ Stop gate: human confirms the draft before formalization.
86
+
87
+ ## Stage 2 — Hard Spec formalization (`gherkin_author` / contract-builder)
88
+
89
+ Formalize the agreed draft into `specs/<task>.feature` using strict Gherkin:
90
+
91
+ - No vague language ("must respond fast" is forbidden — use measurable Then steps).
92
+ - Every scenario declares preconditions (`Given`), actions (`When`), and
93
+ observable states (`Then`).
94
+ - Once the human approves the `.feature`, freeze it:
95
+
96
+ ```bash
97
+ shasum -a 256 specs/<task>.feature tests/ > .codeconductor/tasks/<task_id>.lock
98
+ ```
99
+
100
+ From this point `specs/` and `tests/` are **read-only** for implementation
101
+ agents. Before every later gate, recompute the hash; any single-byte difference
102
+ aborts the pipeline with scorecard 0 (Specification Gaming).
103
+
104
+ ## Stage 3 — TDD under the three laws (`tdd_craftsman`)
105
+
106
+ Delegates to the `$cc-tdd-cycle` state machine (`tddCycleStateMachine` in
107
+ `domain/loop`). Evidence must be captured with `captureTddSuiteEvidence` — do
108
+ not hand-edit JSON under `.codeconductor/evidence/`.
109
+
110
+ 1. **Law 1 (RED):** no production code except to make a failing test pass. A
111
+ compile error from a missing interface counts as a failure.
112
+ 2. **Law 2:** write exactly one failing assertion or scenario at a time.
113
+ 3. **Law 3 (GREEN):** write only the minimal production code to pass. No
114
+ speculative code, no preventive heuristics, stdlib-first.
115
+
116
+ Hard rule: any write attempt against `specs/` or `tests/` during GREEN/REFACTOR
117
+ is a harness violation — stop execution and report.
118
+
119
+ ## Stage 4 — Judge audit (`judge` / reviewer)
120
+
121
+ Deterministic gates before spending compute on mutation:
122
+
123
+ - Clean compile / diagnostics exit code 0.
124
+ - Traceability: every Gherkin step maps to an implemented test step.
125
+ - Scope Gaming audit: `git diff --name-only` must match the Task Card
126
+ `Scope / Files` exactly. Relaxed types, weakened assertions, or out-of-scope
127
+ edits → REJECT with findings.
128
+
129
+ Verdict is binary: PASS continues to the mutation gate; REJECT returns to the
130
+ `implement` phase with the findings attached.
131
+
132
+ ## Stage 5 — Mutation gate (`mutation_testing`)
133
+
134
+ Run the deterministic AST mutator shipped with this preset:
135
+
136
+ ```bash
137
+ python3 presets/shared/mutation_runner.py \
138
+ --target <production_file.py> \
139
+ --test-command "<test command>" \
140
+ --spec-folder specs
141
+ ```
142
+
143
+ The runner applies deterministic operator mutations (`>` → `<=`, `==` → `!=`,
144
+ `is` → `is not`, …) one at a time, re-runs the suite per mutant, and restores
145
+ the original source unconditionally (`finally` rollback).
146
+
147
+ - **Mutant killed (tests fail):** the suite detects the corruption. Continue.
148
+ - **Mutant survived (tests pass):** the tests are blind to this branch. The
149
+ runner writes `specs/handover.md` + appends to
150
+ `specs/implementation-summary.md` and exits with code **2**.
151
+
152
+ Non-Python stacks: substitute Stryker (JS/TS), PITest (JVM), or Mutmut
153
+ (Python full-suite) with the same contract — 100% kill rate or hands-off.
154
+
155
+ ### Hands-off protocol (exit code 2)
156
+
157
+ 1. Do NOT modify production code to "fix" a surviving mutant.
158
+ 2. Route back to `tdd_craftsman` with `specs/handover.md` as input: write the
159
+ missing failing test (Law 1 & 2) that asserts the mutated branch.
160
+ 3. Re-run stages 3–5.
161
+
162
+ ### Circuit breaker (max 3 loops)
163
+
164
+ The orchestrator keeps a persistent counter per Task Card. If the
165
+ `tdd_craftsman ↔ mutation_testing` loop does not reach a 100% kill rate after
166
+ **3 iterations**:
167
+
168
+ - Cancel active subagents (stop token/context spend).
169
+ - `git checkout -- <scope>` rollback to the last clean state.
170
+ - Scorecard: `STATUS = BLOCKED`; escalate to a human operator. The branch stays
171
+ frozen until human arbitration.
172
+
173
+ ## Guardrails (harness-enforced, not prompt-enforced)
174
+
175
+ - **Test Freezing:** SHA-256 of `specs/` + `tests/` stored in
176
+ `.codeconductor/tasks/<task_id>.lock`; hash mismatch aborts the pipeline.
177
+ - **Scope Guardian:** `fs_write`/`fs_patch` paths are validated against the Task
178
+ Card `Scope / Files`; path escapes (`../`) and critical files (`**/.env*`,
179
+ `**/credentials*`, infrastructure roots) are denied per `policy.yml`.
180
+ - **RBAC per role:** `gherkin_author` writes only `specs/`; `tdd_craftsman`
181
+ reads specs/tests and writes only scoped `src/`; `judge` and
182
+ `mutation_testing` are read-only except the runner's rolled-back patch.
183
+ - **Worktree isolation:** run the whole flow in a dedicated `git worktree`;
184
+ protected branches (`main`, `master`, `develop`) are never touched.
185
+
186
+ ## Completion criteria
187
+
188
+ - [ ] `.feature` approved and frozen (SHA-256 lock file exists and matches).
189
+ - [ ] RED → GREEN → REFACTOR evidence captured per phase.
190
+ - [ ] Judge verdict PASS (compile clean, traceability complete, scope clean).
191
+ - [ ] Mutation runner exits 0 with `total_mutants_killed == total_points`.
192
+ - [ ] Scorecard records the kill rate and iteration count (≤ 3).
193
+
194
+ ## Next
195
+
196
+ Run `$cc-review` on the diff before merging.