contract-driven-delivery 2.0.16 → 2.0.18

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 (40) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +153 -91
  3. package/assets/AGENTS.template.md +1 -0
  4. package/assets/CLAUDE.template.md +7 -3
  5. package/assets/CODEX.template.md +9 -5
  6. package/assets/agents/backend-engineer.md +32 -32
  7. package/assets/agents/change-classifier.md +31 -35
  8. package/assets/agents/ci-cd-gatekeeper.md +21 -25
  9. package/assets/agents/contract-reviewer.md +21 -26
  10. package/assets/agents/dependency-security-reviewer.md +21 -26
  11. package/assets/agents/e2e-resilience-engineer.md +21 -23
  12. package/assets/agents/frontend-engineer.md +32 -32
  13. package/assets/agents/implementation-planner.md +121 -0
  14. package/assets/agents/monkey-test-engineer.md +21 -23
  15. package/assets/agents/qa-reviewer.md +20 -25
  16. package/assets/agents/repo-context-scanner.md +17 -22
  17. package/assets/agents/spec-architect.md +17 -21
  18. package/assets/agents/spec-drift-auditor.md +17 -22
  19. package/assets/agents/stress-soak-engineer.md +19 -21
  20. package/assets/agents/test-strategist.md +24 -28
  21. package/assets/agents/ui-ux-reviewer.md +16 -21
  22. package/assets/agents/visual-reviewer.md +19 -24
  23. package/assets/cdd/model-policy.json +1 -0
  24. package/assets/skills/cdd-new/SKILL.md +123 -122
  25. package/assets/skills/cdd-resume/SKILL.md +5 -0
  26. package/assets/skills/contract-driven-delivery/SKILL.md +15 -7
  27. package/assets/skills/contract-driven-delivery/references/agent-log-protocol.md +68 -157
  28. package/assets/skills/contract-driven-delivery/references/code-map-protocol.md +57 -35
  29. package/assets/skills/contract-driven-delivery/references/workflow-router.md +3 -2
  30. package/assets/skills/contract-driven-delivery/scripts/generate_change_scaffold.py +1 -0
  31. package/assets/skills/contract-driven-delivery/scripts/validate_spec_traceability.py +1 -1
  32. package/assets/skills/contract-driven-delivery/templates/agent-log.example.yml +6 -0
  33. package/assets/skills/contract-driven-delivery/templates/change-classification.md +3 -3
  34. package/assets/skills/contract-driven-delivery/templates/implementation-plan.md +56 -0
  35. package/assets/skills/contract-driven-delivery/templates/tasks.yml +1 -0
  36. package/assets/specs-templates/change-classification.md +1 -1
  37. package/assets/specs-templates/implementation-plan.md +56 -0
  38. package/assets/specs-templates/tasks.yml +1 -0
  39. package/dist/cli/index.js +2369 -2131
  40. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.18] - 2026-05-15
4
+
5
+ Implementation planning handoff release. This adds a senior planning step so
6
+ implementation agents receive a concise execution packet instead of inferring
7
+ scope from chat history.
8
+
9
+ ### Added
10
+
11
+ - **`implementation-planner` agent**: writes
12
+ `specs/changes/<change-id>/implementation-plan.md` after classification,
13
+ contracts, test plan, design, and CI gate plan are known.
14
+ - **Required `implementation-plan.md` template**: new changes scaffold it by
15
+ default, `cdd-kit gate` validates it, and `cdd-kit migrate` adds a scaffold
16
+ for existing active changes.
17
+ - **Upgrade documentation**: README now explains how to sync npm package
18
+ updates into global agents/skills, repo templates, `.cdd/model-policy.json`,
19
+ hooks, code-map, and existing change directories.
20
+
21
+ ### Changed
22
+
23
+ - **Implementation agents now consume the plan**: backend, frontend, E2E,
24
+ monkey, and stress/soak agents must read `implementation-plan.md` and report
25
+ `blocked` instead of inferring missing scope.
26
+ - **`/cdd-new` ordering now plans before implementation**: contracts, test
27
+ plan, design if needed, and CI gate plan come before `implementation-planner`;
28
+ backend/frontend/test implementation agents start only after task `1.4`
29
+ confirms the implementation plan.
30
+ - **Traceability helpers include implementation plan**:
31
+ `generate_change_scaffold.py` copies the new template and
32
+ `validate_spec_traceability.py` treats it as required.
33
+
34
+ ## [2.0.17] - 2026-05-07
35
+
36
+ Focused index-assisted development release. Agents now get a smaller, more
37
+ precise pre-read path through the code-map, while `cdd-kit gate` returns to
38
+ delivery-quality validation instead of post-run harness paperwork.
39
+
40
+ ### Added
41
+
42
+ - **`cdd-kit index query <term>`**: searches `.cdd/code-map.yml` for matching
43
+ files, imports, symbols, and line ranges, auto-refreshing a missing or stale
44
+ map before returning candidates.
45
+ - **`cdd-kit index impact <path-or-symbol>`**: reports indexed local imports and
46
+ dependent files so agents can inspect the smallest useful modification scope
47
+ before editing.
48
+
49
+ ### Changed
50
+
51
+ - **Gate is now delivery-quality only**: `cdd-kit gate` validates required
52
+ artifacts, tasks, tier consistency, dependencies, and contract validators,
53
+ without requiring agent logs, files-read lists, or code-map freshness as
54
+ merge blockers.
55
+ - **Agent prompts prefer index-first targeting**: implementation agents are
56
+ instructed to use `index query` before broad source reads and `index impact`
57
+ before editing chosen source files.
58
+ - **Agent logs are optional handoff notes**: prompt templates and protocols no
59
+ longer require agents to create logs or reconstruct every file they read just
60
+ to satisfy a gate.
61
+
3
62
  ## [2.0.16] - 2026-05-06
