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,150 @@
1
+ ---
2
+ name: cc-iterative
3
+ description: Run the advanced iterative workflow — Wayfinding AST discovery, Relentless Grilling, contract and spec design, TDD, council review, and docs.
4
+ ---
5
+
6
+ # iterative
7
+
8
+ Invoke as `$cc-iterative`. The user request follows the skill mention.
9
+
10
+ # Advanced Iterative Workflow
11
+
12
+ Iterative request: $ARGUMENTS
13
+
14
+ ---
15
+
16
+ ## Step 0 — CCEP Bootstrap
17
+
18
+ Command: `iterative` (fixed for this workflow — do not infer from user text)
19
+
20
+ 1. Run: `npx cc-codeconductor ccep parse --command iterative "$ARGUMENTS" --output json`
21
+ 2. Run: `npx cc-codeconductor ccep resolve --command iterative "$ARGUMENTS" --output json`
22
+ 3. Run: `npx cc-codeconductor ccep profile iterative --output json`
23
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command iterative --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
+ Canonical delivery order is test-before-implement whenever both phases apply.
26
+
27
+ ---
28
+
29
+ ## Step 0b — OpenSpec quality gates
30
+
31
+ If `openspec status` reports an active change folder:
32
+
33
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
34
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
35
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
36
+ 4. Next command spelling on this runner: `$cc-iterative`
37
+
38
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
39
+
40
+ ---
41
+
42
+
43
+ ## Step 1 — Wayfinding (repo-explorer)
44
+
45
+ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
46
+ `graphify path` / `graphify explain` when two modules or one concept need a
47
+ scoped subgraph). Then adopt the `repo-explorer` role as defined in `AGENTS.md`
48
+ with that graph output.
49
+
50
+ repo-explorer maps directory trees, conventions, god nodes, and affected
51
+ modules. Do not write code in this step. Write a short phase handoff (scope,
52
+ files, open questions) before the next phase — do not chain agents on unspoken
53
+ context.
54
+
55
+ ---
56
+
57
+ ## Step 2 — Relentless Grilling & Task Card (task-coach)
58
+
59
+ Adopt the `task-coach` role as defined in `AGENTS.md`.
60
+
61
+ Produce a complete Task Card. The Task Card is ready when it contains: title,
62
+ type, risk classification, scope, context, acceptance criteria, and
63
+ constraints, and every assumption behind it has survived one grilling
64
+ question (Grilling protocol).
65
+
66
+ If any field is missing or ambiguous, ask one clarifying question at a time and
67
+ wait for the answer. Do not proceed with an incomplete Task Card.
68
+
69
+ **STOP here.** Unresolved grilling questions or missing fields populate
70
+ `questionsForUser` in the CCEP-1 `planner-output`; the `ConfirmationGate`
71
+ (`ccep evaluate`) reads that field and halts the workflow until a human
72
+ answers. Show the completed Task Card and wait for that confirmation before
73
+ continuing.
74
+
75
+ ---
76
+
77
+ ## Step 3 — Contract & Technical Plan (contract-builder & architect)
78
+
79
+ Adopt the `contract-builder` role as defined in `AGENTS.md`, then the `architect` role as defined in `AGENTS.md`.
80
+
81
+ 1. Define API contracts, JSON Schemas, or TypeScript interfaces.
82
+ 2. Formulate the Technical Plan (chosen approach, affected files, trade-offs).
83
+ 3. Apply YAGNI, Simplicity First, and Stdlib-First.
84
+
85
+ **STOP here. Show the Technical Plan and wait for explicit human approval. Do
86
+ not proceed to tests until the plan is approved.**
87
+
88
+ ---
89
+
90
+ ## Step 4 — Test coverage (Tester role)
91
+
92
+ Adopt the `tester` role as defined in `AGENTS.md`.
93
+
94
+ 1. Write or extend failing tests for the new behavior before implementation (RED).
95
+ 2. Ensure all acceptance criteria from the Task Card have at least one test.
96
+ 3. Produce a Test Report: test files added or modified, cases covered.
97
+
98
+ ---
99
+
100
+ ## Step 5 — Implementation (Implementer role)
101
+
102
+ Adopt the `implementer` role as defined in `AGENTS.md`.
103
+
104
+ Use the approved Technical Plan, contracts, and the failing tests.
105
+ Implementer creates a Git Worktree before touching any file; all edits happen
106
+ inside it.
107
+
108
+ 1. Read the Technical Plan before touching any file.
109
+ 2. Apply the minimal diff — only what the plan specifies.
110
+ 3. Run the project test suite and make the previously written failing tests pass.
111
+ 4. If tests fail, run up to 3 repair cycles (`implementer` → `tester`).
112
+ 5. Produce an Implementation Summary: what changed, which files, how to verify
113
+ locally.
114
+
115
+ ---
116
+
117
+ ## Step 6 — Multi-Perspective Council Review
118
+
119
+ Invoke the `council` skill on the generated diff (`council-review` phase).
120
+
121
+ The council evaluates Architecture, Security, Product, Delivery, DataOps, and
122
+ Devil. `security-reviewer` may set `securityVeto: true`; that REJECTED verdict
123
+ overrides majority consensus.
124
+
125
+ If ANY agent votes CRITICAL:
126
+ - The Review Report status is **BLOCKED**.
127
+ - Return to Step 5 with the feedback.
128
+
129
+ If APPROVED (no CRITICAL findings), continue.
130
+
131
+ ---
132
+
133
+ ## Step 7 — Documentation (Docs role)
134
+
135
+ Adopt the `docs` role as defined in `AGENTS.md` when a public API, public module,
136
+ or user-visible behavior changed.
137
+
138
+ Update: README (if applicable), OpenAPI spec (if applicable), CHANGELOG
139
+ (always when implementation changed), ADR (if an architectural decision was
140
+ made).
141
+
142
+ If `graphify-out/` is in use, run `graphify update .` (AST-only).
143
+
144
+ ---
145
+
146
+ ## Completion
147
+
148
+ The iterative workflow is complete only when: all tests pass, the council
149
+ approves the spec and the diff, no CRITICAL findings remain, and documentation
150
+ and the knowledge graph reflect the implemented behavior.
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: cc-openspec
3
+ description: Run OpenSpec backlog delivery — validate BACKLOG.md, plan TaskCards, orchestrate agents by phase, review gate, and update backlog state.
4
+ ---
5
+
6
+ # openspec
7
+
8
+ Invoke as `$cc-openspec`. The user request follows the skill mention.
9
+
10
+ # OpenSpec Backlog Workflow
11
+
12
+ Scope: $ARGUMENTS
13
+
14
+ Orchestrate FIFO delivery from `BACKLOG.md`. CodeConductor owns planning; agents execute one TaskCard per phase with the installed preset model for each role.
15
+
16
+ ---
17
+
18
+ ---
19
+
20
+ ## Step 0 — CCEP Bootstrap
21
+
22
+ Command: `openspec` (fixed for this workflow — do not infer from user text)
23
+
24
+ 1. Run: `npx cc-codeconductor ccep parse --command openspec "$ARGUMENTS" --output json`
25
+ 2. Run: `npx cc-codeconductor ccep resolve --command openspec "$ARGUMENTS" --output json`
26
+ 3. Run: `npx cc-codeconductor ccep profile openspec --output json`
27
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command openspec --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
28
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
29
+ Canonical delivery order is test-before-implement whenever both phases apply.
30
+
31
+ ---
32
+
33
+ ## Step 0b — OpenSpec quality gates
34
+
35
+ If `openspec status` reports an active change folder:
36
+
37
+ 1. Run: `npx cc-codeconductor openspec validate --output json`
38
+ 2. Run: `npx cc-codeconductor openspec analyze --output json`
39
+ 3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
40
+ 4. Next command spelling on this runner: `$cc-openspec`
41
+
42
+ Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
43
+
44
+ ---
45
+
46
+
47
+ ## Step 1 — Validate (mandatory gate)
48
+
49
+ Run:
50
+
51
+ ```bash
52
+ npx cc-codeconductor openspec validate
53
+ ```
54
+
55
+ If validation fails:
56
+
57
+ 1. List all errors and recommendations from the CLI output.
58
+ 2. Show the canonical BACKLOG.md structure (## Global, ## Items, ### BC-001 | Title, Priority, Status, Type, Depends on, Description, Scope, Acceptance).
59
+ 3. **STOP.** Do not scan, plan, or execute until the user fixes BACKLOG.md.
60
+
61
+ ---
62
+
63
+ ## Step 2 — Scan
64
+
65
+ Run:
66
+
67
+ ```bash
68
+ npx cc-codeconductor openspec scan
69
+ ```
70
+
71
+ Report: new items, modified items, closed/archived items, and whether the file changed.
72
+
73
+ ---
74
+
75
+ ## Step 3 — Select item
76
+
77
+ If `$ARGUMENTS` contains a `BC-xxx` ID, use that item. Otherwise run:
78
+
79
+ ```bash
80
+ npx cc-codeconductor openspec status
81
+ ```
82
+
83
+ Pick the next `READY` item with satisfied dependencies (FIFO by priority). Skip items in `DONE` or `Archive`.
84
+
85
+ **STOP if no eligible item.** Report backlog status and wait for the user.
86
+
87
+ ---
88
+
89
+ ## Step 4 — Plan
90
+
91
+ Run:
92
+
93
+ ```bash
94
+ npx cc-codeconductor openspec plan <BC-id>
95
+ ```
96
+
97
+ Show:
98
+
99
+ - Generated TaskCards (discover → design → test → implement → review when TDD required)
100
+ - Path to `openspec/changes/<slug>/` (proposal, design, tasks, specs)
101
+
102
+ Update BACKLOG item status to `PLANNED` (CLI does this automatically).
103
+
104
+ ---
105
+
106
+ ## Drive card status (CLI)
107
+
108
+ Do not edit `.codeconductor/openspec-state.json` by hand.
109
+
110
+ ```bash
111
+ npx cc-codeconductor openspec start <cardId>
112
+ npx cc-codeconductor openspec done <cardId>
113
+ npx cc-codeconductor openspec block <cardId> --reason "waiting on design"
114
+ npx cc-codeconductor openspec archive <itemId>
115
+ ```
116
+
117
+ `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/`.
118
+
119
+ ---
120
+
121
+ ## Step 5 — Model matrix and execute loop
122
+
123
+ Before executing phases, show resolved models:
124
+
125
+ ```bash
126
+ npx cc-codeconductor scorecard models
127
+ ```
128
+
129
+ For each pending TaskCard, run:
130
+
131
+ ```bash
132
+ npx cc-codeconductor openspec next
133
+ ```
134
+
135
+ Invoke the agent named on the card with **isolated** context (`/clear` between phases unless continuation is required):
136
+
137
+ | Phase | Agent | Role |
138
+ |-------|-------|------|
139
+ | discover | repo-explorer | Map repo and impact |
140
+ | design | architect | Technical plan |
141
+ | test | tester | TDD tests (before implement if TDD required) |
142
+ | implement | implementer | Minimal diff in worktree |
143
+ | review | reviewer | Acceptance + scope gate |
144
+
145
+ Use the model configured in the installed preset for each agent role.
146
+
147
+ After each phase:
148
+
149
+ - Mark progress in deliverable summary.
150
+ - Run `npx cc-codeconductor openspec done <cardId>` when the phase completes. Do not edit openspec-state.json by hand.
151
+
152
+ Implementer: create a Git worktree before editing (`git worktree add ../<branch>-session <branch>`).
153
+
154
+ ---
155
+
156
+ ## Step 6 — Review gate
157
+
158
+ Run regression when BACKLOG Global `Review required: yes`:
159
+
160
+ ```bash
161
+ npx cc-codeconductor scorecard regression
162
+ ```
163
+
164
+ The `reviewer` agent must verify:
165
+
166
+ - All acceptance criteria from BACKLOG.md
167
+ - Tests pass
168
+ - Scope matches the backlog item
169
+ - No architectural violations
170
+
171
+ If **rejected**: set item status `IN_PROGRESS`, record findings in state, **STOP** and report to user.
172
+
173
+ If **approved**: proceed to Step 6.
174
+
175
+ ---
176
+
177
+ ## Step 7 — Scorecard and update backlog
178
+
179
+ 1. `npx cc-codeconductor scorecard create --task <BC-id> --from-diff`
180
+ 2. Complete criteria; `scorecard record` with verdict and optional cost/tokens
181
+ 3. Set item `Progress: 100%`, `Status: DONE` if PASS
182
+ 4. Move item to `## Archive` in BACKLOG.md if DONE
183
+ 5. Run `npx cc-codeconductor openspec scan`
184
+
185
+ Report completion: Task Cards executed, scorecard verdict, change folder path, files changed.
186
+
187
+ ---
188
+
189
+ ## Skill
190
+
191
+ Apply `.claude/skills/openspec/SKILL.md` for backlog format rules and state transitions.
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: cc-pagespeed
3
+ description: CodeConductor pagespeed workflow
4
+ ---
5
+
6
+ # pagespeed
7
+
8
+ Invoke as `$cc-pagespeed`. The user request follows the skill mention.
9
+
10
+ # PageSpeed Performance Audit
11
+
12
+ Audit web performance using the PageSpeed Insights API. Applies the 80/20
13
+ principle: identify the 20% of changes that produce 80% of the performance gain.
14
+ Produces a prioritized report in the current working directory.
15
+
16
+ ## Step 0 — CCEP Bootstrap
17
+
18
+ Command: `pagespeed` (fixed for this workflow — do not infer from user text)
19
+
20
+ 1. Run: `npx cc-codeconductor ccep parse --command pagespeed "$ARGUMENTS" --output json`
21
+ 2. Run: `npx cc-codeconductor ccep resolve --command pagespeed "$ARGUMENTS" --output json`
22
+ 3. Run: `npx cc-codeconductor ccep profile pagespeed --output json`
23
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command pagespeed --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
+ ## Usage
29
+
30
+ ```
31
+ /cc-pagespeed --url <url> [--strategy mobile|desktop|both]
32
+ ```
33
+
34
+ ## Parameters
35
+
36
+ | Parameter | Required | Description |
37
+ | ------------- | -------- | -------------------------------------------------------------- |
38
+ | `--url` | Yes | Full URL to audit (must include scheme: https://...) |
39
+ | `--strategy` | No | Analysis strategy: `mobile`, `desktop`, or `both` (default: `both`) |
40
+
41
+ ## Requirements
42
+
43
+ ### `PAGESPEED_API_KEY` — Optional but strongly recommended
44
+
45
+ | Mode | Lab data | CrUX field data | Rate limits |
46
+ | ------------ | -------- | --------------- | ---------------- |
47
+ | **With key** | ✅ | ✅ (real users) | 25,000 req/day |
48
+ | **Without** | ✅ | ❌ | ~2 req/s shared |
49
+
50
+ Without the key, Core Web Vitals field data (real user experience via CrUX) is
51
+ unavailable. Lab data from Lighthouse still runs.
52
+
53
+ Set the key before invoking the command:
54
+
55
+ ```powershell
56
+ # Windows PowerShell
57
+ $env:PAGESPEED_API_KEY = "your-api-key"
58
+
59
+ # macOS / Linux
60
+ export PAGESPEED_API_KEY="your-api-key"
61
+ ```
62
+
63
+ Get a free key (Google account required):
64
+ <https://developers.google.com/speed/docs/insights/v5/get-started>
65
+
66
+ ## Workflow
67
+
68
+ When `/cc-pagespeed` is invoked, load the `pagespeed-perf` skill and execute
69
+ the following steps in order:
70
+
71
+ 1. **Pre-flight** — Read `$env:PAGESPEED_API_KEY` from the environment. Compute
72
+ the output filename: `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
73
+
74
+ 2. **Collect** — Call the PageSpeed Insights API for the requested strategy
75
+ (`mobile`, `desktop`, or `both`). Prefer the Bun scripts in
76
+ `~/.claude/skills/pagespeed-perf/scripts/run.ts` if Bun is available.
77
+ Otherwise, use `WebFetch` to call the PSI endpoint directly.
78
+
79
+ 3. **Analyze** — Extract Core Web Vitals (LCP, INP, CLS, FCP, TTFB, TBT),
80
+ identify the LCP element, enumerate third-party scripts by blocking time,
81
+ and inspect resource hints in the HTML `<head>`.
82
+
83
+ 4. **Prioritize** — Score each identified optimization using the 80/20 matrix:
84
+ `Impact × Ease` (each 1–5). Order findings by descending score. Highlight
85
+ the top actions with Score ≥ 20 as the critical 20%.
86
+
87
+ 5. **Report** — Write the structured markdown report to
88
+ `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md` in the current directory.
89
+
90
+ ## Output File
91
+
92
+ The report is saved as `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
93
+
94
+ - Hostname characters outside `[a-zA-Z0-9]` are replaced with `-`.
95
+ - Example: `https://www.example.com` → `2026-06-07_pagespeed-www-example-com-claude.md`
96
+
97
+ ## Skills Loaded
98
+
99
+ - `pagespeed-perf` — Web Performance Engineering: PSI API, Core Web Vitals
100
+ thresholds, 80/20 optimization matrix, resource-hint analysis, third-party
101
+ script auditing, framework-specific implementation templates.
102
+
103
+ ## Examples
104
+
105
+ ```bash
106
+ # Full audit — mobile + desktop
107
+ /cc-pagespeed --url https://www.example.com
108
+
109
+ # Mobile only
110
+ /cc-pagespeed --url https://www.example.com --strategy mobile
111
+
112
+ # Desktop only
113
+ /cc-pagespeed --url https://www.example.com --strategy desktop
114
+ ```
115
+
116
+ ## Hard Rules
117
+
118
+ - **GET only.** Never send POST, PUT, or DELETE to the target URL.
119
+ - **No auth.** Never include cookies, tokens, or auth headers.
120
+ - **No external crawling.** Audit only the provided URL.
121
+ - **Quantify every finding.** Never write "it would improve LCP". Always cite
122
+ the observed value and estimated gain (e.g., "reduces LCP from 4.2 s to ~3.0 s").
123
+ - **No generic recommendations.** Every finding must be backed by data from
124
+ the audit of this specific URL.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: cc-prototype
3
+ description: Disposable spike in an isolated worktree. Not a merge candidate.
4
+ ---
5
+
6
+ # prototype
7
+
8
+ Invoke as `$cc-prototype`. The user request follows the skill mention.
9
+
10
+ # Prototype Workflow
11
+
12
+ Prototype request: $ARGUMENTS
13
+
14
+ ## Step 0 — CCEP Bootstrap
15
+
16
+ Command: `prototype` (fixed for this workflow — do not infer from user text)
17
+
18
+ 1. Run: `npx cc-codeconductor ccep parse --command prototype "$ARGUMENTS" --output json`
19
+ 2. Run: `npx cc-codeconductor ccep resolve --command prototype "$ARGUMENTS" --output json`
20
+ 3. Run: `npx cc-codeconductor ccep profile prototype --output json`
21
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command prototype --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
22
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
23
+
24
+ ---
25
+
26
+ ## Step 1 — Bounds (architect)
27
+
28
+ Invoke `architect`. Define what the spike may touch, time-box, and what must not leak into main. Do not treat this as a production Technical Plan.
29
+
30
+ **STOP here. Wait for approval of the spike bounds.**
31
+
32
+ ---
33
+
34
+ ## Step 2 — Spike (implementer)
35
+
36
+ Invoke `implementer` in a Git worktree that is not a merge candidate. Label the Implementation Summary as disposable. Do not open a PR against protected branches.
37
+
38
+ ---
39
+
40
+ ## Completion
41
+
42
+ Report bounds, worktree path, and what was learned. Recommend `$cc-feature` or `$cc-fix` if the spike should become real work.
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: cc-refactor
3
+ description: Run the refactor workflow — mandatory architectural justification, test verification, risk-based implementation, and scope enforcement.
4
+ ---
5
+
6
+ # refactor
7
+
8
+ Invoke as `$cc-refactor`. The user request follows the skill mention.
9
+
10
+ # Refactor Workflow
11
+
12
+ Refactor description: $ARGUMENTS
13
+
14
+ Describe what you want to refactor and why. Include:
15
+
16
+ - The current structure or pattern being changed
17
+ - The target structure or pattern
18
+ - The motivation (performance, readability, architectural alignment, etc.)
19
+ - Known risk areas or dependencies
20
+
21
+ ---
22
+
23
+ ## Prerequisite — Test coverage check
24
+
25
+ Before any role is adopted, verify that the code being refactored has adequate
26
+ test coverage.
27
+
28
+ A refactor without tests is not a refactor — it is a rewrite with unknown
29
+ behavioral consequences.
30
+
31
+ If coverage is insufficient:
32
+
33
+ 1. **STOP**. Report the coverage gap.
34
+ 2. Suggest running `/test-plan` first to establish coverage.
35
+ 3. Do not proceed with the refactor until coverage is confirmed.
36
+
37
+ ---
38
+
39
+ ## Step 0 — CCEP Bootstrap
40
+
41
+ Command: `refactor` (fixed for this workflow — do not infer from user text)
42
+
43
+ 1. Run: `npx cc-codeconductor ccep parse --command refactor "$ARGUMENTS" --output json`
44
+ 2. Run: `npx cc-codeconductor ccep resolve --command refactor "$ARGUMENTS" --output json`
45
+ 3. Run: `npx cc-codeconductor ccep profile refactor --output json`
46
+ 4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command refactor --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
47
+ 5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
48
+
49
+ ---
50
+
51
+ ## Step 1 — Architectural justification (Architect role)
52
+
53
+ Adopt the `architect` role as defined in `AGENTS.md`. Always invoke this step
54
+ first, regardless of risk level. A refactor without a written justification is
55
+ scope creep in disguise.
56
+
57
+ Produce a Refactor Plan that includes:
58
+
59
+ - Statement of the problem with the current structure
60
+ - Proposed target structure and rationale
61
+ - Affected files and module boundaries
62
+ - Risk level: `low`, `medium`, or `high`
63
+ - Behavioral invariants that must not change
64
+ - Open questions requiring human input
65
+
66
+ **Scope creep warning:** If during planning you identify unrelated improvements,
67
+ list them separately as "Out of scope." They are not part of this refactor.
68
+
69
+ **STOP here. Show the Refactor Plan and wait for explicit human approval. Do not
70
+ proceed without written approval of the plan.**
71
+
72
+ ---
73
+
74
+ ## Step 2 — Route by risk
75
+
76
+ Read the risk field from the Refactor Plan and follow the corresponding route.
77
+
78
+ ### Low-risk route
79
+
80
+ Applies when: the refactor is purely internal, no public interfaces change, full
81
+ test coverage exists for the affected code, and behavioral impact is isolated to
82
+ the refactored module.
83
+
84
+ Route: Architect (done) → Implementer
85
+
86
+ Proceed to Step 3a.
87
+
88
+ ### Medium or high-risk route
89
+
90
+ Applies when: module boundaries change, shared interfaces are affected,
91
+ performance characteristics may change, or the refactor touches more than two
92
+ files with behavioral impact.
93
+
94
+ Route: Architect (done) → Implementer → Reviewer
95
+
96
+ Proceed to Step 3b.
97
+
98
+ ---
99
+
100
+ ## Step 3a — Implementation, low-risk (Implementer role)
101
+
102
+ Adopt the `implementer` role as defined in `AGENTS.md`. Use the approved
103
+ Refactor Plan.
104
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
105
+
106
+ 1. Read the Refactor Plan before opening any file.
107
+ 2. Apply only the changes specified in the plan.
108
+ 3. Run the full test suite before and after — both runs must pass.
109
+ 4. Produce an Implementation Summary: what changed, what did not change, test
110
+ results before and after.
111
+
112
+ Any deviation from the plan — including "obvious improvements" encountered
113
+ during implementation — must be flagged and held for a separate task.
114
+
115
+ ---
116
+
117
+ ## Step 3b — Implementation, medium/high-risk (Implementer role)
118
+
119
+ Same rules as Step 3a. Additionally:
120
+
121
+ - Document any unexpected complexity discovered during implementation.
122
+ - Pause and report if complexity changes the risk assessment.
123
+ - If new risks are found, **STOP** and report before continuing.
124
+
125
+ ---
126
+
127
+ ## Step 4 — Test suite verification
128
+
129
+ For all risk levels, confirm:
130
+
131
+ - All tests that existed before the refactor still pass.
132
+ - No test was deleted or commented out to make the suite pass.
133
+ - Behavior documented in the Task Card remains unchanged.
134
+
135
+ If any test fails that was passing before, the refactor has introduced a
136
+ regression. **STOP and report.**
137
+
138
+ ---
139
+
140
+ ## Step 5 — Code review (Reviewer role) — medium/high-risk only
141
+
142
+ Adopt the `reviewer` role as defined in `AGENTS.md`. Use the diff and Refactor
143
+ Plan.
144
+
145
+ Verify:
146
+
147
+ - The implementation matches the approved plan.
148
+ - No behavior was changed beyond the plan's scope.
149
+ - No unrelated files were modified.
150
+
151
+ Review Report must include CRITICAL / WARNING / SUGGESTION findings. CRITICAL
152
+ findings block completion.
153
+
154
+ ---
155
+
156
+ ## Completion
157
+
158
+ Report: Refactor Plan (approved), Implementation Summary, test results before
159
+ and after, Review Report (if applicable).
160
+
161
+ The refactor is complete only when: all pre-existing tests still pass, the
162
+ implementation matches the approved plan exactly, and no CRITICAL review
163
+ findings remain.
164
+
165
+ ## Next
166
+
167
+ Run `$cc-review` on the diff before merging.