contract-driven-delivery 1.9.0 → 1.11.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 +383 -143
- package/assets/CLAUDE.template.md +31 -204
- package/assets/agents/backend-engineer.md +19 -1
- package/assets/agents/change-classifier.md +44 -8
- package/assets/agents/ci-cd-gatekeeper.md +13 -0
- package/assets/agents/contract-reviewer.md +13 -0
- package/assets/agents/e2e-resilience-engineer.md +13 -0
- package/assets/agents/frontend-engineer.md +19 -1
- package/assets/agents/monkey-test-engineer.md +13 -0
- package/assets/agents/qa-reviewer.md +13 -0
- package/assets/agents/repo-context-scanner.md +3 -0
- package/assets/agents/spec-architect.md +41 -31
- package/assets/agents/spec-drift-auditor.md +21 -19
- package/assets/agents/stress-soak-engineer.md +13 -0
- package/assets/agents/test-strategist.md +36 -26
- package/assets/ci-templates/conda.yml +1 -1
- package/assets/{ci/github-actions → github-workflows}/contract-driven-gates.yml +12 -17
- package/assets/hooks/pre-commit +1 -1
- package/assets/skills/cdd-close/SKILL.md +123 -0
- package/assets/skills/cdd-init/SKILL.md +6 -0
- package/assets/skills/cdd-new/SKILL.md +108 -24
- package/assets/skills/cdd-resume/SKILL.md +86 -0
- package/assets/skills/contract-driven-delivery/templates/change-classification.md +18 -11
- package/assets/skills/contract-driven-delivery/templates/design.md +16 -13
- package/assets/skills/contract-driven-delivery/templates/tasks.md +7 -0
- package/assets/skills/contract-driven-delivery/templates/test-plan.md +17 -23
- package/assets/specs-templates/change-classification.md +18 -11
- package/assets/specs-templates/design.md +16 -13
- package/assets/specs-templates/tasks.md +7 -0
- package/assets/specs-templates/test-plan.md +17 -23
- package/dist/cli/index.js +508 -41
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -1,237 +1,477 @@
|
|
|
1
1
|
# Contract-Driven Delivery Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**cdd-kit** is a Claude Code development kit that turns AI agents into a disciplined engineering team: contracts-first, test-first, spec-first. Every change goes through classification, contract review, TDD, implementation, and gate verification — automatically orchestrated by Claude Code skills.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Designed for solo developers and small teams building brownfield production systems (dashboards, APIs, workflow tools, data apps) who want AI to do all the implementation while they stay in the spec-author and reviewer seat.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Install
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
12
|
npm install -g contract-driven-delivery
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
Requires Node.js 18
|
|
14
|
-
|
|
15
|
-
## CLI Usage
|
|
15
|
+
Requires **Node.js 18+** and **Python 3.8+** (for contract validators).
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
---
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Quick Start
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
# 1. Install globally
|
|
23
|
+
npm install -g contract-driven-delivery
|
|
24
|
+
|
|
25
|
+
# 2. Go to your repo
|
|
26
|
+
cd your-repo
|
|
27
|
+
|
|
28
|
+
# 3. Deploy the kit
|
|
29
|
+
cdd-kit init
|
|
30
|
+
|
|
31
|
+
# 4. Open Claude Code in your repo and tell Claude:
|
|
32
|
+
# "Use /cdd-new to set up the project. My system is a <brief description>."
|
|
26
33
|
```
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## How to Direct Claude Code
|
|
38
|
+
|
|
39
|
+
> All workflows are started by typing a **natural language instruction** to Claude Code in your IDE or terminal. The `/cdd-*` prefixed commands are Claude Code skills — not shell commands.
|
|
40
|
+
|
|
41
|
+
### Starting a new project (first time)
|
|
42
|
+
|
|
43
|
+
After `cdd-kit init`, open Claude Code and say:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Scan this repo and create a project profile. Tell me what contracts are
|
|
47
|
+
missing and what the minimum setup should be before we start any feature work.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Claude will:
|
|
51
|
+
1. Run `cdd-kit detect-stack` to detect the tech stack
|
|
52
|
+
2. Read your existing code structure
|
|
53
|
+
3. Create `specs/project-profile.md`
|
|
54
|
+
4. Identify gaps in `contracts/` and recommend filling order
|
|
55
|
+
|
|
56
|
+
Then fill your contracts in this order (Claude can help draft them):
|
|
29
57
|
|
|
30
|
-
|
|
58
|
+
| Contract | File | What it captures |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| Env | `contracts/env/env-contract.md` | Every env var, secret flag, default, validation |
|
|
61
|
+
| API | `contracts/api/api-contract.md` | Every endpoint: method, path, auth, schemas, errors |
|
|
62
|
+
| Data | `contracts/data/data-shape-contract.md` | Schemas, types, nullability, bad-data behavior |
|
|
63
|
+
| CSS/UI | `contracts/css/css-contract.md` | Design tokens, component states, forbidden raw values |
|
|
64
|
+
| Business | `contracts/business/business-rules.md` | Rules, edge cases, decision tables |
|
|
65
|
+
| CI/CD | `contracts/ci/ci-gate-contract.md` | Gate tiers, promotion policy, rollback policy |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Starting a new task / feature / bug fix
|
|
70
|
+
|
|
71
|
+
Type this in Claude Code:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
/cdd-new add JWT authentication to the API
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
or
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
/cdd-new redesign the user dashboard to show real-time metrics
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
or
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
/cdd-new fix the order export timeout when result set exceeds 10 000 rows
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**What happens:**
|
|
90
|
+
1. Claude generates a `change-id` (e.g. `add-jwt-auth`) and scaffolds `specs/changes/add-jwt-auth/`
|
|
91
|
+
2. The `change-classifier` agent (Opus) reads the request, classifies risk and tier, decides which agents are needed
|
|
92
|
+
3. Agents run in order: contracts → test plan → spec/architecture review (if needed) → backend engineer → frontend engineer → CI/CD gates → QA
|
|
93
|
+
4. Each agent produces machine-verifiable evidence (agent-log files)
|
|
94
|
+
5. `cdd-kit gate <change-id>` runs automatically to confirm all artifacts are complete
|
|
95
|
+
6. Claude reports a summary and the suggested git commit
|
|
96
|
+
|
|
97
|
+
**You stay in control by:**
|
|
98
|
+
- Reviewing the `change-classification.md` before implementation starts
|
|
99
|
+
- Checking the `test-plan.md` to confirm the right test families are planned
|
|
100
|
+
- Reading the final `agent-log/qa-reviewer.md` for the release-readiness verdict
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Updating architecture or contracts
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
/cdd-new update the API contract to add pagination to all list endpoints
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
/cdd-new migrate the database from MySQL to PostgreSQL
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
/cdd-new add Redis caching layer to the reporting queries
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The change-classifier will detect that these are architectural or contract-level changes, assign a higher risk tier (0–2), and automatically require:
|
|
119
|
+
- Architecture review (`spec-architect` agent)
|
|
120
|
+
- E2E, resilience, stress, and monkey tests
|
|
121
|
+
- Updated contracts before any implementation begins
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Resuming an interrupted task
|
|
126
|
+
|
|
127
|
+
If a session was cut off or you need to return to an in-progress change:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
/cdd-resume add-jwt-auth
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
or, if you're unsure of the change-id:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
What changes are currently in progress? (cdd-kit list)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**What happens:**
|
|
140
|
+
1. Claude reads `tasks.md` and `agent-log/` to determine what was completed
|
|
141
|
+
2. Reports the current state (which agents ran, which tasks are pending)
|
|
142
|
+
3. Asks if you want to continue from the next pending agent
|
|
143
|
+
4. Resumes the full agent flow from where it stopped, with no duplication
|
|
144
|
+
|
|
145
|
+
> If you're upgrading from an older version and your change was created before v1.11.0, Claude will automatically run `cdd-kit migrate <change-id>` to upgrade the format before resuming.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Closing a completed change
|
|
150
|
+
|
|
151
|
+
After the PR is merged:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
/cdd-close add-jwt-auth
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**What happens:**
|
|
158
|
+
1. Runs `cdd-kit gate` to confirm the change still passes
|
|
159
|
+
2. Synthesizes `archive.md` — a permanent record of what changed, what tests were added, and what lessons were found
|
|
160
|
+
3. Invokes `contract-reviewer` to propose any durable learnings back into `contracts/`
|
|
161
|
+
4. Runs `cdd-kit archive add-jwt-auth` — moves the change from `specs/changes/` to `specs/archive/2026/`
|
|
162
|
+
5. Reduces the active context that future Claude sessions need to load
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### Abandoning a change
|
|
167
|
+
|
|
168
|
+
If you decide not to proceed with a change:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
/cdd-close add-jwt-auth
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Then when Claude asks for confirmation, say "abandon it." Claude will run:
|
|
31
175
|
|
|
32
176
|
```bash
|
|
33
|
-
cdd-kit
|
|
177
|
+
cdd-kit abandon add-jwt-auth --reason "decided to use a third-party auth service instead"
|
|
34
178
|
```
|
|
35
179
|
|
|
36
|
-
|
|
180
|
+
The directory stays on disk for git history, but `cdd-kit list` will show it as `abandoned`.
|
|
181
|
+
|
|
182
|
+
---
|
|
37
183
|
|
|
38
|
-
|
|
184
|
+
### Checking the status of all active changes
|
|
185
|
+
|
|
186
|
+
Type to Claude:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
What changes are currently in progress?
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Claude will run `cdd-kit list`, which shows:
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
Active changes:
|
|
196
|
+
add-jwt-auth [in-progress] (3 pending)
|
|
197
|
+
fix-export-timeout [gate-blocked]
|
|
198
|
+
redesign-dashboard [in-progress] (12 pending)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## CLI Reference
|
|
204
|
+
|
|
205
|
+
These are shell commands — not Claude Code skills. Run them directly in the terminal, or Claude Code will run them on your behalf.
|
|
206
|
+
|
|
207
|
+
### `cdd-kit init`
|
|
208
|
+
|
|
209
|
+
Installs agents and skill into `~/.claude` and scaffolds project files.
|
|
39
210
|
|
|
40
211
|
```bash
|
|
41
|
-
cdd-kit
|
|
42
|
-
cdd-kit
|
|
43
|
-
cdd-kit
|
|
212
|
+
cdd-kit init # global + local (recommended)
|
|
213
|
+
cdd-kit init --global-only # only install into ~/.claude
|
|
214
|
+
cdd-kit init --local-only # only scaffold project files
|
|
215
|
+
cdd-kit init --force # overwrite existing project files
|
|
44
216
|
```
|
|
45
217
|
|
|
46
|
-
|
|
218
|
+
Creates: `contracts/`, `specs/templates/`, `CLAUDE.md`, `AGENTS.md`, `hooks/`
|
|
47
219
|
|
|
48
|
-
|
|
220
|
+
---
|
|
49
221
|
|
|
50
|
-
### `cdd-kit
|
|
222
|
+
### `cdd-kit update`
|
|
51
223
|
|
|
52
|
-
|
|
224
|
+
Updates agents and skill in `~/.claude` to the latest installed version. Does not touch `contracts/` or `CLAUDE.md`.
|
|
53
225
|
|
|
54
226
|
```bash
|
|
55
|
-
cdd-kit
|
|
56
|
-
cdd-kit
|
|
57
|
-
cdd-kit validate --env # validate env contract
|
|
58
|
-
cdd-kit validate --ci # validate CI gate policy
|
|
59
|
-
cdd-kit validate --spec # validate spec traceability
|
|
227
|
+
cdd-kit update
|
|
228
|
+
cdd-kit update --yes # apply without confirmation
|
|
60
229
|
```
|
|
61
230
|
|
|
62
|
-
|
|
63
|
-
- **API semantic**: checks endpoint table for valid HTTP methods, paths starting with `/`, and valid auth values.
|
|
64
|
-
- **Env semantic**: checks variable table for secrets with default values (forbidden), and warns on required non-secret vars with no default.
|
|
231
|
+
---
|
|
65
232
|
|
|
66
233
|
### `cdd-kit gate <change-id>`
|
|
67
234
|
|
|
68
|
-
|
|
235
|
+
The single quality gate for a change. Blocks merge if anything is missing or incomplete.
|
|
69
236
|
|
|
70
237
|
```bash
|
|
71
|
-
cdd-kit gate add-
|
|
72
|
-
|
|
238
|
+
cdd-kit gate add-jwt-auth
|
|
239
|
+
cdd-kit gate add-jwt-auth --strict
|
|
73
240
|
```
|
|
74
241
|
|
|
75
|
-
|
|
242
|
+
Checks:
|
|
243
|
+
- All 5 required artifacts exist (`change-request.md`, `change-classification.md`, `test-plan.md`, `ci-gates.md`, `tasks.md`)
|
|
244
|
+
- Each artifact has sufficient content (not a stub): change-classification ≥ 200 chars, test-plan ≥ 200, ci-gates ≥ 150, others ≥ 100
|
|
245
|
+
- `change-classification.md` contains a tier or risk marker
|
|
246
|
+
- `agent-log/*.md` files all have `status: complete` (not blocked)
|
|
247
|
+
- Tier 0–1 changes have `e2e-resilience-engineer`, `monkey-test-engineer`, and `stress-soak-engineer` logs
|
|
248
|
+
- Tier 0–3 changes have `contract-reviewer` and `qa-reviewer` logs
|
|
249
|
+
- All contract validators pass
|
|
250
|
+
|
|
251
|
+
`--strict` additionally:
|
|
252
|
+
- Treats any pending `[ ]` tasks (except section 7 archive items) as errors
|
|
253
|
+
- Validates that every file path listed in `agent-log` artifact pointers actually exists on disk
|
|
254
|
+
|
|
255
|
+
Pre-commit hook uses `--strict` by default (installed via `cdd-kit install-hooks`).
|
|
256
|
+
|
|
76
257
|
```
|
|
258
|
+
✓ gate passed for change: add-jwt-auth
|
|
259
|
+
|
|
77
260
|
✗ gate failed for change: feat-001
|
|
78
|
-
✗
|
|
79
|
-
✗
|
|
261
|
+
✗ change-classification.md: appears to be a stub (< 200 meaningful chars)
|
|
262
|
+
✗ Tier 1 change requires agent-log/e2e-resilience-engineer.md
|
|
263
|
+
✗ 1 task(s) still pending (use [-] for N/A items, [x] for done)
|
|
80
264
|
```
|
|
81
265
|
|
|
82
|
-
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### `cdd-kit list`
|
|
83
269
|
|
|
84
|
-
|
|
270
|
+
Lists all active changes in `specs/changes/` with status and pending task count.
|
|
85
271
|
|
|
86
272
|
```bash
|
|
87
|
-
cdd-kit
|
|
88
|
-
# ✓ pre-commit hook installed at .git/hooks/pre-commit
|
|
273
|
+
cdd-kit list
|
|
89
274
|
```
|
|
90
275
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
276
|
+
```
|
|
277
|
+
Active changes:
|
|
278
|
+
add-jwt-auth [in-progress] (3 pending)
|
|
279
|
+
fix-export-timeout [gate-blocked]
|
|
280
|
+
old-experiment [abandoned]
|
|
281
|
+
```
|
|
94
282
|
|
|
95
|
-
|
|
283
|
+
---
|
|
96
284
|
|
|
97
|
-
|
|
285
|
+
### `cdd-kit archive <change-id>`
|
|
286
|
+
|
|
287
|
+
Physically moves a completed change from `specs/changes/` to `specs/archive/<year>/`.
|
|
98
288
|
|
|
99
289
|
```bash
|
|
100
|
-
cdd-kit
|
|
101
|
-
#
|
|
102
|
-
#
|
|
103
|
-
# Polyglot: yes (config will be generated for conda)
|
|
290
|
+
cdd-kit archive add-jwt-auth
|
|
291
|
+
# ✓ Archived: specs/changes/add-jwt-auth → specs/archive/2026/add-jwt-auth
|
|
292
|
+
# ✓ Index updated: specs/archive/INDEX.md
|
|
104
293
|
```
|
|
105
294
|
|
|
106
|
-
|
|
295
|
+
Warns (but does not block) if `tasks.md` has pending items or `status: gate-blocked`. Use after `/cdd-close` — the skill runs this automatically at the end.
|
|
107
296
|
|
|
108
|
-
|
|
109
|
-
|------------|---------|----------------------------------------------|
|
|
110
|
-
| Python | conda | `environment.yml`, `conda-lock.yml`, `meta.yaml` |
|
|
111
|
-
| Python | poetry | `pyproject.toml` with `[tool.poetry]` |
|
|
112
|
-
| Python | uv | `pyproject.toml` (no poetry section) |
|
|
113
|
-
| Python | pip | `requirements.txt` |
|
|
114
|
-
| JavaScript | pnpm | `package.json` + `pnpm-lock.yaml` |
|
|
115
|
-
| JavaScript | bun | `package.json` + `bun.lockb` |
|
|
116
|
-
| JavaScript | yarn | `package.json` + `yarn.lock` |
|
|
117
|
-
| JavaScript | npm | `package.json` (no lockfile match) |
|
|
118
|
-
| Go | go | `go.mod` |
|
|
119
|
-
| Rust | rust | `Cargo.toml` |
|
|
297
|
+
---
|
|
120
298
|
|
|
121
|
-
|
|
299
|
+
### `cdd-kit abandon <change-id>`
|
|
122
300
|
|
|
123
|
-
|
|
301
|
+
Marks a change as abandoned. Updates `tasks.md` status to `abandoned`, records the reason in `specs/archive/INDEX.md`. The directory stays on disk for git history.
|
|
124
302
|
|
|
125
303
|
```bash
|
|
126
|
-
|
|
127
|
-
|
|
304
|
+
cdd-kit abandon add-jwt-auth --reason "using Auth0 instead"
|
|
305
|
+
# ✓ Change add-jwt-auth marked as abandoned.
|
|
306
|
+
```
|
|
128
307
|
|
|
129
|
-
|
|
130
|
-
cd your-repo
|
|
308
|
+
---
|
|
131
309
|
|
|
132
|
-
|
|
133
|
-
|
|
310
|
+
### `cdd-kit migrate <change-id> | --all`
|
|
311
|
+
|
|
312
|
+
Upgrades pre-v1.11.0 change directories to the current format.
|
|
134
313
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
314
|
+
```bash
|
|
315
|
+
cdd-kit migrate add-jwt-auth # migrate one change
|
|
316
|
+
cdd-kit migrate --all # migrate all changes in specs/changes/
|
|
317
|
+
cdd-kit migrate --all --dry-run # preview without writing
|
|
139
318
|
```
|
|
140
319
|
|
|
141
|
-
|
|
320
|
+
What it upgrades:
|
|
321
|
+
- `tasks.md`: adds YAML frontmatter (`change-id`, `status: in-progress`) and `[x]/[-]/[ ]` legend if missing
|
|
322
|
+
- `change-classification.md`: detects old `**Tier:** Tier N` format and appends the new `## Tier\n- N` section so tier-based gate checks activate
|
|
142
323
|
|
|
143
|
-
|
|
324
|
+
Run this after upgrading from v1.10 or earlier if you have mid-flight changes.
|
|
144
325
|
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
326
|
+
```bash
|
|
327
|
+
cdd-kit migrate --all
|
|
328
|
+
git add specs/changes/
|
|
329
|
+
git commit -m "chore: migrate changes to v1.11.0 format"
|
|
148
330
|
```
|
|
149
331
|
|
|
150
|
-
|
|
332
|
+
---
|
|
151
333
|
|
|
152
|
-
|
|
153
|
-
2. `contracts/api/api-contract.md` — inventory every endpoint with method, path, request/response shape, and error format.
|
|
154
|
-
3. `contracts/data/data-shape-contract.md` — required columns, types, nullability, and malformed-data behavior for each data surface.
|
|
155
|
-
4. `contracts/css/css-contract.md` — design tokens, component states, and forbidden raw values.
|
|
156
|
-
5. `contracts/business/business-rules.md` — current rules, decision tables, edge cases.
|
|
157
|
-
6. `contracts/ci/ci-gate-contract.md` — gate tiers, promotion policy, rollback policy.
|
|
334
|
+
### `cdd-kit validate`
|
|
158
335
|
|
|
159
|
-
|
|
336
|
+
Runs contract validation scripts.
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
cdd-kit validate # all validators
|
|
340
|
+
cdd-kit validate --contracts # API, CSS, data-shape (+ semantic checks)
|
|
341
|
+
cdd-kit validate --env # env contract
|
|
342
|
+
cdd-kit validate --ci # CI gate policy
|
|
343
|
+
cdd-kit validate --spec # spec traceability
|
|
344
|
+
cdd-kit validate --versions # contract frontmatter schema versions
|
|
345
|
+
```
|
|
160
346
|
|
|
161
|
-
|
|
347
|
+
---
|
|
162
348
|
|
|
163
|
-
-
|
|
164
|
-
- SDD artifacts for every meaningful change
|
|
165
|
-
- TDD and test-first handoff rules
|
|
166
|
-
- API, CSS/UI, environment, data-shape, business-rule, and CI/CD contracts
|
|
167
|
-
- Required CI/CD gate planning for every change
|
|
168
|
-
- E2E, resilience, data-boundary, monkey-operation, stress, and soak testing
|
|
169
|
-
- Visual and UI/UX review for frontend changes
|
|
170
|
-
- Spec drift audits across multiple iterations
|
|
171
|
-
- Archiving completed changes back into durable standards
|
|
349
|
+
### `cdd-kit new <name>`
|
|
172
350
|
|
|
173
|
-
|
|
351
|
+
Scaffolds an empty change directory. Normally you use `/cdd-new` (the Claude Code skill) instead, which runs this and then orchestrates all agents. Use `cdd-kit new` only if you want an empty scaffold without agent orchestration.
|
|
174
352
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
6. Run local and CI gates.
|
|
181
|
-
7. Run visual, E2E, resilience, stress, soak, or monkey testing as required.
|
|
182
|
-
8. Archive stable learnings back into contracts and standards.
|
|
353
|
+
```bash
|
|
354
|
+
cdd-kit new add-user-auth
|
|
355
|
+
cdd-kit new add-user-auth --all # include optional templates too
|
|
356
|
+
cdd-kit new add-user-auth --force # overwrite existing directory
|
|
357
|
+
```
|
|
183
358
|
|
|
184
|
-
|
|
359
|
+
---
|
|
185
360
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
├── current-behavior.md
|
|
194
|
-
├── proposal.md
|
|
195
|
-
├── spec.md
|
|
196
|
-
├── design.md
|
|
197
|
-
├── contracts.md
|
|
198
|
-
├── qa-report.md
|
|
199
|
-
├── regression-report.md
|
|
200
|
-
└── archive.md
|
|
361
|
+
### `cdd-kit install-hooks`
|
|
362
|
+
|
|
363
|
+
Installs a pre-commit Git hook that auto-runs `cdd-kit gate --strict` on any staged change directory.
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
cdd-kit install-hooks
|
|
367
|
+
# ✓ pre-commit hook installed at .git/hooks/pre-commit
|
|
201
368
|
```
|
|
202
369
|
|
|
203
|
-
|
|
370
|
+
Idempotent. Preserves existing hook content. Bypass with `--no-verify` is possible but defeats enforcement.
|
|
204
371
|
|
|
205
|
-
|
|
372
|
+
---
|
|
206
373
|
|
|
207
|
-
-
|
|
208
|
-
- Required tests exist and are mapped to acceptance criteria.
|
|
209
|
-
- Required CI/CD gates are present and green or explicitly marked as informational with promotion policy.
|
|
210
|
-
- UI changes have visual evidence.
|
|
211
|
-
- Data/reporting changes have data-boundary and bad-shape coverage.
|
|
212
|
-
- High-load or long-running features have stress or soak evidence.
|
|
213
|
-
- The archive captures what should become durable project knowledge.
|
|
374
|
+
### `cdd-kit detect-stack`
|
|
214
375
|
|
|
215
|
-
|
|
376
|
+
Detects the project tech stack from lockfiles and config files.
|
|
216
377
|
|
|
217
|
-
|
|
218
|
-
|
|
378
|
+
```bash
|
|
379
|
+
cdd-kit detect-stack
|
|
380
|
+
# Detected stack: conda
|
|
381
|
+
# Polyglot: yes (config will be generated for conda)
|
|
382
|
+
```
|
|
219
383
|
|
|
220
|
-
|
|
|
221
|
-
|
|
222
|
-
|
|
|
223
|
-
|
|
|
224
|
-
|
|
|
384
|
+
| Language | Tool | Detection signal |
|
|
385
|
+
|---|---|---|
|
|
386
|
+
| Python | conda | `environment.yml`, `conda-lock.yml` |
|
|
387
|
+
| Python | poetry | `pyproject.toml` with `[tool.poetry]` |
|
|
388
|
+
| Python | uv | `pyproject.toml` (no poetry section) |
|
|
389
|
+
| Python | pip | `requirements.txt` |
|
|
390
|
+
| JS/TS | pnpm | `pnpm-lock.yaml` |
|
|
391
|
+
| JS/TS | bun | `bun.lockb` |
|
|
392
|
+
| JS/TS | yarn | `yarn.lock` |
|
|
393
|
+
| JS/TS | npm | `package.json` (fallback) |
|
|
394
|
+
| Go | go | `go.mod` |
|
|
395
|
+
| Rust | rust | `Cargo.toml` |
|
|
225
396
|
|
|
226
|
-
|
|
397
|
+
---
|
|
227
398
|
|
|
228
|
-
##
|
|
399
|
+
## Upgrading from v1.10 or earlier
|
|
229
400
|
|
|
230
401
|
```bash
|
|
231
402
|
npm update -g contract-driven-delivery
|
|
232
403
|
cdd-kit update
|
|
404
|
+
|
|
405
|
+
# If you have mid-flight changes:
|
|
406
|
+
cdd-kit migrate --all
|
|
407
|
+
git add specs/changes/
|
|
408
|
+
git commit -m "chore: migrate changes to v1.11.0 format"
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**What changed in v1.11.0:**
|
|
412
|
+
- `gate --strict` and pre-commit enforcement
|
|
413
|
+
- Tier-based agent-log requirements (Tier 0–1 must have E2E/monkey/stress logs)
|
|
414
|
+
- `cdd-kit abandon`, `cdd-kit archive`, `cdd-kit list`, `cdd-kit migrate` commands
|
|
415
|
+
- `/cdd-resume` and `/cdd-close` Claude Code skills
|
|
416
|
+
- `change-classifier` outputs Acceptance Criteria + Tasks Not Applicable
|
|
417
|
+
- All agents require `CURRENT_CHANGE_ID` injection (handled automatically by skills)
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Directory structure after `cdd-kit init`
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
your-repo/
|
|
425
|
+
├── contracts/
|
|
426
|
+
│ ├── api/api-contract.md ← what endpoints exist and how they behave
|
|
427
|
+
│ ├── css/css-contract.md ← design tokens, component states
|
|
428
|
+
│ ├── data/data-shape-contract.md ← schemas, types, nullability
|
|
429
|
+
│ ├── env/env-contract.md ← every env var, secret flags, defaults
|
|
430
|
+
│ ├── business/business-rules.md ← rules, edge cases, decision tables
|
|
431
|
+
│ └── ci/ci-gate-contract.md ← gate tiers, promotion, rollback
|
|
432
|
+
├── specs/
|
|
433
|
+
│ ├── project-profile.md ← overall system description
|
|
434
|
+
│ ├── changes/ ← active in-progress changes
|
|
435
|
+
│ │ └── <change-id>/
|
|
436
|
+
│ │ ├── change-request.md (required)
|
|
437
|
+
│ │ ├── change-classification.md (required)
|
|
438
|
+
│ │ ├── test-plan.md (required)
|
|
439
|
+
│ │ ├── ci-gates.md (required)
|
|
440
|
+
│ │ ├── tasks.md (required)
|
|
441
|
+
│ │ └── agent-log/ ← machine-verifiable evidence per agent
|
|
442
|
+
│ ├── archive/ ← completed and abandoned changes
|
|
443
|
+
│ │ ├── INDEX.md
|
|
444
|
+
│ │ └── 2026/<change-id>/
|
|
445
|
+
│ └── templates/
|
|
446
|
+
├── tests/
|
|
447
|
+
├── CLAUDE.md ← Claude's project guide (edit this)
|
|
448
|
+
└── AGENTS.md ← agent roster (auto-managed)
|
|
233
449
|
```
|
|
234
450
|
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
## Risk tiers and what each triggers
|
|
454
|
+
|
|
455
|
+
| Tier | Risk level | Example changes | Extra agents |
|
|
456
|
+
|---|---|---|---|
|
|
457
|
+
| 0–1 | High / critical | Auth, payments, migrations, concurrency | E2E + monkey + stress/soak |
|
|
458
|
+
| 2–3 | Medium | Feature with API change, bug fix with behavior change | Contract review + QA |
|
|
459
|
+
| 4–5 | Low | Docs, prompts, config only, no behavior change | Contract review + QA |
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Task notation in `tasks.md`
|
|
464
|
+
|
|
465
|
+
```markdown
|
|
466
|
+
- [x] 1.1 Confirm classification ← done
|
|
467
|
+
- [-] 2.2 CSS/UI contract ← N/A (not applicable to this change)
|
|
468
|
+
- [ ] 4.1 Backend implementation ← pending
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
`cdd-kit gate --strict` treats any `[ ]` (except section 7 archive tasks) as an error. Use `[-]` for items that are genuinely not applicable to a given change.
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
235
475
|
## License
|
|
236
476
|
|
|
237
477
|
MIT
|