4
63
 
5
64
  New-change scaffold hardening so freshly opened proposals use the installed
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Contract-Driven Delivery Kit
1
+ # Contract-Driven Delivery Kit
2
2
 
3
- **cdd-kit** is a contract-driven delivery kit for AI coding agents. It started with Claude Code skills and now keeps the core workflow provider-neutral: contracts-first, test-first, spec-first. Every change goes through classification, contract review, TDD, implementation, and gate verification, with deterministic context indexes and manifest-backed read-scope auditing to keep long agent runs reviewable.
3
+ **cdd-kit** is a contract-driven delivery kit for AI coding agents. It started with Claude Code skills and now keeps the core workflow provider-neutral: contracts-first, test-first, spec-first. Every change goes through classification, contract review, TDD, implementation, and gate verification, with deterministic context indexes to keep agent work targeted.
4
4
 
5
5
  Designed for solo developers and small teams building brownfield production systems (dashboards, APIs, workflow tools, data apps), especially when non-engineers or product owners want AI to do the implementation while they stay in the spec-author and reviewer seat.
6
6
 
7
- **Context Governance v1** adds a manifest-driven audit layer for AI agents. New changes include `context-manifest.md`, `agent-log` entries are expected to report `files-read`, and `cdd-kit gate` audits those reads against allowed and forbidden paths. This is governance and review support, not a sandbox.
7
+ **Context Governance v1** adds a manifest-driven planning layer for AI agents. New changes include `context-manifest.md`; agents should use `cdd-kit index query` and `cdd-kit index impact` before broad source reads. `cdd-kit gate` focuses on delivery quality, not post-run read paperwork.
8
8
 
9
9
  ---
10
10
 
@@ -38,7 +38,7 @@ cdd-kit init
38
38
 
39
39
  ## How to Direct Claude Code
40
40
 
41
- > 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.
41
+ > 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.
42
42
 
43
43
  ### Starting a new project (first time)
44
44
 
@@ -94,10 +94,11 @@ or
94
94
  3. The `change-classifier` agent (Opus) reads the request, classifies risk and tier, decides which agents are needed
95
95
  4. If the request is too broad, the classifier can return an atomic split proposal instead of forcing one Tier 0/1 monolith
96
96
  5. For Tier 0-1 work, Claude's narration uses stage badges so users can tell whether the flow is deciding, implementing, testing, or reviewing
97
- 6. Agents run in order: contracts test plan spec/architecture review (if needed) backend engineer frontend engineer → CI/CD gates → QA
98
- 7. Each agent produces machine-verifiable evidence (agent-log files)
99
- 8. `cdd-kit gate <change-id>` runs automatically to confirm all artifacts are complete
100
- 9. Claude reports a summary and the suggested git commit
97
+ 6. Agents run in order: contracts ??test plan ??spec/architecture review (if needed) ??CI/CD gates ??implementation plan ??backend engineer ??frontend engineer ??QA
98
+ 7. `implementation-planner` writes `implementation-plan.md`, the concise execution packet implementation agents follow
99
+ 8. Implementation agents write code/tests from that plan and optional concise handoff notes
100
+ 9. `cdd-kit gate <change-id>` runs automatically to confirm all artifacts are complete
101
+ 10. Claude reports a summary and the suggested git commit
101
102
 
102
103
  ### Workflow Lanes: Avoiding Ceremony for Small Fixes
103
104
 
@@ -108,7 +109,7 @@ Use a lightweight maintenance lane for small corrections where the intent is alr
108
109
  | Lane | Examples | Required record |
109
110
  |---|---|---|
110
111
  | maintenance / micro-change | typo fixes, comment updates, README cleanup, formatting, lint-only fixes, tiny local test repair | normal commit message and test output if applicable |
