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.
- package/README.md +326 -87
- package/dist/core/compilation/compile-checker.d.ts +2 -0
- package/dist/core/loop/loop-engine.d.ts +3 -0
- package/dist/core/verification/verification-runner.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3825 -597
- package/dist/library.js +195 -18
- package/dist/validation/schemas.d.ts +461 -44
- package/package.json +4 -1
- package/presets/agy/AGENTS.md +13 -9
- package/presets/agy/gates/pre-commit/GATE.md +5 -4
- package/presets/agy/hooks.json +2 -2
- package/presets/agy/scripts/invoke-hook.cjs +115 -0
- package/presets/agy/skills/backlog/SKILL.md +61 -0
- package/presets/agy/skills/cc-spec-mutation/SKILL.md +165 -0
- package/presets/agy/skills/cc-tdd-cycle/SKILL.md +3 -0
- package/presets/agy/skills/evaluation/SKILL.md +61 -2
- package/presets/agy/skills/openspec/SKILL.md +50 -16
- package/presets/agy/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/agy/skills/security-blue-team/SKILL.md +43 -0
- package/presets/agy/skills/security-cloud/SKILL.md +43 -0
- package/presets/agy/skills/security-crypto/SKILL.md +43 -0
- package/presets/agy/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/agy/skills/security-grc/SKILL.md +43 -0
- package/presets/agy/skills/security-incident-response/SKILL.md +45 -0
- package/presets/agy/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/agy/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/agy/skills/security-mobile/SKILL.md +43 -0
- package/presets/agy/skills/security-network/SKILL.md +43 -0
- package/presets/agy/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/agy/skills/security-recon/SKILL.md +45 -0
- package/presets/agy/skills/security-red-team/SKILL.md +44 -0
- package/presets/agy/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/agy/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/agy/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/agy/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/agy/skills/security-web/SKILL.md +44 -0
- package/presets/agy/skills/testing-tdd/SKILL.md +53 -0
- package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/agy/workflows/cc-api-contract.md +14 -0
- package/presets/agy/workflows/cc-ask.md +2 -1
- package/presets/agy/workflows/cc-backlog.md +69 -0
- package/presets/agy/workflows/cc-db-migration.md +14 -0
- package/presets/agy/workflows/cc-explore.md +1 -1
- package/presets/agy/workflows/cc-feature.md +18 -0
- package/presets/agy/workflows/cc-fix.md +14 -0
- package/presets/agy/workflows/cc-iterative.md +14 -0
- package/presets/agy/workflows/cc-openspec.md +17 -1
- package/presets/agy/workflows/cc-scorecard.md +2 -0
- package/presets/agy/workflows/cc-security.md +180 -0
- package/presets/agy/workflows/cc-spec-mutation.md +191 -0
- package/presets/agy/workflows/cc-tdd-cycle.md +14 -0
- package/presets/claude/CLAUDE.md +4 -0
- package/presets/claude/commands/cc/api-contract.md +14 -0
- package/presets/claude/commands/cc/ask.md +2 -1
- package/presets/claude/commands/cc/backlog.md +104 -0
- package/presets/claude/commands/cc/db-migration.md +14 -0
- package/presets/claude/commands/cc/explore.md +1 -1
- package/presets/claude/commands/cc/feature.md +18 -0
- package/presets/claude/commands/cc/fix.md +17 -0
- package/presets/claude/commands/cc/iterative.md +14 -0
- package/presets/claude/commands/cc/openspec.md +30 -1
- package/presets/claude/commands/cc/review.md +3 -0
- package/presets/claude/commands/cc/scorecard.md +2 -0
- package/presets/claude/commands/cc/security.md +179 -0
- package/presets/claude/commands/cc/spec-mutation.md +190 -0
- package/presets/claude/commands/cc/tdd-cycle.md +17 -0
- package/presets/claude/gates/pre-commit/GATE.md +5 -4
- package/presets/claude/settings.json +13 -11
- package/presets/claude/skills/backlog/SKILL.md +61 -0
- package/presets/claude/skills/evaluation/SKILL.md +47 -24
- package/presets/claude/skills/openspec/SKILL.md +46 -34
- package/presets/claude/skills/security/SKILL.md +382 -0
- package/presets/claude/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/claude/skills/security-blue-team/SKILL.md +43 -0
- package/presets/claude/skills/security-cloud/SKILL.md +43 -0
- package/presets/claude/skills/security-crypto/SKILL.md +43 -0
- package/presets/claude/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/claude/skills/security-grc/SKILL.md +43 -0
- package/presets/claude/skills/security-incident-response/SKILL.md +45 -0
- package/presets/claude/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/claude/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/claude/skills/security-mobile/SKILL.md +43 -0
- package/presets/claude/skills/security-network/SKILL.md +43 -0
- package/presets/claude/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/claude/skills/security-recon/SKILL.md +45 -0
- package/presets/claude/skills/security-red-team/SKILL.md +44 -0
- package/presets/claude/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/claude/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/claude/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/claude/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/claude/skills/security-web/SKILL.md +44 -0
- package/presets/claude/skills/testing-tdd/SKILL.md +53 -0
- package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/codex/AGENTS.md +16 -12
- package/presets/codex/commands/cc-ask.md +2 -1
- package/presets/codex/gates/pre-commit/GATE.md +5 -4
- package/presets/codex/skills/backlog/SKILL.md +61 -0
- package/presets/codex/skills/cc-api-contract/SKILL.md +87 -0
- package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
- package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
- package/presets/codex/skills/cc-council/SKILL.md +92 -0
- package/presets/codex/skills/cc-db-migration/SKILL.md +88 -0
- package/presets/codex/skills/cc-explore/SKILL.md +40 -0
- package/presets/codex/skills/cc-feature/SKILL.md +154 -0
- package/presets/codex/skills/cc-fix/SKILL.md +165 -0
- package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
- package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
- package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
- package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
- package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
- package/presets/codex/skills/cc-refactor/SKILL.md +163 -0
- package/presets/codex/skills/cc-review/SKILL.md +152 -0
- package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
- package/presets/codex/skills/cc-security/SKILL.md +182 -0
- package/presets/codex/skills/cc-spec-mutation/SKILL.md +192 -0
- package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
- package/presets/codex/skills/cc-test-plan/SKILL.md +153 -0
- package/presets/codex/skills/cc-triage/SKILL.md +38 -0
- package/presets/codex/skills/evaluation/SKILL.md +65 -0
- package/presets/codex/skills/openspec/SKILL.md +66 -0
- package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
- package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/cursor/AGENTS.md +2 -2
- package/presets/cursor/commands/cc/api-contract.md +14 -0
- package/presets/cursor/commands/cc/ask.md +2 -1
- package/presets/cursor/commands/cc/backlog.md +105 -0
- package/presets/cursor/commands/cc/db-migration.md +14 -0
- package/presets/cursor/commands/cc/explore.md +1 -1
- package/presets/cursor/commands/cc/feature.md +18 -0
- package/presets/cursor/commands/cc/fix.md +17 -0
- package/presets/cursor/commands/cc/iterative.md +14 -0
- package/presets/cursor/commands/cc/openspec.md +30 -1
- package/presets/cursor/commands/cc/scorecard.md +2 -0
- package/presets/cursor/commands/cc/security.md +179 -0
- package/presets/cursor/commands/cc/spec-mutation.md +190 -0
- package/presets/cursor/commands/cc/tdd-cycle.md +14 -0
- package/presets/cursor/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/skills/backlog/SKILL.md +61 -0
- package/presets/cursor/skills/evaluation/SKILL.md +61 -4
- package/presets/cursor/skills/openspec/SKILL.md +47 -33
- package/presets/cursor/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/cursor/skills/security-blue-team/SKILL.md +43 -0
- package/presets/cursor/skills/security-cloud/SKILL.md +43 -0
- package/presets/cursor/skills/security-crypto/SKILL.md +43 -0
- package/presets/cursor/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/cursor/skills/security-grc/SKILL.md +43 -0
- package/presets/cursor/skills/security-incident-response/SKILL.md +45 -0
- package/presets/cursor/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/cursor/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/cursor/skills/security-mobile/SKILL.md +43 -0
- package/presets/cursor/skills/security-network/SKILL.md +43 -0
- package/presets/cursor/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/cursor/skills/security-recon/SKILL.md +45 -0
- package/presets/cursor/skills/security-red-team/SKILL.md +44 -0
- package/presets/cursor/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/cursor/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/cursor/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/cursor/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/cursor/skills/security-web/SKILL.md +44 -0
- package/presets/cursor/skills/testing-tdd/SKILL.md +35 -574
- package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/gemini/commands/cc/api-contract.toml +82 -0
- package/presets/gemini/commands/cc/ask.toml +54 -0
- package/presets/gemini/commands/cc/backlog.toml +103 -0
- package/presets/gemini/commands/cc/clarify.toml +31 -0
- package/presets/gemini/commands/cc/council.toml +87 -0
- package/presets/gemini/commands/cc/db-migration.toml +83 -0
- package/presets/gemini/commands/cc/explore.toml +35 -0
- package/presets/gemini/commands/cc/feature.toml +153 -0
- package/presets/gemini/commands/cc/fix.toml +163 -0
- package/presets/gemini/commands/cc/handoff.toml +40 -0
- package/presets/gemini/commands/cc/iterative.toml +145 -0
- package/presets/gemini/commands/cc/openspec.toml +186 -0
- package/presets/gemini/commands/cc/pagespeed.toml +119 -0
- package/presets/gemini/commands/cc/prototype.toml +37 -0
- package/presets/gemini/commands/cc/refactor.toml +158 -0
- package/presets/gemini/commands/cc/review.toml +150 -0
- package/presets/gemini/commands/cc/scorecard.toml +77 -0
- package/presets/gemini/commands/cc/security.toml +177 -0
- package/presets/gemini/commands/cc/spec-mutation.toml +187 -0
- package/presets/gemini/commands/cc/tdd-cycle.toml +264 -0
- package/presets/gemini/commands/cc/test-plan.toml +148 -0
- package/presets/gemini/commands/cc/triage.toml +33 -0
- package/presets/opencode/README.md +24 -21
- package/presets/opencode/agents/architect.md +6 -0
- package/presets/opencode/agents/implementer.md +7 -0
- package/presets/opencode/agents/reviewer.md +6 -0
- package/presets/opencode/agents/tester.md +6 -0
- package/presets/opencode/commands/cc-api-contract.md +14 -0
- package/presets/opencode/commands/cc-ask.md +2 -1
- package/presets/opencode/commands/cc-backlog.md +68 -0
- package/presets/opencode/commands/cc-db-migration.md +14 -0
- package/presets/opencode/commands/cc-explore.md +1 -1
- package/presets/opencode/commands/cc-feature.md +18 -0
- package/presets/opencode/commands/cc-fix.md +17 -0
- package/presets/opencode/commands/cc-iterative.md +14 -0
- package/presets/opencode/commands/cc-openspec.md +17 -1
- package/presets/opencode/commands/cc-scorecard.md +2 -0
- package/presets/opencode/commands/cc-security.md +179 -0
- package/presets/opencode/commands/cc-spec-mutation.md +190 -0
- package/presets/opencode/commands/cc-tdd-cycle.md +14 -0
- package/presets/opencode/gates/pre-commit/GATE.md +5 -4
- package/presets/opencode/opencode.jsonc +1 -1
- package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
- package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
- package/presets/opencode/prompts/v1.0.0/reviewer.md +6 -0
- package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
- package/presets/opencode/skills/backlog/SKILL.md +61 -0
- package/presets/opencode/skills/evaluation/SKILL.md +61 -2
- package/presets/opencode/skills/openspec/SKILL.md +47 -31
- package/presets/opencode/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/opencode/skills/security-blue-team/SKILL.md +43 -0
- package/presets/opencode/skills/security-cloud/SKILL.md +43 -0
- package/presets/opencode/skills/security-crypto/SKILL.md +43 -0
- package/presets/opencode/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/opencode/skills/security-grc/SKILL.md +43 -0
- package/presets/opencode/skills/security-incident-response/SKILL.md +45 -0
- package/presets/opencode/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/opencode/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/opencode/skills/security-mobile/SKILL.md +43 -0
- package/presets/opencode/skills/security-network/SKILL.md +43 -0
- package/presets/opencode/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/opencode/skills/security-recon/SKILL.md +45 -0
- package/presets/opencode/skills/security-red-team/SKILL.md +44 -0
- package/presets/opencode/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/opencode/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/opencode/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/opencode/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/opencode/skills/security-web/SKILL.md +44 -0
- package/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
- package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/shared/__pycache__/mutation_runner.cpython-314.pyc +0 -0
- package/presets/shared/invoke-hook.cjs +115 -0
- package/presets/shared/mutation_runner.py +273 -0
- package/src/presets/council/council.yml +12 -0
- package/src/presets/manifests/agy.yml +2 -0
- package/src/presets/manifests/claude.yml +3 -0
- package/src/presets/manifests/gemini.yml +15 -0
- package/src/presets/models/agy.yml +24 -24
- package/src/presets/models/claude.yml +10 -10
- package/src/presets/models/codex.yml +10 -10
- package/src/presets/models/cursor.yml +10 -10
- package/src/presets/models/gemini.yml +10 -10
- package/src/presets/models/opencode.yml +10 -10
- package/presets/agy/scripts/post-tool.sh +0 -25
- package/presets/agy/scripts/pre-tool.sh +0 -56
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cc-tdd-cycle
|
|
3
|
+
description: test first, implement the minimum code to pass it, then refactor with the suite green.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# tdd-cycle
|
|
7
|
+
|
|
8
|
+
Invoke as `$cc-tdd-cycle`. The user request follows the skill mention.
|
|
9
|
+
|
|
10
|
+
# TDD Cycle — Red → Green → Refactor
|
|
11
|
+
|
|
12
|
+
Scope: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Describe what behavior you want to implement. Include:
|
|
15
|
+
|
|
16
|
+
- The function, method, or feature to implement
|
|
17
|
+
- The expected behavior (inputs and outputs, or acceptance criteria)
|
|
18
|
+
- Any known constraints or edge cases
|
|
19
|
+
- Relevant files or modules (if known)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Step 0 — CCEP Bootstrap
|
|
24
|
+
|
|
25
|
+
Command: `tdd-cycle` (fixed for this workflow — do not infer from user text)
|
|
26
|
+
|
|
27
|
+
1. Run: `npx cc-codeconductor ccep parse --command tdd-cycle "$ARGUMENTS" --output json`
|
|
28
|
+
2. Run: `npx cc-codeconductor ccep resolve --command tdd-cycle "$ARGUMENTS" --output json`
|
|
29
|
+
3. Run: `npx cc-codeconductor ccep profile tdd-cycle --output json`
|
|
30
|
+
4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command tdd-cycle --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
|
|
31
|
+
5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
|
|
32
|
+
Canonical delivery order is test-before-implement whenever both phases apply.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 0b — OpenSpec quality gates
|
|
37
|
+
|
|
38
|
+
If `openspec status` reports an active change folder:
|
|
39
|
+
|
|
40
|
+
1. Run: `npx cc-codeconductor openspec validate --output json`
|
|
41
|
+
2. Run: `npx cc-codeconductor openspec analyze --output json`
|
|
42
|
+
3. If analyze `stop` is true or any finding is CRITICAL, stop. Do not delegate to implementer.
|
|
43
|
+
4. Next command spelling on this runner: `/cc:tdd-cycle`
|
|
44
|
+
|
|
45
|
+
Local development: `bun run dev <same argv>`. Published package: `npx cc-codeconductor`.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Before you begin — mandatory pre-check
|
|
51
|
+
|
|
52
|
+
This command enforces strict TDD discipline. The three phases are sequential and
|
|
53
|
+
non-negotiable:
|
|
54
|
+
|
|
55
|
+
1. **RED** — a failing test exists before any implementation code is written
|
|
56
|
+
2. **GREEN** — the minimum implementation to make the test pass (no more)
|
|
57
|
+
3. **REFACTOR** — clean up the code while keeping all tests green
|
|
58
|
+
|
|
59
|
+
Do not write implementation code during RED. Do not refactor during GREEN.
|
|
60
|
+
Mixing phases invalidates the cycle.
|
|
61
|
+
|
|
62
|
+
## Verifiable phase gates
|
|
63
|
+
|
|
64
|
+
RED → GREEN and GREEN → REFACTOR are enforced by `tddCycleStateMachine` in
|
|
65
|
+
`domain/loop`. Evidence must be captured with `captureTddSuiteEvidence` (verification
|
|
66
|
+
runner) — do not hand-edit JSON under `.codeconductor/evidence/`.
|
|
67
|
+
|
|
68
|
+
- RED→GREEN requires runner evidence that the suite **failed**.
|
|
69
|
+
- GREEN→REFACTOR requires runner evidence that the suite **passed**.
|
|
70
|
+
|
|
71
|
+
Do not advance phases until that evidence exists.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Phase 1 — RED (Tester role)
|
|
76
|
+
|
|
77
|
+
Invoke the `tester` subagent via the Task tool.
|
|
78
|
+
|
|
79
|
+
### 1a — Scope clarification
|
|
80
|
+
|
|
81
|
+
Before writing any test, confirm:
|
|
82
|
+
|
|
83
|
+
- What is the unit of behavior being tested? (function, method, endpoint, domain
|
|
84
|
+
rule)
|
|
85
|
+
- What are the inputs and expected outputs?
|
|
86
|
+
- What are the failure cases?
|
|
87
|
+
|
|
88
|
+
If the scope is ambiguous, ask one clarifying question and wait for the answer.
|
|
89
|
+
|
|
90
|
+
### 1b — Write the failing test
|
|
91
|
+
|
|
92
|
+
Write a test that:
|
|
93
|
+
|
|
94
|
+
- Targets exactly the behavior described in the scope
|
|
95
|
+
- Fails for the right reason (not a compile error, not a missing dependency —
|
|
96
|
+
the logic does not exist yet)
|
|
97
|
+
- Has a name that describes the behavior: `given_X_when_Y_then_Z` or equivalent
|
|
98
|
+
in the project's test naming convention
|
|
99
|
+
- Covers at minimum: one happy path, one edge case, one failure case
|
|
100
|
+
|
|
101
|
+
Do not write the implementation. Do not make the test pass by any means other
|
|
102
|
+
than the implementation that will follow in Phase 2.
|
|
103
|
+
|
|
104
|
+
### 1c — Run the test suite and confirm RED
|
|
105
|
+
|
|
106
|
+
Run the test suite. The new test must fail. Existing tests must pass.
|
|
107
|
+
|
|
108
|
+
If the new test passes without implementation, the test is wrong. Fix the test
|
|
109
|
+
before continuing.
|
|
110
|
+
|
|
111
|
+
**RED Phase Report:**
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
## RED Phase Report
|
|
115
|
+
|
|
116
|
+
**Test file**: [path/to/test/file]
|
|
117
|
+
**Tests written**:
|
|
118
|
+
- [test name] — [what it verifies]
|
|
119
|
+
|
|
120
|
+
**Suite result**: [X passing, Y failing]
|
|
121
|
+
**New test status**: FAIL ✓
|
|
122
|
+
**Failure reason**: [quoted error or assertion message]
|
|
123
|
+
**Existing tests**: [all passing | N failing — list]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**STOP. Show the RED Phase Report. Do not proceed to GREEN without
|
|
127
|
+
confirmation.**
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Phase 2 — GREEN (Implementer role)
|
|
132
|
+
|
|
133
|
+
Invoke the `implementer` subagent via the Task tool.
|
|
134
|
+
|
|
135
|
+
### 2a — Read the failing test before writing any code
|
|
136
|
+
|
|
137
|
+
Understand exactly what the test asserts. Write only the code that satisfies
|
|
138
|
+
that assertion. Nothing more.
|
|
139
|
+
|
|
140
|
+
### 2b — Implement the minimum
|
|
141
|
+
|
|
142
|
+
Rules for GREEN phase:
|
|
143
|
+
|
|
144
|
+
- Write the smallest amount of code that makes the failing test pass
|
|
145
|
+
- Do not add features not tested
|
|
146
|
+
- Do not clean up or restructure existing code — that is Refactor's job
|
|
147
|
+
- Do not add new tests — that is another RED cycle
|
|
148
|
+
- Hardcoding a return value is acceptable if it makes the test pass (the
|
|
149
|
+
Refactor phase will generalize it)
|
|
150
|
+
|
|
151
|
+
### 2c — Run the test suite and confirm GREEN
|
|
152
|
+
|
|
153
|
+
Run the test suite. The new test must pass. All previously passing tests must
|
|
154
|
+
still pass.
|
|
155
|
+
|
|
156
|
+
If any previously passing test now fails, you introduced a regression. Fix it
|
|
157
|
+
before continuing.
|
|
158
|
+
|
|
159
|
+
**GREEN Phase Report:**
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
## GREEN Phase Report
|
|
163
|
+
|
|
164
|
+
**Files changed**:
|
|
165
|
+
- [path/to/file] — [what was added, one sentence]
|
|
166
|
+
|
|
167
|
+
**Implementation approach**: [one sentence — what the code does]
|
|
168
|
+
**Suite result**: [X passing, Y failing]
|
|
169
|
+
**New test status**: PASS ✓
|
|
170
|
+
**Regressions**: [none | list failing tests]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**STOP. Show the GREEN Phase Report. Do not proceed to REFACTOR without
|
|
174
|
+
confirmation.**
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Phase 3 — REFACTOR (Implementer role, then Reviewer role)
|
|
179
|
+
|
|
180
|
+
Invoke the `implementer` subagent via the Task tool.
|
|
181
|
+
|
|
182
|
+
### 3a — Assess what needs cleaning
|
|
183
|
+
|
|
184
|
+
Before touching any code, identify:
|
|
185
|
+
|
|
186
|
+
- Duplication introduced during GREEN
|
|
187
|
+
- Names that do not clearly express intent
|
|
188
|
+
- Abstractions that belong in a separate function or module
|
|
189
|
+
- Logic that is hardcoded and should be generalized
|
|
190
|
+
|
|
191
|
+
Do not invent improvements. Only address what is directly in the implementation
|
|
192
|
+
written in Phase 2.
|
|
193
|
+
|
|
194
|
+
### 3b — Refactor
|
|
195
|
+
|
|
196
|
+
Rules for REFACTOR phase:
|
|
197
|
+
|
|
198
|
+
- All tests must remain GREEN throughout — run the suite after each change
|
|
199
|
+
- Do not add new behavior
|
|
200
|
+
- Do not add new tests (if you discover untested behavior, note it for a new RED
|
|
201
|
+
cycle)
|
|
202
|
+
- Do not change function signatures unless the original was clearly wrong
|
|
203
|
+
|
|
204
|
+
### 3c — Run the test suite and confirm GREEN after refactor
|
|
205
|
+
|
|
206
|
+
The full suite must pass. If any test fails during refactor, undo the last
|
|
207
|
+
change and investigate.
|
|
208
|
+
|
|
209
|
+
### 3d — Review (Reviewer role)
|
|
210
|
+
|
|
211
|
+
Invoke the `reviewer` subagent via the Task tool.
|
|
212
|
+
|
|
213
|
+
Review only the refactored code against these axes:
|
|
214
|
+
|
|
215
|
+
| Axis | What to check |
|
|
216
|
+
| ------------- | --------------------------------------------------------------- |
|
|
217
|
+
| Scope | Did the refactor change any behavior? |
|
|
218
|
+
| Correctness | Does the logic still satisfy the original test intent? |
|
|
219
|
+
| Architecture | Does the code follow existing project patterns? |
|
|
220
|
+
| Test coverage | Are all written tests still meaningful (not trivially passing)? |
|
|
221
|
+
|
|
222
|
+
Produce a Review Report. CRITICAL findings block completion.
|
|
223
|
+
|
|
224
|
+
**REFACTOR Phase Report:**
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
## REFACTOR Phase Report
|
|
228
|
+
|
|
229
|
+
**Changes made**:
|
|
230
|
+
- [path/to/file] — [what was cleaned up]
|
|
231
|
+
|
|
232
|
+
**Suite result**: [X passing, Y failing]
|
|
233
|
+
**Behavioral changes**: none (refactor only)
|
|
234
|
+
|
|
235
|
+
### Review findings
|
|
236
|
+
**CRITICAL**: (none) | [list]
|
|
237
|
+
**WARNING**: (none) | [list]
|
|
238
|
+
**SUGGESTION**: (none) | [list]
|
|
239
|
+
|
|
240
|
+
**Verdict**: approved | approved with warnings | blocked
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Completion
|
|
246
|
+
|
|
247
|
+
The TDD cycle is complete when:
|
|
248
|
+
|
|
249
|
+
- RED: at least one failing test was written and confirmed failing
|
|
250
|
+
- GREEN: the minimum implementation makes the test pass
|
|
251
|
+
- REFACTOR: the code is clean, all tests pass, no CRITICAL review findings
|
|
252
|
+
|
|
253
|
+
**Final Summary:**
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
## TDD Cycle Summary
|
|
257
|
+
|
|
258
|
+
**Behavior implemented**: [one sentence]
|
|
259
|
+
**Tests written**: [count] — [list test names]
|
|
260
|
+
**Files changed**: [list]
|
|
261
|
+
**Suite result**: [X passing, Y failing]
|
|
262
|
+
**Cycle status**: complete | blocked (reason)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
If the behavior requires additional test cases, start a new `/tdd-cycle` with
|
|
266
|
+
the next scenario. One cycle = one behavior.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cc-test-plan
|
|
3
|
+
description: unit, integration, contract, and edge cases without writing implementation code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# test-plan
|
|
7
|
+
|
|
8
|
+
Invoke as `$cc-test-plan`. The user request follows the skill mention.
|
|
9
|
+
|
|
10
|
+
# Test Plan Workflow
|
|
11
|
+
|
|
12
|
+
Scope: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
Specify what to plan tests for. Examples:
|
|
15
|
+
|
|
16
|
+
- A feature name: `user authentication`
|
|
17
|
+
- A module or file path: `src/orders/OrderService.kt`
|
|
18
|
+
- A Task Card title: `Add paginated product listing endpoint`
|
|
19
|
+
- A PR or branch: `feature/payment-retry`
|
|
20
|
+
|
|
21
|
+
If $ARGUMENTS is empty, describe the scope in your next message before
|
|
22
|
+
proceeding.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Step 0 — CCEP Bootstrap
|
|
27
|
+
|
|
28
|
+
Command: `test-plan` (fixed for this workflow — do not infer from user text)
|
|
29
|
+
|
|
30
|
+
1. Run: `npx cc-codeconductor ccep parse --command test-plan "$ARGUMENTS" --output json`
|
|
31
|
+
2. Run: `npx cc-codeconductor ccep resolve --command test-plan "$ARGUMENTS" --output json`
|
|
32
|
+
3. Run: `npx cc-codeconductor ccep profile test-plan --output json`
|
|
33
|
+
4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command test-plan --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
|
|
34
|
+
5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 1 — Scope confirmation
|
|
39
|
+
|
|
40
|
+
Before generating the test plan, confirm the scope is well-defined.
|
|
41
|
+
|
|
42
|
+
A valid scope includes:
|
|
43
|
+
|
|
44
|
+
- The behavior or module under test
|
|
45
|
+
- The acceptance criteria or expected behavior (from the Task Card if available)
|
|
46
|
+
- Known edge cases or failure modes
|
|
47
|
+
|
|
48
|
+
If the scope is vague (e.g., "test the whole service"), ask one clarifying
|
|
49
|
+
question and wait for the answer.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 2 — Test plan generation (Tester role, planning mode)
|
|
54
|
+
|
|
55
|
+
Invoke the `tester` subagent via the Task tool.
|
|
56
|
+
|
|
57
|
+
Produce a test plan document — not test code. The plan will be used as input
|
|
58
|
+
when tests are actually written.
|
|
59
|
+
|
|
60
|
+
Cover the following layers:
|
|
61
|
+
|
|
62
|
+
**Unit tests**
|
|
63
|
+
|
|
64
|
+
- Individual functions or methods in isolation
|
|
65
|
+
- One test per behavior, not per method
|
|
66
|
+
- Input/output contracts, null handling, type coercion
|
|
67
|
+
|
|
68
|
+
**Integration tests**
|
|
69
|
+
|
|
70
|
+
- Interactions between two or more components
|
|
71
|
+
- Database read/write cycles (if applicable)
|
|
72
|
+
- External service boundaries (mocked or stubbed)
|
|
73
|
+
|
|
74
|
+
**Contract tests**
|
|
75
|
+
|
|
76
|
+
- API endpoint contracts: request shape, response shape, status codes
|
|
77
|
+
- Event schema contracts (if event-driven components are in scope)
|
|
78
|
+
|
|
79
|
+
**Edge cases**
|
|
80
|
+
|
|
81
|
+
- Empty inputs, boundary values, max/min limits
|
|
82
|
+
- Concurrent access (if shared state is involved)
|
|
83
|
+
- Failure paths: what happens when a dependency is unavailable
|
|
84
|
+
|
|
85
|
+
**Regression cases**
|
|
86
|
+
|
|
87
|
+
- Known past bugs that must not recur (include reference if available)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Step 3 — Test Plan format
|
|
92
|
+
|
|
93
|
+
Produce the plan in this format:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
## Test Plan — [Scope Name]
|
|
97
|
+
|
|
98
|
+
### Scope
|
|
99
|
+
[What is being tested and why]
|
|
100
|
+
|
|
101
|
+
### Unit Tests
|
|
102
|
+
| Test ID | Target | Scenario | Expected Result |
|
|
103
|
+
| ------- | ------ | -------- | --------------- |
|
|
104
|
+
| U-001 | ... | ... | ... |
|
|
105
|
+
|
|
106
|
+
### Integration Tests
|
|
107
|
+
| Test ID | Components | Scenario | Expected Result |
|
|
108
|
+
| ------- | ---------- | -------- | --------------- |
|
|
109
|
+
| I-001 | ... | ... | ... |
|
|
110
|
+
|
|
111
|
+
### Contract Tests
|
|
112
|
+
| Test ID | Endpoint/Event | Property | Expected Value |
|
|
113
|
+
| ------- | -------------- | -------- | -------------- |
|
|
114
|
+
| C-001 | ... | ... | ... |
|
|
115
|
+
|
|
116
|
+
### Edge Cases
|
|
117
|
+
| Test ID | Input/Condition | Expected Behavior |
|
|
118
|
+
| ------- | --------------- | ----------------- |
|
|
119
|
+
| E-001 | ... | ... |
|
|
120
|
+
|
|
121
|
+
### Regression Cases
|
|
122
|
+
| Test ID | Reference | Scenario | Must Not Happen |
|
|
123
|
+
| ------- | --------- | -------- | --------------- |
|
|
124
|
+
| R-001 | ... | ... | ... |
|
|
125
|
+
|
|
126
|
+
### Coverage Targets
|
|
127
|
+
- Minimum unit coverage: [% or "all acceptance criteria covered"]
|
|
128
|
+
- Integration scenarios: [count]
|
|
129
|
+
- Contract validations: [count]
|
|
130
|
+
|
|
131
|
+
### Out of Scope
|
|
132
|
+
[What this test plan explicitly does not cover and why]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Step 4 — Human review
|
|
138
|
+
|
|
139
|
+
Show the Test Plan before any tests are written. The Test Plan is an artifact
|
|
140
|
+
for review and approval.
|
|
141
|
+
|
|
142
|
+
Writing test code is a separate action — run `/feature` or add a test task to
|
|
143
|
+
implement from this plan.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Completion
|
|
148
|
+
|
|
149
|
+
Deliver the complete Test Plan document. Save it as
|
|
150
|
+
`docs/test-plans/[scope-slug].md` if requested.
|
|
151
|
+
|
|
152
|
+
This command produces a plan, not test files. No production code and no test
|
|
153
|
+
code is written during this command.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cc-triage
|
|
3
|
+
description: CodeConductor triage workflow
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# triage
|
|
7
|
+
|
|
8
|
+
Invoke as `$cc-triage`. The user request follows the skill mention.
|
|
9
|
+
|
|
10
|
+
# Triage Workflow
|
|
11
|
+
|
|
12
|
+
Triage request: $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
## Step 0 — CCEP Bootstrap
|
|
15
|
+
|
|
16
|
+
Command: `triage` (fixed for this workflow — do not infer from user text)
|
|
17
|
+
|
|
18
|
+
1. Run: `npx cc-codeconductor ccep parse --command triage "$ARGUMENTS" --output json`
|
|
19
|
+
2. Run: `npx cc-codeconductor ccep resolve --command triage "$ARGUMENTS" --output json`
|
|
20
|
+
3. Run: `npx cc-codeconductor ccep profile triage --output json`
|
|
21
|
+
4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command triage --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 — Classify (task-coach)
|
|
27
|
+
|
|
28
|
+
Invoke `task-coach`. Produce: title, type (`feature` | `fix` | `refactor` | `review` | `docs` | `test`), risk, named scope, and the destination command (`feature`, `fix`, `refactor`, `review`, `explore`, …).
|
|
29
|
+
|
|
30
|
+
Ask one question per unresolved branch. If the human is unavailable, emit a Markdown questionnaire and stop at ConfirmationGate.
|
|
31
|
+
|
|
32
|
+
**STOP here. Show the classification and wait for confirmation before running the destination workflow.**
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Completion
|
|
37
|
+
|
|
38
|
+
Do not implement. Hand the human a destination slash command and a partial Task Card.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: evaluation
|
|
3
|
+
description:
|
|
4
|
+
Guides agents through scorecards, outcomes, model profiles, and eval suites.
|
|
5
|
+
Use when running /cc-scorecard or /cc:scorecard, measuring a deliverable, or
|
|
6
|
+
checking workflow gates with suite-run.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Evaluation
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
A scorecard measures the deliverable against eight weighted criteria. Spec
|
|
14
|
+
quality checklists are reviewer-owned. "Seems right" is not a verdict.
|
|
15
|
+
|
|
16
|
+
Pass threshold: weighted score >= 2.0 and no criterion at 0.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- After implement/review, before `openspec archive`
|
|
21
|
+
- Comparing models or prompt versions
|
|
22
|
+
- Proving the workflow tools still work (`suite-run`)
|
|
23
|
+
|
|
24
|
+
**NOT** for rewriting specs (reviewer checklist) or for implementing code.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
Local: `bun run dev`. Published: `npx cc-codeconductor`.
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
scorecard create --task BC-001 --from-diff
|
|
32
|
+
scorecard record --task BC-001 --verdict PASS --score 2.5
|
|
33
|
+
scorecard list | aggregate | models | regression | matrix | compare-models
|
|
34
|
+
scorecard prompt-diff 0.4.0 0.5.0 --agent architect
|
|
35
|
+
scorecard experiment start --suite harness-v1
|
|
36
|
+
scorecard suite-run --suite workflow-gates
|
|
37
|
+
scorecard suite-run --suite hook-guardrails
|
|
38
|
+
scorecard suite-run --suite scorecard-signals
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`openspec analyze` can auto-suggest `acceptance` / `tests` on `--from-diff`.
|
|
42
|
+
Archive needs PASS when review is required.
|
|
43
|
+
|
|
44
|
+
Outcomes append to `.codeconductor/evaluation/outcomes.jsonl`.
|
|
45
|
+
|
|
46
|
+
## Common Rationalizations
|
|
47
|
+
|
|
48
|
+
| Rationalization | Reality |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| I'll fill the scorecard by hand without a diff | Use `--from-diff` and runner evidence. |
|
|
51
|
+
| Suites are optional toys | `suite-run` is the workflow tool that proves gates. |
|
|
52
|
+
| Handmade TDD JSON is fine | The runner rejects it. |
|
|
53
|
+
|
|
54
|
+
## Red Flags
|
|
55
|
+
|
|
56
|
+
- PASS with a criterion at 0
|
|
57
|
+
- Archive without a recorded scorecard when review is required
|
|
58
|
+
- Declaring the workflow ready without `suite-run` or `scorecard record`
|
|
59
|
+
|
|
60
|
+
## Verification
|
|
61
|
+
|
|
62
|
+
- [ ] Scorecard created from diff (or explicit scores)
|
|
63
|
+
- [ ] Verdict PASS / REVISE / REJECT recorded
|
|
64
|
+
- [ ] For process changes: `scorecard suite-run --suite hook-guardrails` (and
|
|
65
|
+
`workflow-gates` / `scorecard-signals` when those gates changed)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec
|
|
3
|
+
description:
|
|
4
|
+
Guides agents through OpenSpec delivery from BACKLOG.md (validate, analyze,
|
|
5
|
+
test-before-implement, scorecard, archive). Use when running /cc-openspec,
|
|
6
|
+
/cc:openspec, or delivering an existing backlog item. Authoring BACKLOG.md
|
|
7
|
+
is skill backlog, not this skill.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# OpenSpec delivery
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
This skill delivers an existing `BACKLOG.md` item. It is a workflow with CLI
|
|
15
|
+
gates, not a reference doc. Specs describe WHAT; `design.md` describes HOW.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- `/cc-openspec` or `openspec next` / `plan` / `done` / `archive`
|
|
20
|
+
- An item is `READY` or later and must move through the state machine
|
|
21
|
+
|
|
22
|
+
**NOT** for creating `BACKLOG.md` (use skill `backlog`) or for stack-specific
|
|
23
|
+
coding rules.
|
|
24
|
+
|
|
25
|
+
## Process
|
|
26
|
+
|
|
27
|
+
Local CLI is `bun run dev`. Published package is `npx cc-codeconductor`.
|
|
28
|
+
|
|
29
|
+
1. `openspec validate` — must pass before delivery.
|
|
30
|
+
2. `openspec plan BC-xxx` if the item is not yet `PLANNED`.
|
|
31
|
+
3. `openspec analyze --output json` — CRITICAL findings exit 1. Do not implement.
|
|
32
|
+
4. Phases: discover (`repo-explorer`) → design (`architect`) → test (`tester`) →
|
|
33
|
+
implement (`implementer`) → review (`reviewer`). If Global `TDD required: yes`,
|
|
34
|
+
test runs before implement.
|
|
35
|
+
5. `openspec done` on test/implement requires `captureTddSuiteEvidence`. Handmade
|
|
36
|
+
evidence JSON is rejected.
|
|
37
|
+
6. `scorecard create --task BC-xxx --from-diff` then record a verdict.
|
|
38
|
+
7. `openspec archive` only after human review when `Review required: yes` and
|
|
39
|
+
the scorecard is PASS.
|
|
40
|
+
|
|
41
|
+
Status machine: `TODO` → `READY` → `PLANNED` → `IN_PROGRESS` → `REVIEW` → `DONE`
|
|
42
|
+
→ Archive. `BLOCKED` returns to `READY`. Reviewer rejection: `REVIEW` →
|
|
43
|
+
`IN_PROGRESS`.
|
|
44
|
+
|
|
45
|
+
## Common Rationalizations
|
|
46
|
+
|
|
47
|
+
| Rationalization | Reality |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Validate is bureaucracy | `openspec validate` is the gate. Skipping it is a defect. |
|
|
50
|
+
| I'll add tests after green | Global TDD required means tester before implementer. |
|
|
51
|
+
| I'll write the evidence JSON myself | Handmade TDD JSON is rejected. Use the verification runner. |
|
|
52
|
+
| The item is small; skip analyze | `openspec analyze` CRITICAL still stops implement. |
|
|
53
|
+
|
|
54
|
+
## Red Flags
|
|
55
|
+
|
|
56
|
+
- Implementing while analyze reports CRITICAL
|
|
57
|
+
- Archive without a PASS scorecard when review is required
|
|
58
|
+
- Acceptance like "improve UX" with no measurable check
|
|
59
|
+
|
|
60
|
+
## Verification
|
|
61
|
+
|
|
62
|
+
- [ ] `openspec validate` exit 0
|
|
63
|
+
- [ ] `openspec analyze --output json` has no CRITICAL
|
|
64
|
+
- [ ] TDD evidence from the runner when TDD is required
|
|
65
|
+
- [ ] `scorecard create --from-diff` recorded
|
|
66
|
+
- [ ] Suite check (optional): `bun run dev scorecard suite-run --suite workflow-gates`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing-tdd
|
|
3
|
+
description:
|
|
4
|
+
Guides agents through Red-Green-Refactor with runner-captured evidence.
|
|
5
|
+
Use when running /cc-tdd-cycle, writing tests before implementation, or
|
|
6
|
+
Global TDD required is yes.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Test-Driven Development
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Red (failing test) → Green (minimal code) → Refactor. Evidence comes from
|
|
14
|
+
`captureTddSuiteEvidence`, not handmade JSON.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- `/cc-tdd-cycle`, new behavior, bug fixes, TDD-required OpenSpec items
|
|
19
|
+
|
|
20
|
+
**NOT** for docs-only changes or when the Task Card forbids tests.
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
1. Write the failing test that encodes one acceptance criterion. Run the suite.
|
|
25
|
+
It MUST fail (`suiteFails === true`).
|
|
26
|
+
2. Implement the minimum that turns it green. Do not expand scope.
|
|
27
|
+
3. Refactor only with a green suite.
|
|
28
|
+
4. Capture evidence via the verification runner (`openspec done` on test/implement
|
|
29
|
+
when TDD is required).
|
|
30
|
+
5. Cover happy path, edge, and error for each behavior.
|
|
31
|
+
|
|
32
|
+
Local: `bun run dev`. Pyramid default: many unit, fewer integration, rare E2E.
|
|
33
|
+
|
|
34
|
+
## Common Rationalizations
|
|
35
|
+
|
|
36
|
+
| Rationalization | Reality |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| I'll add tests later | Later means never. Red first. |
|
|
39
|
+
| This is too small to test | If it can break, it needs a failing test first. |
|
|
40
|
+
| I'll write the evidence JSON | Handmade TDD JSON is rejected. |
|
|
41
|
+
|
|
42
|
+
## Red Flags
|
|
43
|
+
|
|
44
|
+
- Tests that assert implementation details instead of behavior
|
|
45
|
+
- Green without a recorded red
|
|
46
|
+
- Skipping error cases
|
|
47
|
+
|
|
48
|
+
## Verification
|
|
49
|
+
|
|
50
|
+
- [ ] Suite failed before implement
|
|
51
|
+
- [ ] Suite passed after implement
|
|
52
|
+
- [ ] Runner evidence exists (not handmade)
|
|
53
|
+
- [ ] Optional: `bun run dev scorecard suite-run --suite workflow-gates`
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-cc-skills
|
|
3
|
+
description:
|
|
4
|
+
Maps incoming work to the CodeConductor slash command and workflow skill.
|
|
5
|
+
Use when starting a session or deciding which /cc-* command applies.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Using CodeConductor skills
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Pick one slash command. Follow its skill. Invoke CLI for gates. Do not invent
|
|
13
|
+
a parallel process.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- Start of a session, ambiguous request, or "which /cc should I run?"
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
|
|
21
|
+
| Intent | Command | Skill |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| New backlog item | `/cc-backlog` | `backlog` |
|
|
24
|
+
| Deliver a BC-xxx item | `/cc-openspec` | `openspec` |
|
|
25
|
+
| New feature | `/cc-feature` | `openspec` + `testing-tdd` |
|
|
26
|
+
| Bug fix | `/cc-fix` | `testing-tdd` |
|
|
27
|
+
| Review a diff | `/cc-review` | `evaluation` |
|
|
28
|
+
| TDD cycle only | `/cc-tdd-cycle` | `testing-tdd` |
|
|
29
|
+
| Scorecard / suites | `/cc-scorecard` | `evaluation` |
|
|
30
|
+
|
|
31
|
+
Then run the matching CLI (`openspec validate`, `scorecard create --from-diff`,
|
|
32
|
+
`hook pre-tool`, `scorecard suite-run`).
|
|
33
|
+
|
|
34
|
+
## Common Rationalizations
|
|
35
|
+
|
|
36
|
+
| Rationalization | Reality |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| I'll skip the slash and just code | Skipping the workflow is a defect. |
|
|
39
|
+
|
|
40
|
+
## Red Flags
|
|
41
|
+
|
|
42
|
+
- Two slash commands in parallel that mutate the same files
|
|
43
|
+
- Implementing before `openspec analyze` when a change folder is active
|
|
44
|
+
|
|
45
|
+
## Verification
|
|
46
|
+
|
|
47
|
+
- [ ] One command selected and shown to the user
|
|
48
|
+
- [ ] Matching skill loaded before edits
|
package/presets/cursor/AGENTS.md
CHANGED
|
@@ -391,8 +391,8 @@ definition, or the DDD→SDD→TDD pipeline is triggered.
|
|
|
391
391
|
When the active task touches stack-specific code, apply rules in `.cursor/skills/`.
|
|
392
392
|
Invoke skills via `/skill-name` or let the agent auto-load scoped skills.
|
|
393
393
|
|
|
394
|
-
Key skills: `security`, `django-orm`, `spring-boot-kotlin`, `nextjs-typescript`,
|
|
395
|
-
`laravel-specialist`, `openspec`, `evaluation`, `multi-agent-orchestration`.
|
|
394
|
+
Key skills: `security`, `security-*`, `django-orm`, `spring-boot-kotlin`, `nextjs-typescript`,
|
|
395
|
+
`laravel-specialist`, `openspec`, `backlog`, `evaluation`, `multi-agent-orchestration`.
|
|
396
396
|
|
|
397
397
|
## Hard Rules (all agents)
|
|
398
398
|
|