cc-codeconductor 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/README.md +326 -87
  2. package/dist/core/compilation/compile-checker.d.ts +2 -0
  3. package/dist/core/loop/loop-engine.d.ts +3 -0
  4. package/dist/core/verification/verification-runner.d.ts +7 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +3825 -597
  7. package/dist/library.js +195 -18
  8. package/dist/validation/schemas.d.ts +461 -44
  9. package/package.json +4 -1
  10. package/presets/agy/AGENTS.md +13 -9
  11. package/presets/agy/gates/pre-commit/GATE.md +5 -4
  12. package/presets/agy/hooks.json +2 -2
  13. package/presets/agy/scripts/invoke-hook.cjs +115 -0
  14. package/presets/agy/skills/backlog/SKILL.md +61 -0
  15. package/presets/agy/skills/cc-spec-mutation/SKILL.md +165 -0
  16. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +3 -0
  17. package/presets/agy/skills/evaluation/SKILL.md +61 -2
  18. package/presets/agy/skills/openspec/SKILL.md +50 -16
  19. package/presets/agy/skills/security-ai-llm/SKILL.md +43 -0
  20. package/presets/agy/skills/security-blue-team/SKILL.md +43 -0
  21. package/presets/agy/skills/security-cloud/SKILL.md +43 -0
  22. package/presets/agy/skills/security-crypto/SKILL.md +43 -0
  23. package/presets/agy/skills/security-exploit-dev/SKILL.md +45 -0
  24. package/presets/agy/skills/security-grc/SKILL.md +43 -0
  25. package/presets/agy/skills/security-incident-response/SKILL.md +45 -0
  26. package/presets/agy/skills/security-log-analysis/SKILL.md +43 -0
  27. package/presets/agy/skills/security-malware-analysis/SKILL.md +44 -0
  28. package/presets/agy/skills/security-mobile/SKILL.md +43 -0
  29. package/presets/agy/skills/security-network/SKILL.md +43 -0
  30. package/presets/agy/skills/security-ot-ics/SKILL.md +43 -0
  31. package/presets/agy/skills/security-recon/SKILL.md +45 -0
  32. package/presets/agy/skills/security-red-team/SKILL.md +44 -0
  33. package/presets/agy/skills/security-reverse-engineering/SKILL.md +44 -0
  34. package/presets/agy/skills/security-soc-automation/SKILL.md +43 -0
  35. package/presets/agy/skills/security-threat-hunting/SKILL.md +43 -0
  36. package/presets/agy/skills/security-vuln-assessment/SKILL.md +45 -0
  37. package/presets/agy/skills/security-web/SKILL.md +44 -0
  38. package/presets/agy/skills/testing-tdd/SKILL.md +53 -0
  39. package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
  40. package/presets/agy/workflows/cc-api-contract.md +14 -0
  41. package/presets/agy/workflows/cc-ask.md +2 -1
  42. package/presets/agy/workflows/cc-backlog.md +69 -0
  43. package/presets/agy/workflows/cc-db-migration.md +14 -0
  44. package/presets/agy/workflows/cc-explore.md +1 -1
  45. package/presets/agy/workflows/cc-feature.md +18 -0
  46. package/presets/agy/workflows/cc-fix.md +14 -0
  47. package/presets/agy/workflows/cc-iterative.md +14 -0
  48. package/presets/agy/workflows/cc-openspec.md +17 -1
  49. package/presets/agy/workflows/cc-scorecard.md +2 -0
  50. package/presets/agy/workflows/cc-security.md +180 -0
  51. package/presets/agy/workflows/cc-spec-mutation.md +191 -0
  52. package/presets/agy/workflows/cc-tdd-cycle.md +14 -0
  53. package/presets/claude/CLAUDE.md +4 -0
  54. package/presets/claude/commands/cc/api-contract.md +14 -0
  55. package/presets/claude/commands/cc/ask.md +2 -1
  56. package/presets/claude/commands/cc/backlog.md +104 -0
  57. package/presets/claude/commands/cc/db-migration.md +14 -0
  58. package/presets/claude/commands/cc/explore.md +1 -1
  59. package/presets/claude/commands/cc/feature.md +18 -0
  60. package/presets/claude/commands/cc/fix.md +17 -0
  61. package/presets/claude/commands/cc/iterative.md +14 -0
  62. package/presets/claude/commands/cc/openspec.md +30 -1
  63. package/presets/claude/commands/cc/review.md +3 -0
  64. package/presets/claude/commands/cc/scorecard.md +2 -0
  65. package/presets/claude/commands/cc/security.md +179 -0
  66. package/presets/claude/commands/cc/spec-mutation.md +190 -0
  67. package/presets/claude/commands/cc/tdd-cycle.md +17 -0
  68. package/presets/claude/gates/pre-commit/GATE.md +5 -4
  69. package/presets/claude/settings.json +13 -11
  70. package/presets/claude/skills/backlog/SKILL.md +61 -0
  71. package/presets/claude/skills/evaluation/SKILL.md +47 -24
  72. package/presets/claude/skills/openspec/SKILL.md +46 -34
  73. package/presets/claude/skills/security/SKILL.md +382 -0
  74. package/presets/claude/skills/security-ai-llm/SKILL.md +43 -0
  75. package/presets/claude/skills/security-blue-team/SKILL.md +43 -0
  76. package/presets/claude/skills/security-cloud/SKILL.md +43 -0
  77. package/presets/claude/skills/security-crypto/SKILL.md +43 -0
  78. package/presets/claude/skills/security-exploit-dev/SKILL.md +45 -0
  79. package/presets/claude/skills/security-grc/SKILL.md +43 -0
  80. package/presets/claude/skills/security-incident-response/SKILL.md +45 -0
  81. package/presets/claude/skills/security-log-analysis/SKILL.md +43 -0
  82. package/presets/claude/skills/security-malware-analysis/SKILL.md +44 -0
  83. package/presets/claude/skills/security-mobile/SKILL.md +43 -0
  84. package/presets/claude/skills/security-network/SKILL.md +43 -0
  85. package/presets/claude/skills/security-ot-ics/SKILL.md +43 -0
  86. package/presets/claude/skills/security-recon/SKILL.md +45 -0
  87. package/presets/claude/skills/security-red-team/SKILL.md +44 -0
  88. package/presets/claude/skills/security-reverse-engineering/SKILL.md +44 -0
  89. package/presets/claude/skills/security-soc-automation/SKILL.md +43 -0
  90. package/presets/claude/skills/security-threat-hunting/SKILL.md +43 -0
  91. package/presets/claude/skills/security-vuln-assessment/SKILL.md +45 -0
  92. package/presets/claude/skills/security-web/SKILL.md +44 -0
  93. package/presets/claude/skills/testing-tdd/SKILL.md +53 -0
  94. package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
  95. package/presets/codex/AGENTS.md +16 -12
  96. package/presets/codex/commands/cc-ask.md +2 -1
  97. package/presets/codex/gates/pre-commit/GATE.md +5 -4
  98. package/presets/codex/skills/backlog/SKILL.md +61 -0
  99. package/presets/codex/skills/cc-api-contract/SKILL.md +87 -0
  100. package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
  101. package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
  102. package/presets/codex/skills/cc-council/SKILL.md +92 -0
  103. package/presets/codex/skills/cc-db-migration/SKILL.md +88 -0
  104. package/presets/codex/skills/cc-explore/SKILL.md +40 -0
  105. package/presets/codex/skills/cc-feature/SKILL.md +154 -0
  106. package/presets/codex/skills/cc-fix/SKILL.md +165 -0
  107. package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
  108. package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
  109. package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
  110. package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
  111. package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
  112. package/presets/codex/skills/cc-refactor/SKILL.md +163 -0
  113. package/presets/codex/skills/cc-review/SKILL.md +152 -0
  114. package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
  115. package/presets/codex/skills/cc-security/SKILL.md +182 -0
  116. package/presets/codex/skills/cc-spec-mutation/SKILL.md +192 -0
  117. package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
  118. package/presets/codex/skills/cc-test-plan/SKILL.md +153 -0
  119. package/presets/codex/skills/cc-triage/SKILL.md +38 -0
  120. package/presets/codex/skills/evaluation/SKILL.md +65 -0
  121. package/presets/codex/skills/openspec/SKILL.md +66 -0
  122. package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
  123. package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
  124. package/presets/cursor/AGENTS.md +2 -2
  125. package/presets/cursor/commands/cc/api-contract.md +14 -0
  126. package/presets/cursor/commands/cc/ask.md +2 -1
  127. package/presets/cursor/commands/cc/backlog.md +105 -0
  128. package/presets/cursor/commands/cc/db-migration.md +14 -0
  129. package/presets/cursor/commands/cc/explore.md +1 -1
  130. package/presets/cursor/commands/cc/feature.md +18 -0
  131. package/presets/cursor/commands/cc/fix.md +17 -0
  132. package/presets/cursor/commands/cc/iterative.md +14 -0
  133. package/presets/cursor/commands/cc/openspec.md +30 -1
  134. package/presets/cursor/commands/cc/scorecard.md +2 -0
  135. package/presets/cursor/commands/cc/security.md +179 -0
  136. package/presets/cursor/commands/cc/spec-mutation.md +190 -0
  137. package/presets/cursor/commands/cc/tdd-cycle.md +14 -0
  138. package/presets/cursor/gates/pre-commit/GATE.md +5 -4
  139. package/presets/cursor/skills/backlog/SKILL.md +61 -0
  140. package/presets/cursor/skills/evaluation/SKILL.md +61 -4
  141. package/presets/cursor/skills/openspec/SKILL.md +47 -33
  142. package/presets/cursor/skills/security-ai-llm/SKILL.md +43 -0
  143. package/presets/cursor/skills/security-blue-team/SKILL.md +43 -0
  144. package/presets/cursor/skills/security-cloud/SKILL.md +43 -0
  145. package/presets/cursor/skills/security-crypto/SKILL.md +43 -0
  146. package/presets/cursor/skills/security-exploit-dev/SKILL.md +45 -0
  147. package/presets/cursor/skills/security-grc/SKILL.md +43 -0
  148. package/presets/cursor/skills/security-incident-response/SKILL.md +45 -0
  149. package/presets/cursor/skills/security-log-analysis/SKILL.md +43 -0
  150. package/presets/cursor/skills/security-malware-analysis/SKILL.md +44 -0
  151. package/presets/cursor/skills/security-mobile/SKILL.md +43 -0
  152. package/presets/cursor/skills/security-network/SKILL.md +43 -0
  153. package/presets/cursor/skills/security-ot-ics/SKILL.md +43 -0
  154. package/presets/cursor/skills/security-recon/SKILL.md +45 -0
  155. package/presets/cursor/skills/security-red-team/SKILL.md +44 -0
  156. package/presets/cursor/skills/security-reverse-engineering/SKILL.md +44 -0
  157. package/presets/cursor/skills/security-soc-automation/SKILL.md +43 -0
  158. package/presets/cursor/skills/security-threat-hunting/SKILL.md +43 -0
  159. package/presets/cursor/skills/security-vuln-assessment/SKILL.md +45 -0
  160. package/presets/cursor/skills/security-web/SKILL.md +44 -0
  161. package/presets/cursor/skills/testing-tdd/SKILL.md +35 -574
  162. package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
  163. package/presets/gemini/commands/cc/api-contract.toml +82 -0
  164. package/presets/gemini/commands/cc/ask.toml +54 -0
  165. package/presets/gemini/commands/cc/backlog.toml +103 -0
  166. package/presets/gemini/commands/cc/clarify.toml +31 -0
  167. package/presets/gemini/commands/cc/council.toml +87 -0
  168. package/presets/gemini/commands/cc/db-migration.toml +83 -0
  169. package/presets/gemini/commands/cc/explore.toml +35 -0
  170. package/presets/gemini/commands/cc/feature.toml +153 -0
  171. package/presets/gemini/commands/cc/fix.toml +163 -0
  172. package/presets/gemini/commands/cc/handoff.toml +40 -0
  173. package/presets/gemini/commands/cc/iterative.toml +145 -0
  174. package/presets/gemini/commands/cc/openspec.toml +186 -0
  175. package/presets/gemini/commands/cc/pagespeed.toml +119 -0
  176. package/presets/gemini/commands/cc/prototype.toml +37 -0
  177. package/presets/gemini/commands/cc/refactor.toml +158 -0
  178. package/presets/gemini/commands/cc/review.toml +150 -0
  179. package/presets/gemini/commands/cc/scorecard.toml +77 -0
  180. package/presets/gemini/commands/cc/security.toml +177 -0
  181. package/presets/gemini/commands/cc/spec-mutation.toml +187 -0
  182. package/presets/gemini/commands/cc/tdd-cycle.toml +264 -0
  183. package/presets/gemini/commands/cc/test-plan.toml +148 -0
  184. package/presets/gemini/commands/cc/triage.toml +33 -0
  185. package/presets/opencode/README.md +24 -21
  186. package/presets/opencode/agents/architect.md +6 -0
  187. package/presets/opencode/agents/implementer.md +7 -0
  188. package/presets/opencode/agents/reviewer.md +6 -0
  189. package/presets/opencode/agents/tester.md +6 -0
  190. package/presets/opencode/commands/cc-api-contract.md +14 -0
  191. package/presets/opencode/commands/cc-ask.md +2 -1
  192. package/presets/opencode/commands/cc-backlog.md +68 -0
  193. package/presets/opencode/commands/cc-db-migration.md +14 -0
  194. package/presets/opencode/commands/cc-explore.md +1 -1
  195. package/presets/opencode/commands/cc-feature.md +18 -0
  196. package/presets/opencode/commands/cc-fix.md +17 -0
  197. package/presets/opencode/commands/cc-iterative.md +14 -0
  198. package/presets/opencode/commands/cc-openspec.md +17 -1
  199. package/presets/opencode/commands/cc-scorecard.md +2 -0
  200. package/presets/opencode/commands/cc-security.md +179 -0
  201. package/presets/opencode/commands/cc-spec-mutation.md +190 -0
  202. package/presets/opencode/commands/cc-tdd-cycle.md +14 -0
  203. package/presets/opencode/gates/pre-commit/GATE.md +5 -4
  204. package/presets/opencode/opencode.jsonc +1 -1
  205. package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
  206. package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
  207. package/presets/opencode/prompts/v1.0.0/reviewer.md +6 -0
  208. package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
  209. package/presets/opencode/skills/backlog/SKILL.md +61 -0
  210. package/presets/opencode/skills/evaluation/SKILL.md +61 -2
  211. package/presets/opencode/skills/openspec/SKILL.md +47 -31
  212. package/presets/opencode/skills/security-ai-llm/SKILL.md +43 -0
  213. package/presets/opencode/skills/security-blue-team/SKILL.md +43 -0
  214. package/presets/opencode/skills/security-cloud/SKILL.md +43 -0
  215. package/presets/opencode/skills/security-crypto/SKILL.md +43 -0
  216. package/presets/opencode/skills/security-exploit-dev/SKILL.md +45 -0
  217. package/presets/opencode/skills/security-grc/SKILL.md +43 -0
  218. package/presets/opencode/skills/security-incident-response/SKILL.md +45 -0
  219. package/presets/opencode/skills/security-log-analysis/SKILL.md +43 -0
  220. package/presets/opencode/skills/security-malware-analysis/SKILL.md +44 -0
  221. package/presets/opencode/skills/security-mobile/SKILL.md +43 -0
  222. package/presets/opencode/skills/security-network/SKILL.md +43 -0
  223. package/presets/opencode/skills/security-ot-ics/SKILL.md +43 -0
  224. package/presets/opencode/skills/security-recon/SKILL.md +45 -0
  225. package/presets/opencode/skills/security-red-team/SKILL.md +44 -0
  226. package/presets/opencode/skills/security-reverse-engineering/SKILL.md +44 -0
  227. package/presets/opencode/skills/security-soc-automation/SKILL.md +43 -0
  228. package/presets/opencode/skills/security-threat-hunting/SKILL.md +43 -0
  229. package/presets/opencode/skills/security-vuln-assessment/SKILL.md +45 -0
  230. package/presets/opencode/skills/security-web/SKILL.md +44 -0
  231. package/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
  232. package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
  233. package/presets/shared/__pycache__/mutation_runner.cpython-314.pyc +0 -0
  234. package/presets/shared/invoke-hook.cjs +115 -0
  235. package/presets/shared/mutation_runner.py +273 -0
  236. package/src/presets/council/council.yml +12 -0
  237. package/src/presets/manifests/agy.yml +2 -0
  238. package/src/presets/manifests/claude.yml +3 -0
  239. package/src/presets/manifests/gemini.yml +15 -0
  240. package/src/presets/models/agy.yml +24 -24
  241. package/src/presets/models/claude.yml +10 -10
  242. package/src/presets/models/codex.yml +10 -10
  243. package/src/presets/models/cursor.yml +10 -10
  244. package/src/presets/models/gemini.yml +10 -10
  245. package/src/presets/models/opencode.yml +10 -10
  246. package/presets/agy/scripts/post-tool.sh +0 -25
  247. package/presets/agy/scripts/pre-tool.sh +0 -56
@@ -0,0 +1,191 @@
1
+ ---
2
+ name: cc-openspec
3
+ description: 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: CodeConductor prototype workflow
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,163 @@
1
+ ---
2
+ name: cc-refactor
3
+ description: 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
+ Invoke the `architect` subagent via the Task tool. 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
+ Invoke the `implementer` subagent via the Task tool. 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
+ Invoke the `reviewer` subagent via the Task tool. 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.
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: cc-review
3
+ description: 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
+ Invoke the `reviewer` subagent via the Task tool.
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.