111
- | tracked CDD change | behavior changes, contract updates, API/data/env/security/CI changes, cross-module refactors, high-risk bug fixes | `specs/changes/<id>/`, `tasks.yml`, `context-manifest.md`, agent logs, and `cdd-kit gate` |
112
+ | tracked CDD change | behavior changes, contract updates, API/data/env/security/CI changes, cross-module refactors, high-risk bug fixes | `specs/changes/<id>/`, `implementation-plan.md`, `tasks.yml`, `context-manifest.md`, and `cdd-kit gate` |
112
113
 
113
114
  Do not add hard pre-commit rules that block every `src/`, `tests/`, or `contracts/` edit unless your team explicitly wants that policy. The default kit favors low-friction traceability: make risky changes reviewable, but let obvious maintenance edits stay small.
114
115
 
@@ -118,8 +119,8 @@ Machine-readable metadata such as future `change.yml` / `trace.yml` should follo
118
119
 
119
120
  CDD uses two agent classes on purpose:
120
121
 
121
- - `change-classifier`, `contract-reviewer`, `qa-reviewer`, `visual-reviewer`, `dependency-security-reviewer`, `ui-ux-reviewer`, `repo-context-scanner`, and `spec-drift-auditor` are read-only. They return analysis, verdicts, or an `Agent Log` YAML block; main Claude writes the corresponding files.
122
- - `backend-engineer`, `frontend-engineer`, `e2e-resilience-engineer`, `monkey-test-engineer`, `stress-soak-engineer`, `ci-cd-gatekeeper`, `test-strategist`, and `spec-architect` are write-capable. They write their own implementation artifacts and their own `agent-log/*.yml`.
122
+ - `change-classifier`, `contract-reviewer`, `qa-reviewer`, `visual-reviewer`, `dependency-security-reviewer`, `ui-ux-reviewer`, `repo-context-scanner`, and `spec-drift-auditor` are read-only. They return analysis, verdicts, or optional handoff notes; main Claude writes the corresponding files.
123
+ - `implementation-planner`, `backend-engineer`, `frontend-engineer`, `e2e-resilience-engineer`, `monkey-test-engineer`, `stress-soak-engineer`, `ci-cd-gatekeeper`, `test-strategist`, and `spec-architect` are write-capable. They write their own implementation artifacts directly.
123
124
 
124
125
  This split is deliberate:
125
126
 
@@ -130,7 +131,8 @@ This split is deliberate:
130
131
  **You stay in control by:**
131
132
  - Reviewing the `change-classification.md` before implementation starts
132
133
  - Checking the `test-plan.md` to confirm the right test families are planned
133
- - Reading the final `agent-log/qa-reviewer.yml` for the release-readiness verdict
134
+ - Checking `implementation-plan.md` when you want to review the exact execution packet before code changes
135
+ - Reading the final QA summary for the release-readiness verdict
134
136
 
135
137
  ---
136
138
 
@@ -148,7 +150,7 @@ This split is deliberate:
148
150
  /cdd-new add Redis caching layer to the reporting queries
149
151
  ```
150
152
 
151
- The change-classifier will detect that these are architectural or contract-level changes, assign a higher risk tier (0–2), and automatically require:
153
+ The change-classifier will detect that these are architectural or contract-level changes, assign a higher risk tier (0??), and automatically require:
152
154
  - Architecture review (`spec-architect` agent)
153
155
  - E2E, resilience, stress, and monkey tests
154
156
  - Updated contracts before any implementation begins
@@ -170,7 +172,7 @@ What changes are currently in progress? (cdd-kit list)
170
172
  ```
171
173
 
172
174
  **What happens:**
173
- 1. Claude reads `tasks.yml` and `agent-log/` to determine what was completed
175
+ 1. Claude reads `tasks.yml` and existing change artifacts to determine what was completed
174
176
  2. Reports the current state (which agents ran, which tasks are pending)
175
177
  3. Asks if you want to continue from the next pending agent
176
178
  4. Resumes the full agent flow from where it stopped, with no duplication
@@ -189,9 +191,9 @@ After the PR is merged:
189
191
 
190
192
  **What happens:**
191
193
  1. Runs `cdd-kit gate` to confirm the change still passes
192
- 2. Synthesizes `archive.md` a permanent record of what changed, what tests were added, and what lessons were found
194
+ 2. Synthesizes `archive.md` ??a permanent record of what changed, what tests were added, and what lessons were found
193
195
  3. Promotes only evidence-backed durable learnings to `contracts/` or project guidance (`CLAUDE.md`/`CODEX.md`). General agents record evidence and findings only; durable learning promotion happens during `/cdd-close` Step 3.
194
- 4. Runs `cdd-kit archive add-jwt-auth` moves the change from `specs/changes/` to `specs/archive/2026/`
196
+ 4. Runs `cdd-kit archive add-jwt-auth` ??moves the change from `specs/changes/` to `specs/archive/2026/`
195
197
  5. Reduces the active context that future Claude sessions need to load
