cc-codeconductor 1.1.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 (143) hide show
  1. package/README.md +4 -2
  2. package/dist/core/verification/verification-runner.d.ts +7 -0
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1413 -309
  5. package/dist/library.js +29 -1
  6. package/dist/validation/schemas.d.ts +97 -26
  7. package/package.json +1 -1
  8. package/presets/agy/AGENTS.md +10 -9
  9. package/presets/agy/hooks.json +2 -2
  10. package/presets/agy/scripts/invoke-hook.cjs +115 -0
  11. package/presets/agy/skills/backlog/SKILL.md +40 -70
  12. package/presets/agy/skills/cc-spec-mutation/SKILL.md +165 -0
  13. package/presets/agy/skills/cc-tdd-cycle/SKILL.md +3 -0
  14. package/presets/agy/skills/evaluation/SKILL.md +61 -2
  15. package/presets/agy/skills/openspec/SKILL.md +49 -19
  16. package/presets/agy/skills/testing-tdd/SKILL.md +53 -0
  17. package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
  18. package/presets/agy/workflows/cc-api-contract.md +14 -0
  19. package/presets/agy/workflows/cc-db-migration.md +14 -0
  20. package/presets/agy/workflows/cc-feature.md +18 -0
  21. package/presets/agy/workflows/cc-fix.md +14 -0
  22. package/presets/agy/workflows/cc-iterative.md +14 -0
  23. package/presets/agy/workflows/cc-openspec.md +14 -0
  24. package/presets/agy/workflows/cc-scorecard.md +2 -0
  25. package/presets/agy/workflows/cc-spec-mutation.md +191 -0
  26. package/presets/agy/workflows/cc-tdd-cycle.md +14 -0
  27. package/presets/claude/commands/cc/api-contract.md +14 -0
  28. package/presets/claude/commands/cc/db-migration.md +14 -0
  29. package/presets/claude/commands/cc/feature.md +18 -0
  30. package/presets/claude/commands/cc/fix.md +17 -0
  31. package/presets/claude/commands/cc/iterative.md +14 -0
  32. package/presets/claude/commands/cc/openspec.md +14 -0
  33. package/presets/claude/commands/cc/review.md +3 -0
  34. package/presets/claude/commands/cc/scorecard.md +2 -0
  35. package/presets/claude/commands/cc/spec-mutation.md +190 -0
  36. package/presets/claude/commands/cc/tdd-cycle.md +17 -0
  37. package/presets/claude/settings.json +13 -11
  38. package/presets/claude/skills/backlog/SKILL.md +40 -70
  39. package/presets/claude/skills/evaluation/SKILL.md +47 -24
  40. package/presets/claude/skills/openspec/SKILL.md +46 -38
  41. package/presets/claude/skills/testing-tdd/SKILL.md +53 -0
  42. package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
  43. package/presets/codex/AGENTS.md +16 -12
  44. package/presets/codex/skills/backlog/SKILL.md +61 -0
  45. package/presets/codex/skills/cc-api-contract/SKILL.md +87 -0
  46. package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
  47. package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
  48. package/presets/codex/skills/cc-council/SKILL.md +92 -0
  49. package/presets/codex/skills/cc-db-migration/SKILL.md +88 -0
  50. package/presets/codex/skills/cc-explore/SKILL.md +40 -0
  51. package/presets/codex/skills/cc-feature/SKILL.md +154 -0
  52. package/presets/codex/skills/cc-fix/SKILL.md +165 -0
  53. package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
  54. package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
  55. package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
  56. package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
  57. package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
  58. package/presets/codex/skills/cc-refactor/SKILL.md +163 -0
  59. package/presets/codex/skills/cc-review/SKILL.md +152 -0
  60. package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
  61. package/presets/codex/skills/cc-security/SKILL.md +182 -0
  62. package/presets/codex/skills/cc-spec-mutation/SKILL.md +192 -0
  63. package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
  64. package/presets/codex/skills/cc-test-plan/SKILL.md +153 -0
  65. package/presets/codex/skills/cc-triage/SKILL.md +38 -0
  66. package/presets/codex/skills/evaluation/SKILL.md +65 -0
  67. package/presets/codex/skills/openspec/SKILL.md +66 -0
  68. package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
  69. package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
  70. package/presets/cursor/commands/cc/api-contract.md +14 -0
  71. package/presets/cursor/commands/cc/db-migration.md +14 -0
  72. package/presets/cursor/commands/cc/feature.md +18 -0
  73. package/presets/cursor/commands/cc/fix.md +17 -0
  74. package/presets/cursor/commands/cc/iterative.md +14 -0
  75. package/presets/cursor/commands/cc/openspec.md +14 -0
  76. package/presets/cursor/commands/cc/scorecard.md +2 -0
  77. package/presets/cursor/commands/cc/spec-mutation.md +190 -0
  78. package/presets/cursor/commands/cc/tdd-cycle.md +14 -0
  79. package/presets/cursor/skills/backlog/SKILL.md +40 -70
  80. package/presets/cursor/skills/evaluation/SKILL.md +61 -4
  81. package/presets/cursor/skills/openspec/SKILL.md +46 -36
  82. package/presets/cursor/skills/testing-tdd/SKILL.md +35 -574
  83. package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
  84. package/presets/gemini/commands/cc/api-contract.toml +82 -0
  85. package/presets/gemini/commands/cc/ask.toml +54 -0
  86. package/presets/gemini/commands/cc/backlog.toml +103 -0
  87. package/presets/gemini/commands/cc/clarify.toml +31 -0
  88. package/presets/gemini/commands/cc/council.toml +87 -0
  89. package/presets/gemini/commands/cc/db-migration.toml +83 -0
  90. package/presets/gemini/commands/cc/explore.toml +35 -0
  91. package/presets/gemini/commands/cc/feature.toml +153 -0
  92. package/presets/gemini/commands/cc/fix.toml +163 -0
  93. package/presets/gemini/commands/cc/handoff.toml +40 -0
  94. package/presets/gemini/commands/cc/iterative.toml +145 -0
  95. package/presets/gemini/commands/cc/openspec.toml +186 -0
  96. package/presets/gemini/commands/cc/pagespeed.toml +119 -0
  97. package/presets/gemini/commands/cc/prototype.toml +37 -0
  98. package/presets/gemini/commands/cc/refactor.toml +158 -0
  99. package/presets/gemini/commands/cc/review.toml +150 -0
  100. package/presets/gemini/commands/cc/scorecard.toml +77 -0
  101. package/presets/gemini/commands/cc/security.toml +177 -0
  102. package/presets/gemini/commands/cc/spec-mutation.toml +187 -0
  103. package/presets/gemini/commands/cc/tdd-cycle.toml +264 -0
  104. package/presets/gemini/commands/cc/test-plan.toml +148 -0
  105. package/presets/gemini/commands/cc/triage.toml +33 -0
  106. package/presets/opencode/README.md +24 -21
  107. package/presets/opencode/agents/architect.md +6 -0
  108. package/presets/opencode/agents/implementer.md +7 -0
  109. package/presets/opencode/agents/reviewer.md +6 -0
  110. package/presets/opencode/agents/tester.md +6 -0
  111. package/presets/opencode/commands/cc-api-contract.md +14 -0
  112. package/presets/opencode/commands/cc-db-migration.md +14 -0
  113. package/presets/opencode/commands/cc-feature.md +18 -0
  114. package/presets/opencode/commands/cc-fix.md +17 -0
  115. package/presets/opencode/commands/cc-iterative.md +14 -0
  116. package/presets/opencode/commands/cc-openspec.md +14 -0
  117. package/presets/opencode/commands/cc-scorecard.md +2 -0
  118. package/presets/opencode/commands/cc-spec-mutation.md +190 -0
  119. package/presets/opencode/commands/cc-tdd-cycle.md +14 -0
  120. package/presets/opencode/opencode.jsonc +1 -1
  121. package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
  122. package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
  123. package/presets/opencode/prompts/v1.0.0/reviewer.md +6 -0
  124. package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
  125. package/presets/opencode/skills/backlog/SKILL.md +40 -70
  126. package/presets/opencode/skills/evaluation/SKILL.md +61 -2
  127. package/presets/opencode/skills/openspec/SKILL.md +46 -34
  128. package/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
  129. package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
  130. package/presets/shared/__pycache__/mutation_runner.cpython-314.pyc +0 -0
  131. package/presets/shared/invoke-hook.cjs +115 -0
  132. package/presets/shared/mutation_runner.py +273 -0
  133. package/src/presets/manifests/agy.yml +2 -0
  134. package/src/presets/manifests/claude.yml +3 -0
  135. package/src/presets/manifests/gemini.yml +15 -0
  136. package/src/presets/models/agy.yml +24 -24
  137. package/src/presets/models/claude.yml +10 -10
  138. package/src/presets/models/codex.yml +10 -10
  139. package/src/presets/models/cursor.yml +10 -10
  140. package/src/presets/models/gemini.yml +10 -10
  141. package/src/presets/models/opencode.yml +10 -10
  142. package/presets/agy/scripts/post-tool.sh +0 -25
  143. package/presets/agy/scripts/pre-tool.sh +0 -56
@@ -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.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: cc-scorecard
3
+ description: 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,182 @@
1
+ ---
2
+ name: cc-security
3
+ description: 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.