196
198
 
197
199
  ---
@@ -235,7 +237,7 @@ Active changes:
235
237
 
236
238
  ## CLI Reference
237
239
 
238
- These are shell commands not Claude Code skills. Run them directly in the terminal, or Claude Code will run them on your behalf.
240
+ These are shell commands ??not Claude Code skills. Run them directly in the terminal, or Claude Code will run them on your behalf.
239
241
 
240
242
  ### `cdd-kit init`
241
243
 
@@ -271,6 +273,48 @@ Codex currently has no global assets to update, so Codex-only projects report th
271
273
 
272
274
  ---
273
275
 
276
+ ### After Updating the npm Package
277
+
278
+ Updating npm only replaces the `cdd-kit` CLI package. Existing repos and
279
+ global Claude Code assets keep their previously copied agents, skills,
280
+ templates, hooks, and `.cdd/model-policy.json` until you sync them.
281
+
282
+ Recommended one-command sync after `npm update -g contract-driven-delivery`:
283
+
284
+ ```bash
285
+ cdd-kit refresh # dry-run preview
286
+ cdd-kit refresh --yes # apply agents, skills, templates, model policy, hook, code-map
287
+ cdd-kit migrate --all # add new per-change scaffolds such as implementation-plan.md
288
+ cdd-kit doctor --strict
289
+ ```
290
+
291
+ What gets updated:
292
+
293
+ | command | updates | preserves |
294
+ |---|---|---|
295
+ | `cdd-kit update --yes` | `~/.claude/agents/` and `~/.claude/skills/` for Claude provider projects | project files |
296
+ | `cdd-kit upgrade --yes` | missing repo files only: contracts, templates, `.cdd/`, guidance, workflows | existing files and project guidance |
297
+ | `cdd-kit refresh --yes` | global agents/skills, missing project files, kit-shipped templates with backup, model policy roles, hooks, `.cdd/code-map.yml` | user source, contracts content, active change content |
298
+ | `cdd-kit migrate --all` | existing `specs/changes/*` metadata and new required scaffolds | implementation code and completed archive history |
299
+
300
+ For this release, run `cdd-kit refresh --yes` so the new
301
+ `implementation-planner` agent, updated `/cdd-new` and `/cdd-resume` skills,
302
+ fresh `specs/templates/`, and `.cdd/model-policy.json` role binding are all in
303
+ place. Then run `cdd-kit migrate --all` so existing active change directories
304
+ receive `implementation-plan.md`; fill that plan before resuming implementation
305
+ agents.
306
+
307
+ If you do not want template overwrites, run the narrower path:
308
+
309
+ ```bash
310
+ cdd-kit update --yes
311
+ cdd-kit upgrade --yes
312
+ cdd-kit migrate --all
313
+ cdd-kit doctor --strict
314
+ ```
315
+
316
+ ---
317
+
274
318
  ### `cdd-kit doctor`
275
319
 
276
320
  Inspects repo-level cdd-kit health. Default mode is read-only; `--fix` applies only the safe auto-remediations.
@@ -304,6 +348,33 @@ Use this for old repos that already have `contracts/` or `specs/` but are missin
304
348
 
305
349
  ---
306
350
 
351
+ ### `cdd-kit refresh`
352
+
353
+ Complete sync after upgrading the npm package. Default mode is a dry run.
354
+
355
+ ```bash
356
+ cdd-kit refresh
357
+ cdd-kit refresh --yes
358
+ cdd-kit refresh --yes --provider both
359
+ cdd-kit refresh --yes --no-templates
360
+ ```
361
+
362
+ `refresh --yes` runs the practical upgrade sequence:
363
+
364
+ 1. `cdd-kit update --yes` for global Claude agents and skills.
365
+ 2. `cdd-kit upgrade --yes` for missing project files.
366
+ 3. Force-refreshes kit-shipped `specs/templates/`, `tests/templates/`,
367
+ `ci-templates/`, and `.github/workflows/` with backup under
368
+ `.cdd/.refresh-backup/`.
369
+ 4. Re-installs the code-map hook if the project marker exists.
370
+ 5. Resyncs `.cdd/model-policy.json` roles from installed agent frontmatter.
371
+ 6. Regenerates `.cdd/code-map.yml`.
372
+
373
+ Run `cdd-kit migrate --all` separately when you need existing
374
+ `specs/changes/*` directories to gain new required artifacts.
375
+
376
+ ---
377
+
307
378
  ### `cdd-kit gate <change-id>`
308
379
 
309
380
  The single quality gate for a change. Blocks merge if anything is missing or incomplete.
@@ -311,36 +382,27 @@ The single quality gate for a change. Blocks merge if anything is missing or inc
311
382
  ```bash
312
383
  cdd-kit gate add-jwt-auth
313
384
  cdd-kit gate add-jwt-auth --strict
314
- cdd-kit gate add-jwt-auth --lax
315
385
  ```
316
386
 
317
387
  Checks:
318
- - All required artifacts exist (`change-request.md`, `change-classification.md`, `test-plan.md`, `ci-gates.md`, `tasks.yml`; new context-governed changes also require `context-manifest.md`)
319
- - Each artifact has sufficient content (not a stub): change-classification ≥ 200 chars, test-plan ≥ 200, ci-gates ≥ 150, others ≥ 100
320
- - `change-classification.md` contains a tier or risk marker
321
- - `agent-log/*.yml` files all have a completed status (`complete`, with `done` and `approved` accepted as compatibility aliases) and are not blocked
322
- - For context-governed changes, `agent-log/*.yml` files include a structured `files-read:` list and those repo-relative paths are audited against `context-manifest.md` and `.cdd/context-policy.json`
323
- - Atomic `depends-on` upstream changes are completed or archived before dependent work gates
324
- - Tier 0–1 changes have `e2e-resilience-engineer`, `monkey-test-engineer`, and `stress-soak-engineer` logs
325
- - Tier 0–3 changes have `contract-reviewer` and `qa-reviewer` logs
326
- - All contract validators pass
388
+ - All required artifacts exist (`change-request.md`, `change-classification.md`, `implementation-plan.md`, `test-plan.md`, `ci-gates.md`, `tasks.yml`; new context-governed changes also require `context-manifest.md`)
389
+ - Each artifact has sufficient content and is not a stub.
390
+ - `change-classification.md` contains a tier or risk marker.
391
+ - Atomic `depends-on` upstream changes are completed or archived before dependent work gates.
392
+ - All contract validators pass.
327
393
 
328
394
  `--strict` additionally:
329
395
  - Treats any task with `status: pending` (except IDs listed in `archive-tasks`) as an error
330
- - Treats runtime-vs-declared `files-read` drift as errors
331
- - Treats legacy changes missing `context-manifest.md` or `files-read` audit data as errors
332
-
333
- Default mode also validates that artifact file pointers listed in `agent-log` evidence exist on disk. Use `--lax` only when cleaning up legacy repos with stale historical logs.
396
+ - Treats legacy changes missing `context-manifest.md` as errors
334
397
 
335
398
  Pre-commit hook uses `--strict` by default (installed via `cdd-kit install-hooks`).
336
399
 
337
400
  ```
338
- gate passed for change: add-jwt-auth
401
+ ?? gate passed for change: add-jwt-auth
339
402
 
340
- gate failed for change: feat-001
341
- change-classification.md: appears to be a stub (< 200 meaningful chars)
342
- ✗ Tier 1 change requires agent-log/e2e-resilience-engineer.yml
343
- ✗ 1 task(s) still pending (mark archive items in archive-tasks frontmatter; mark N/A items as status: skipped)
403
+ ?? gate failed for change: feat-001
404
+ ?? change-classification.md: appears to be a stub (< 200 meaningful chars)
405
+ ?? 1 task(s) still pending (mark archive items in archive-tasks frontmatter; mark N/A items as status: skipped)
344
406
  ```
345
407
 
346
408
  ---
@@ -368,11 +430,11 @@ Physically moves a completed change from `specs/changes/` to `specs/archive/<yea
368
430
 
369
431
  ```bash
370
432
  cdd-kit archive add-jwt-auth
371
- # Archived: specs/changes/add-jwt-auth specs/archive/2026/add-jwt-auth
372
- # Index updated: specs/archive/INDEX.md
433
+ # ?? Archived: specs/changes/add-jwt-auth ??specs/archive/2026/add-jwt-auth
434
+ # ?? Index updated: specs/archive/INDEX.md
373
435
  ```
374
436
 
375
- Warns (but does not block) if `tasks.yml` has pending items or `status: gate-blocked`. Use after `/cdd-close` the skill runs this automatically at the end.
437
+ Warns (but does not block) if `tasks.yml` has pending items or `status: gate-blocked`. Use after `/cdd-close` ??the skill runs this automatically at the end.
376
438
 
377
439
  ---
378
440
 
@@ -382,7 +444,7 @@ Marks a change as abandoned. Updates `tasks.yml` status to `abandoned`, records
382
444
 
383
445
  ```bash
384
446
  cdd-kit abandon add-jwt-auth --reason "using Auth0 instead"
385
- # Change add-jwt-auth marked as abandoned.
447
+ # ?? Change add-jwt-auth marked as abandoned.
386
448
  ```
387
449
 
388
450
  ---
@@ -401,10 +463,11 @@ cdd-kit migrate --all --enable-context-governance
401
463
  What it upgrades:
402
464
  - `tasks.yml`: converts legacy `tasks.md` checklist/frontmatter into structured YAML task records
403
465
  - `change-classification.md`: detects old `**Tier:** Tier N` format and appends the new `## Tier\n- N` section so tier-based gate checks activate
404
- - `context-manifest.md`: adds a legacy manifest scaffold by default so old changes can continue with warning-only context audit behavior
405
- - `--enable-context-governance`: explicitly adds `context-governance: v1` and a context-governed manifest scaffold, making missing manifest or malformed `files-read` data hard gate failures
466
+ - `implementation-plan.md`: adds the execution-plan scaffold required before backend/frontend/test implementation agents continue
467
+ - `context-manifest.md`: adds a legacy manifest scaffold by default so old changes can use the same pre-read planning layer
468
+ - `--enable-context-governance`: explicitly adds `context-governance: v1` and a context-governed manifest scaffold for pre-read planning
406
469
 
407
- `agent-log/*.yml` must use this `files-read` format for context-governed changes:
470
+ If you choose to emit `agent-log/*.yml`, keep `files-read` optional and concise:
408
471
 
409
472
  ```yaml
410
473
  files-read:
@@ -412,10 +475,8 @@ files-read:
412
475
  - src/server/routes/users.ts
413
476
  ```
414
477
 
415
- Paths must be repo-relative. Absolute paths and `..` parent traversal are rejected.
416
- If a logged read is legitimate but gate says it is unauthorized, add that path
417
- to `context-manifest.md` `## Allowed Paths` or approve a Context Expansion
418
- Request. Do not remove it from `files-read`; that list is the audit trail.
478
+ Paths should be repo-relative. Do not reconstruct this list after the fact;
479
+ use `cdd-kit context check` before invoking agents when read scope matters.
419
480
 
420
481
  Run this after upgrading from v1.10 or earlier if you have mid-flight changes.
421
482
 
@@ -449,11 +510,10 @@ cdd-kit context check add-todos-ui --path src/components/Sidebar.vue src/stores/
449
510
  cdd-kit context check add-ci-gate --path contracts/ci/ci-gate-contract.md .github/workflows/contract-driven-gates.yml
450
511
  ```
451
512
 
452
- The check uses the same authorization model as `cdd-kit gate`: `## Allowed
453
- Paths`, `## Approved Expansions`, repo-relative path rules, and the forbidden
454
- baseline in `.cdd/context-policy.json`. If the command fails and the read is
455
- legitimate, update the manifest or record/approve a Context Expansion Request
456
- before the agent reads the file.
513
+ The check uses `## Allowed Paths`, `## Approved Expansions`, repo-relative path
514
+ rules, and the forbidden baseline in `.cdd/context-policy.json`. If the command
515
+ fails and the read is legitimate, update the manifest or record/approve a
516
+ Context Expansion Request before the agent reads the file.
457
517
 
458
518
  ---
459
519
 
@@ -466,7 +526,7 @@ cdd-kit context approve add-jwt-auth CER-001
466
526
  cdd-kit context approve add-jwt-auth --all-pending # bulk approve every pending request
467
527
  ```
468
528
 
469
- This keeps expansion history explicit while avoiding manual manifest editing. Agents still have to report `files-read` in `agent-log/*.yml`; `cdd-kit gate` audits those paths against the manifest.
529
+ This keeps expansion history explicit while avoiding manual manifest editing.
470
530
 
471
531
  ---
472
532
 
@@ -531,7 +591,7 @@ Installs a pre-commit Git hook that auto-runs `cdd-kit gate --strict` on any sta
531
591
 
532
592
  ```bash
533
593
  cdd-kit install-hooks
534
- # pre-commit hook installed at .git/hooks/pre-commit
594
+ # ?? pre-commit hook installed at .git/hooks/pre-commit
535
595
  ```
536
596
 
537
597
  Idempotent. Preserves existing hook content. Bypass with `--no-verify` is possible but defeats enforcement.
@@ -595,8 +655,8 @@ The classifier should read these two files before proposing `context-manifest.md
595
655
 
596
656
  ```bash
597
657
  npm update -g contract-driven-delivery
598
- cdd-kit upgrade --yes
599
- cdd-kit context-scan
658
+ cdd-kit refresh --yes
659
+ cdd-kit migrate --all
600
660
  cdd-kit doctor --strict
601
661
  ```
602
662
 
@@ -610,7 +670,9 @@ git add specs/changes/
610
670
  git commit -m "chore: migrate changes to current cdd-kit format"
611
671
  ```
612
672
 
613
- This gives those legacy specs a new `tasks.yml`, tier markers, and a warning-mode `context-manifest.md` without forcing strict context governance on closed work.
673
+ This gives those legacy specs a new `tasks.yml`, tier markers,
674
+ `implementation-plan.md`, and a warning-mode `context-manifest.md` without
675
+ forcing strict context governance on closed work.
614
676
 
615
677
  ### Old in-progress specs
616
678
 
@@ -624,15 +686,15 @@ cdd-kit doctor --strict
624
686
 
625
687
  Then choose one path per active change:
626
688
 
627
- - Conservative path: keep the migrated legacy manifest, resume work, and let `gate` warn on missing `files-read` data while the team transitions.
628
- - Strict path: run `cdd-kit migrate <change-id> --enable-context-governance`, review `context-manifest.md`, narrow `Allowed Paths`, and require agents to report `- files-read:` before continuing implementation.
689
+ - Conservative path: keep the migrated legacy manifest and resume work; use `context check` before invoking agents.
690
+ - Tight context path: run `cdd-kit migrate <change-id> --enable-context-governance`, review `context-manifest.md`, narrow `Allowed Paths`, fill `implementation-plan.md`, and use `cdd-kit context check` before invoking agents.
629
691
 
630
692
  ### Recommended rollout for production repos already burned by token overuse
631
693
 
632
- 1. Run `cdd-kit upgrade --yes` once per repo after updating the npm package.
633
- 2. Run `cdd-kit context-scan` so classifiers can read `specs/context/project-map.md` and `specs/context/contracts-index.md` instead of broad repo searches.
634
- 3. Run `cdd-kit doctor --strict` in CI.
635
- 4. Migrate old completed specs with plain `cdd-kit migrate`.
694
+ 1. Run `cdd-kit refresh --yes` once per repo after updating the npm package.
695
+ 2. Run `cdd-kit migrate --all` so existing active changes receive the current required artifact set.
696
+ 3. Review and fill `implementation-plan.md` before resuming implementation agents on active changes.
697
+ 4. Run `cdd-kit doctor --strict` in CI.
636
698
  5. Migrate active specs with `cdd-kit migrate --enable-context-governance` only after reviewing the generated manifest.
637
699
  6. Teach agents to use `cdd-kit context request/approve/reject/list` instead of silently widening context.
638
700
 
@@ -642,31 +704,31 @@ Then choose one path per active change:
642
704
 
643
705
  ```
644
706
  your-repo/
645
- ├── contracts/
646
- │ ├── api/api-contract.md what endpoints exist and how they behave
647
- │ ├── css/css-contract.md design tokens, component states
648
- │ ├── data/data-shape-contract.md schemas, types, nullability
649
- │ ├── env/env-contract.md every env var, secret flags, defaults
650
- │ ├── business/business-rules.md rules, edge cases, decision tables
651
- │ └── ci/ci-gate-contract.md gate tiers, promotion, rollback
652
- ├── specs/
653
- │ ├── project-profile.md overall system description
654
- │ ├── changes/ active in-progress changes
655
- │ │ └── <change-id>/
656
- │ │ ├── change-request.md (required)
657
- │ │ ├── change-classification.md (required)
658
- │ │ ├── test-plan.md (required)
659
- │ │ ├── ci-gates.md (required)
660
- │ │ ├── tasks.yml (required)
661
- │ │ └── agent-log/ machine-verifiable evidence per agent
662
- │ ├── archive/ completed and abandoned changes
663
- │ │ ├── INDEX.md
664
- │ │ └── 2026/<change-id>/
665
- │ └── templates/
666
- ├── tests/
667
- ├── CLAUDE.md Claude's project guide (edit this)
668
- ├── AGENTS.md agent roster (auto-managed)
669
- └── CODEX.md Codex project guide when initialized for Codex
707
+ ???€ contracts/
708
+ ?? ???€ api/api-contract.md ??what endpoints exist and how they behave
709
+ ?? ???€ css/css-contract.md ??design tokens, component states
710
+ ?? ???€ data/data-shape-contract.md ??schemas, types, nullability
711
+ ?? ???€ env/env-contract.md ??every env var, secret flags, defaults
712
+ ?? ???€ business/business-rules.md ??rules, edge cases, decision tables
713
+ ?? ???€ ci/ci-gate-contract.md ??gate tiers, promotion, rollback
714
+ ???€ specs/
715
+ ?? ???€ project-profile.md ??overall system description
716
+ ?? ???€ changes/ ??active in-progress changes
717
+ ?? ?? ???€ <change-id>/
718
+ ?? ?? ???€ change-request.md (required)
719
+ ?? ?? ???€ change-classification.md (required)
720
+ ?? ?? ???€ test-plan.md (required)
721
+ ?? ?? ???€ ci-gates.md (required)
722
+ ?? ?? ???€ tasks.yml (required)
723
+ ?? ?? ???€ agent-log/ optional handoff notes
724
+ ?? ???€ archive/ ??completed and abandoned changes
725
+ ?? ?? ???€ INDEX.md
726
+ ?? ?? ???€ 2026/<change-id>/
727
+ ?? ???€ templates/
728
+ ???€ tests/
729
+ ???€ CLAUDE.md ??Claude's project guide (edit this)
730
+ ???€ AGENTS.md ??agent roster (auto-managed)
731
+ ???€ CODEX.md ??Codex project guide when initialized for Codex
670
732
  ```
671
733
 
672
734
  ---
@@ -675,9 +737,9 @@ your-repo/
675
737
 
676
738
  | Tier | Risk level | Example changes | Extra agents |
677
739
  |---|---|---|---|
678
- | 0–1 | High / critical | Auth, payments, migrations, concurrency | E2E + monkey + stress/soak |
679
- | 2–3 | Medium | Feature with API change, bug fix with behavior change | Contract review + QA |
680
- | 4–5 | Low | Docs, prompts, config only, no behavior change | Contract review + QA |
740
+ | 0?? | High / critical | Auth, payments, migrations, concurrency | E2E + monkey + stress/soak |
741
+ | 2?? | Medium | Feature with API change, bug fix with behavior change | Contract review + QA |
742
+ | 4?? | Low | Docs, prompts, config only, no behavior change | Contract review + QA |
681
743
 
682
744
  ---
683
745
 
@@ -6,6 +6,7 @@ Use these agents as reusable Claude Code subagents. Project-level agents may be
6
6
 
7
7
  - `change-classifier`: routes requests into change types and required artifacts.
8
8
  - `repo-context-scanner`: detects tech stack, commands, contracts, tests, and CI/CD.
9
+ - `implementation-planner`: writes the execution plan that implementation agents follow.
9
10
  - `spec-architect`: evaluates architectural impact and produces design constraints.
10
11
  - `contract-reviewer`: owns API, CSS, env, data, business, and CI contract consistency.
11
12
  - `test-strategist`: maps acceptance criteria to test families.
@@ -52,14 +52,18 @@ For context-governed changes, read `specs/changes/<change-id>/context-manifest.m
52
52
  reads are legitimate, expand `Allowed Paths` or approve a Context Expansion
53
53
  Request before the agent reads the files.
54
54
  - If more context is needed, stop and write a Context Expansion Request in the manifest (`cdd-kit context request`).
55
- - The full agent-log format (including `files-read:` schema) is defined in
55
+ - Optional agent-log notes are defined in
56
56
  `~/.claude/skills/contract-driven-delivery/references/agent-log-protocol.md`.
57
57
  Read that once; do not paraphrase it elsewhere.
58
58
 
59
59
  ## CDD Operational Notes
60
60
 
61
- - After each agent returns, verify its agent-log exists, tick the related
62
- `tasks.yml` items immediately, and only then move to the next agent.
61
+ - After each agent returns, tick the related `tasks.yml` items immediately,
62
+ and only then move to the next agent.
63
+ - Do not start backend/frontend/test implementation agents until
64
+ `implementation-plan.md` is ready; implementation agents should follow that
65
+ plan and report `blocked` instead of inferring missing scope from chat
66
+ history.
63
67
  - Pre-existing test failures may be excluded from the current gate only when
64
68
  `qa-report.md` records the failing test, baseline evidence, why it is outside
65
69
  scope, owner, and follow-up.
@@ -22,9 +22,9 @@ Read `specs/changes/<change-id>/context-manifest.md` before using file-reading o
22
22
  Request before the agent reads the files.
23
23
  - Do not use broad repository search unless the manifest authorizes it.
24
24
  - If more context is needed, stop and write a Context Expansion Request in the manifest.
25
- - Record every file read through tools in the relevant `agent-log/*.yml` under `files-read:`.
25
+ - Optional `agent-log/*.yml` notes may include `files-read:` when that list is cheap and accurate.
26
26
 
27
- Required `agent-log/*.yml` format:
27
+ Optional `agent-log/*.yml` read note:
28
28
 
29
29
  ```yaml
30
30
  files-read:
@@ -32,7 +32,7 @@ files-read:
32
32
  - src/server/routes/users.ts
33
33
  ```
34
34
 
35
- Every entry must be a repo-relative path. Do not omit files, use absolute paths, or use `..`.
35
+ Every entry should be a repo-relative path. Do not reconstruct this list after the fact.
36
36
 
37
37
  ## Hot And Cold Data
38
38
 
@@ -44,8 +44,12 @@ Cold historical data is evidence, not current requirements.
44
44
 
45
45
  ## Operational Notes
46
46
 
47
- - After each agent returns, verify its agent-log exists, tick the related
48
- `tasks.yml` items immediately, and only then move to the next agent.
47
+ - After each agent returns, tick the related `tasks.yml` items immediately,
48
+ then move to the next agent.
49
+ - Do not start backend/frontend/test implementation agents until
50
+ `implementation-plan.md` is ready; implementation agents should follow that
51
+ plan and report `blocked` instead of inferring missing scope from chat
52
+ history.
49
53
  - Pre-existing test failures may be excluded from the current gate only when
50
54
  `qa-report.md` records the failing test, baseline evidence, why it is outside
51
55
  scope, owner, and follow-up.