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
@@ -1,15 +1,15 @@
1
- ---
1
+ ---
2
2
  name: cdd-new
3
3
  description: Start a new tracked change. Scaffolds all required artifacts, classifies the change by risk tier, commissions the right agents in order, and runs cdd-kit gate. Args: <change description in natural language>
4
4
  ---
5
5
 
6
- # cdd-new New Change Request
6
+ # cdd-new ??New Change Request
7
7
 
8
8
  ## Mental model
9
9
 
10
- - `contracts/` = the single source of truth (live always reflects current system behaviour)
10
+ - `contracts/` = the single source of truth (live ??always reflects current system behaviour)
11
11
  - `tests/` = proof the contracts hold (live)
12
- - `specs/changes/<id>/` = why we decided this back then (passive archive read only when investigating history, never as input to planning)
12
+ - `specs/changes/<id>/` = why we decided this back then (passive archive ??read only when investigating history, never as input to planning)
13
13
  - `CLAUDE.md` = what this project is and how to start work
14
14
 
15
15
  ## Spec depth rules
@@ -17,20 +17,20 @@ description: Start a new tracked change. Scaffolds all required artifacts, class
17
17
  Every artifact under `specs/changes/<id>/` answers **WHAT** and **WHY**, not HOW.
18
18
 
19
19
  Soft caps (guidance, not gate-enforced):
20
- - `spec.md` 200 lines
21
- - `design.md` 150 lines
22
- - `test-plan.md` 100 lines
23
- - `ci-gates.md` 80 lines
20
+ - `spec.md` ??200 lines
21
+ - `design.md` ??150 lines
22
+ - `test-plan.md` ??100 lines
23
+ - `ci-gates.md` ??80 lines
24
24
 
25
25
  **Forbidden in spec artifacts** (these belong in code/tests, not specs):
26
- - SQL DDL or migration code put in migrations/, reference the path
27
- - ORM model code (SQLAlchemy, Prisma, etc.) put in source, reference the module
28
- - Full test function bodies, mock setup, fixture data, expected JSON payloads put in tests/
26
+ - SQL DDL or migration code ??put in migrations/, reference the path
27
+ - ORM model code (SQLAlchemy, Prisma, etc.) ??put in source, reference the module
28
+ - Full test function bodies, mock setup, fixture data, expected JSON payloads ??put in tests/
29
29
  - Runnable code blocks > 10 lines belong in source files, not specs. Pseudocode and mapping tables are fine at any length.
30
30
  - Per-test input/output tables with more than 15 rows (data-boundary tests with up to 15 boundary cases are acceptable)
31
31
 
32
32
  **test-plan.md should contain:**
33
- - Acceptance criteria test family mapping (table)
33
+ - Acceptance criteria ??test family mapping (table)
34
34
  - Test file paths and test names (one line per test, no implementation detail)
35
35
  - Tier assignment per family
36
36
  - Out-of-scope list
@@ -70,43 +70,40 @@ Before I start a tracked change, I need to lock down three things:
70
70
 
71
71
  Affected surface: <best guess from request, or empty>
72
72
  Desired behavior: <best guess, or empty>
73
- Success criterion: <empty please fill>
73
+ Success criterion: <empty ??please fill>
74
74
 
75
75
  Could you confirm or fill in the missing pieces?
76
76
  ```
77
77
 
78
78
  Only proceed to Step 1 once all three are answered or the user explicitly says
79
79
  "proceed without success criterion". Record the user's clarifications verbatim
80
- in `change-request.md` § Original Request.
80
+ in `change-request.md` Original Request.
81
81
 
82
82
  The cost of this step: 1 short message round-trip. The cost of skipping it:
83
- one full classifier+contract-reviewer cycle, often 5-10× more tokens, plus an
83
+ one full classifier+contract-reviewer cycle, often 5-10? more tokens, plus an
84
84
  inevitable re-classification when the agents discover the ambiguity.
85
85
 
86
86
  ---
87
87
 
88
88
  ## Write Responsibilities
89
89
 
90
- **This distinction is critical follow it for every step:**
90
+ **This distinction is critical ??follow it for every step:**
91
91
 
92
- | Agent type | Who writes artifact files | Who writes agent-log | Who updates tasks.yml |
93
- |------------|--------------------------|----------------------|----------------------|
94
- | Read-only agents (no Edit tool): `change-classifier`, `contract-reviewer`, `qa-reviewer`, `visual-reviewer`, `dependency-security-reviewer`, `ui-ux-reviewer` | YOU (main Claude) | YOU (main Claude) | YOU (main Claude) |
95
- | Write-capable agents (have Edit): `backend-engineer`, `frontend-engineer`, `e2e-resilience-engineer`, `monkey-test-engineer`, `stress-soak-engineer`, `ci-cd-gatekeeper`, `test-strategist`, `spec-architect` | The agent itself | The agent itself | YOU (main Claude) |
92
+ | Agent type | Who writes artifact files | Who writes optional handoff notes | Who updates tasks.yml |
93
+ |------------|--------------------------|----------------------------------|----------------------|
94
+ | Read-only agents (no Edit tool): `change-classifier`, `contract-reviewer`, `qa-reviewer`, `visual-reviewer`, `dependency-security-reviewer`, `ui-ux-reviewer` | YOU (main Claude) | YOU, only when useful | YOU (main Claude) |
95
+ | Write-capable agents (have Edit): `implementation-planner`, `backend-engineer`, `frontend-engineer`, `e2e-resilience-engineer`, `monkey-test-engineer`, `stress-soak-engineer`, `ci-cd-gatekeeper`, `test-strategist`, `spec-architect` | The agent itself | The agent itself, only when useful | YOU (main Claude) |
96
96
 
97
97
  **Rule**: After EVERY agent completes (whether it writes itself or you write for it), YOU must update the relevant `tasks.yml` task `status:` from `pending` to `done`.
98
98
 
99
99
  **Agent-log pointer rule**: When you or an agent writes `artifacts[].pointer`,
100
- follow `references/agent-log-protocol.md` exactly. If the text before the first
101
- `:` contains `/`, `cdd-kit gate` treats that text as a repo-relative file path
102
- and verifies that the file exists. Therefore each pointer may name only one
103
- file, file pointers must not include parenthetical notes on the path, and
104
- slash-containing labels such as `I/O:` or `WARNING/OVERDUE:` must not be used as
105
- pointer prefixes. Put extra explanation in `notes` or a separate non-path
106
- artifact pointer instead.
100
+ follow `references/agent-log-protocol.md`. If the text before the first `:` contains `/`, treat it as one repo-relative file path, and one pointer names one file only. File pointers must not
101
+ include parenthetical notes on the path, and slash-containing labels such as
102
+ `I/O:` or `WARNING/OVERDUE:` must not be used as pointer prefixes. Put extra
103
+ explanation in `notes` or a separate non-path artifact pointer instead.
107
104
 
108
105
  **Durable learning rule**: During `/cdd-new`, agents record evidence and
109
- findings in artifacts and `agent-log/*.yml` only. Do not promote durable lessons
106
+ findings in artifacts and optional handoff notes only. Do not promote durable lessons
110
107
  while the change is still active. Durable learning promotion happens only during
111
108
  `/cdd-close` Step 3, where main Claude cross-checks evidence and writes approved
112
109
  rules to `contracts/` or project guidance (`CLAUDE.md`/`CODEX.md`).
@@ -117,11 +114,11 @@ rules to `contracts/` or project guidance (`CLAUDE.md`/`CODEX.md`).
117
114
 
118
115
  Only create optional artifacts (`current-behavior.md`, `proposal.md`, `spec.md`, `design.md`, `qa-report.md`, `regression-report.md`) when the classifier's `change-classification.md` explicitly marks them as `yes`.
119
116
 
120
- Note: `archive.md` is created during `/cdd-close`, not during `/cdd-new` it is not part of the classifier's opt-in surface.
117
+ Note: `archive.md` is created during `/cdd-close`, not during `/cdd-new` ??it is not part of the classifier's opt-in surface.
121
118
 
122
- If the classifier marks an artifact as `no` or leaves it blank, **do not create the file** even if a review agent could contribute to it.
119
+ If the classifier marks an artifact as `no` or leaves it blank, **do not create the file** ??even if a review agent could contribute to it.
123
120
 
124
- The 6 always-required artifacts are: `change-request.md`, `change-classification.md`, `test-plan.md`, `ci-gates.md`, `tasks.yml`, and `context-manifest.md`.
121
+ The 7 always-required artifacts are: `change-request.md`, `change-classification.md`, `implementation-plan.md`, `test-plan.md`, `ci-gates.md`, `tasks.yml`, and `context-manifest.md`.
125
122
 
126
123
  ## Step 1: Generate change-id, scaffold, and scan context
127
124
 
@@ -153,7 +150,7 @@ cdd-kit context-scan
153
150
  Do not use broad search or ad hoc reads to classify the change before `context-scan` has completed.
154
151
 
155
152
  The generated scaffold contains the artifacts listed in the table below. **All
156
- templates are written from disk by `cdd-kit new` do not paste template bodies
153
+ templates are written from disk by `cdd-kit new` ??do not paste template bodies
157
154
  into this prompt.** The on-disk source of truth lives in `specs/templates/` of
158
155
  the kit and is bundled into every install.
159
156
 
@@ -161,6 +158,7 @@ the kit and is bundled into every install.
161
158
  |---|---|---|
162
159
  | `change-request.md` | `specs/templates/change-request.md` | Fill the `## Original Request` section with the user's exact description before invoking the classifier; leave the rest blank |
163
160
  | `change-classification.md` | `specs/templates/change-classification.md` | Replace blank template with classifier output (Step 2) |
161
+ | `implementation-plan.md` | `specs/templates/implementation-plan.md` | `implementation-planner` writes this directly after contracts, tests, design, and CI gate plan are known |
164
162
  | `test-plan.md` | `specs/templates/test-plan.md` | `test-strategist` writes this directly |
165
163
  | `ci-gates.md` | `specs/templates/ci-gates.md` | `ci-cd-gatekeeper` writes this directly |
166
164
  | `tasks.yml` | `specs/templates/tasks.yml` | Tick checkboxes as agents complete; backfill `tier:` frontmatter from classifier (Step 2.4) |
@@ -190,7 +188,7 @@ The classifier must include a `## Context Manifest Draft` section with:
190
188
  - required tests
191
189
  - any context expansion requests that must be approved before implementation
192
190
 
193
- **change-classifier is read-only** it will return its output as text.
191
+ **change-classifier is read-only** ??it will return its output as text.
194
192
 
195
193
  ### If the classifier returns `## Atomic Split Proposal`
196
194
 
@@ -204,31 +202,31 @@ NOT proceed with the rest of `/cdd-new`. Instead:
204
202
  - For each row in the proposal table, run `cdd-kit new <change-id>` with
205
203
  the listed `--depends-on`.
206
204
  - Then say: "I created N change directories. Want me to run `/cdd-new`
207
- against the first one now?" wait for confirmation; do not auto-loop.
205
+ against the first one now?" ??wait for confirmation; do not auto-loop.
208
206
  4. If user picks "force monolithic":
209
207
  - Re-invoke change-classifier with `force-monolithic` appended to the
210
208
  change-request and proceed with whatever Tier the classifier returns.
211
209
  5. Delete the partially-scaffolded change directory you created in Step 1
212
210
  if the user picked "separate" and the originally-derived change-id is
213
- not in the proposal it would otherwise sit empty and confuse `cdd-kit
211
+ not in the proposal ??it would otherwise sit empty and confuse `cdd-kit
214
212
  list`.
215
213
 
216
214
  ### Classifier output lint (B8): refuse stub responses
217
215
 
218
216
  Before writing any files, verify the classifier response contains:
219
217
 
220
- - `## Tier` followed by `- N` where N is a single digit 0-5 (NOT `0 / 1 / 2 / 3 / 4 / 5` that is the unfilled placeholder).
218
+ - `## Tier` followed by `- N` where N is a single digit 0-5 (NOT `0 / 1 / 2 / 3 / 4 / 5` ??that is the unfilled placeholder).
221
219
  - `## Required Agents` with at least one agent name.
222
- - `## Inferred Acceptance Criteria` with at least one filled `AC-1: …` line.
220
+ - `## Inferred Acceptance Criteria` with at least one filled `AC-1: ?圳 line.
223
221
 
224
- If any of these are missing or still hold the literal placeholder text, STOP. Re-prompt the classifier with the missing pieces named explicitly. Do NOT write classification.md gate will reject it as a stub anyway and you will have wasted the round-trip.
222
+ If any of these are missing or still hold the literal placeholder text, STOP. Re-prompt the classifier with the missing pieces named explicitly. Do NOT write classification.md ??gate will reject it as a stub anyway and you will have wasted the round-trip.
225
223
 
226
224
  ### When the classifier output passes lint
227
225
 
228
- 1. **YOU write** `specs/changes/<change-id>/change-classification.md` replace the blank template with the classifier's classification output.
229
- 2. **YOU write** `specs/changes/<change-id>/agent-log/change-classifier.yml` copy the Agent Log block from the classifier's response.
226
+ 1. **YOU write** `specs/changes/<change-id>/change-classification.md` ??replace the blank template with the classifier's classification output.
227
+ 2. Optional: write `specs/changes/<change-id>/agent-log/change-classifier.yml` only if the classifier returned useful handoff evidence.
230
228
  3. **YOU update** `specs/changes/<change-id>/context-manifest.md` from the classifier's `## Context Manifest Draft`.
231
- 4. **YOU update** `tasks.yml` frontmatter: set `tier: <N>` to the classifier's tier digit. This is now the authoritative source for `cdd-kit gate` tier-based agent enforcement (the classification.md `## Tier` section is fallback only).
229
+ 4. **YOU update** `tasks.yml` frontmatter: set `tier: <N>` to the classifier's tier digit. This is now the authoritative source for quality-gate tier checks (the classification.md `## Tier` section is fallback only).
232
230
  5. **YOU tick** `tasks.yml` item `1.1`.
233
231
 
234
232
  Wait until these five writes are done before continuing.
@@ -241,11 +239,11 @@ Wait until these five writes are done before continuing.
241
239
 
242
240
  Read `change-classification.md` to determine the tier. Then invoke agents **in the exact order below**.
243
241
 
244
- **For each read-only agent**: wait for its text response YOU write its artifact file(s) YOU write its agent-log YOU tick relevant tasks.yml item(s).
242
+ **For each read-only agent**: wait for its text response ??YOU write its artifact file(s) ??YOU write an optional handoff note when useful ??YOU tick relevant tasks.yml item(s).
245
243
 
246
- **For each write-capable agent**: wait for it to confirm completion YOU tick relevant tasks.yml item(s).
244
+ **For each write-capable agent**: wait for it to confirm completion ??YOU tick relevant tasks.yml item(s).
247
245
 
248
- If any agent sets `status: blocked` in its log, halt immediately and report the agent's `next-action` to the user do not proceed to subsequent agents.
246
+ If any agent reports `blocked`, halt immediately and surface its concrete next action to the user ??do not proceed to subsequent agents.
249
247
 
250
248
  **When invoking any agent, always begin the prompt with:**
251
249
  ```
@@ -263,14 +261,13 @@ cdd-kit context check <change-id> --path <repo-relative path> [more paths...]
263
261
 
264
262
  If the check fails and the paths are legitimate work scope, update
265
263
  `context-manifest.md` `## Allowed Paths` or approve a Context Expansion Request
266
- before the agent reads them. This catches common late gate failures such as UI
267
- components/stores/views or CI workflow files missing from the manifest.
264
+ before the agent reads them. This keeps read scope explicit before broad source
265
+ access, especially for UI components/stores/views or CI workflow files.
268
266
 
269
267
  After every agent returns, complete the closeout before starting the next
270
268
  agent:
271
- - confirm its `agent-log/<agent>.yml` exists or write it for read-only agents
272
- - confirm the log has a completed status (`complete`, `done`, or `approved`) or
273
- halt on `blocked`
269
+ - confirm required artifacts exist; optional handoff notes are not gate inputs
270
+ - if the agent reports `blocked`, halt and surface its concrete next action
274
271
  - tick the owned `tasks.yml` items immediately
275
272
  - record incidental/pre-existing findings in the appropriate report instead of
276
273
  silently fixing unrelated scope
@@ -285,30 +282,31 @@ the user; do not put them inside the prompt sent to the agent.
285
282
 
286
283
  | Stage | Agent | Badge |
287
284
  |---|---|---|
288
- | Decision | `change-classifier` | 🟣 `[classifier]` |
289
- | Decision | `spec-architect` | 🟣 `[architect]` |
290
- | Implementation | `backend-engineer` | 🔵 `[backend]` |
291
- | Implementation | `frontend-engineer` | 🔵 `[frontend]` |
292
- | Implementation | `ci-cd-gatekeeper` | 🔵 `[ci-cd]` |
293
- | Implementation | `test-strategist` | 🟡 `[test-plan]` |
294
- | Heavy testing (Tier 0–1 only) | `e2e-resilience-engineer` | 🟠 `[e2e]` |
295
- | Heavy testing (Tier 0–1 only) | `monkey-test-engineer` | 🟠 `[monkey]` |
296
- | Heavy testing (Tier 0–1 only) | `stress-soak-engineer` | 🟠 `[stress]` |
297
- | Review | `contract-reviewer` | 🟢 `[contracts]` |
298
- | Review | `qa-reviewer` | 🟢 `[qa]` |
299
- | Review | `ui-ux-reviewer` | 🟢 `[ui-ux]` |
300
- | Review | `visual-reviewer` | 🟢 `[visual]` |
301
- | Review | `dependency-security-reviewer` | 🟢 `[deps-sec]` |
302
- | Audit | `spec-drift-auditor` | `[drift]` |
303
- | Audit | `repo-context-scanner` | ⚫ `[repo-scan]` |
285
+ | Decision | `change-classifier` | ? `[classifier]` |
286
+ | Decision | `spec-architect` | ? `[architect]` |
287
+ | Decision | `implementation-planner` | ? `[plan]` |
288
+ | Implementation | `backend-engineer` | ? `[backend]` |
289
+ | Implementation | `frontend-engineer` | ? `[frontend]` |
290
+ | Implementation | `ci-cd-gatekeeper` | ? `[ci-cd]` |
291
+ | Implementation | `test-strategist` | ? `[test-plan]` |
292
+ | Heavy testing (Tier 0?? only) | `e2e-resilience-engineer` | ?? `[e2e]` |
293
+ | Heavy testing (Tier 0?? only) | `monkey-test-engineer` | ?? `[monkey]` |
294
+ | Heavy testing (Tier 0?? only) | `stress-soak-engineer` | ?? `[stress]` |
295
+ | Review | `contract-reviewer` | ? `[contracts]` |
296
+ | Review | `qa-reviewer` | ? `[qa]` |
297
+ | Review | `ui-ux-reviewer` | ? `[ui-ux]` |
298
+ | Review | `visual-reviewer` | ? `[visual]` |
299
+ | Review | `dependency-security-reviewer` | ? `[deps-sec]` |
300
+ | Audit | `spec-drift-auditor` | ??`[drift]` |
301
+ | Audit | `repo-context-scanner` | ??`[repo-scan]` |
304
302
 
305
303
  Color semantics:
306
- - 🟣 purple: deciding what we will do (heavy model, `opus`)
307
- - 🔵 blue: writing code (`sonnet` implementation)
308
- - 🟡 yellow: planning tests (`sonnet`)
309
- - 🟠 orange: heavy testing only appears for Tier 0–1, signals high-risk scope
310
- - 🟢 green: reviewing what was done (no code writes; just verdicts)
311
- - neutral: audits and scans (read-only background work)
304
+ - ? purple: deciding what we will do (heavy model, `opus`)
305
+ - ? blue: writing code (`sonnet` implementation)
306
+ - ? yellow: planning tests (`sonnet`)
307
+ - ?? orange: heavy testing ??only appears for Tier 0??, signals high-risk scope
308
+ - ? green: reviewing what was done (no code writes; just verdicts)
309
+ - ??neutral: audits and scans (read-only background work)
312
310
 
313
311
  Format: emoji is followed by a single space, then the bracket-tag, then the
314
312
  human-readable narration.
@@ -316,11 +314,10 @@ human-readable narration.
316
314
  Examples:
317
315
 
318
316
  ```
319
- 🟣 [classifier] Reading the request and project map
320
- 🟢 [contracts] Confirming the API contract is unchanged. (read-only)
321
- 🔵 [backend] Implementing the JWT issuance endpoint and writing failing
317
+ ? [classifier] Reading the request and project map??? [contracts] Confirming the API contract is unchanged. (read-only)
318
+ ? [backend] Implementing the JWT issuance endpoint and writing failing
322
319
  tests first per TDD policy.
323
- 🟠 [stress] Tier 1 high-risk change running soak test for 30 min.
320
+ ?? [stress] Tier 1 high-risk change ??running soak test for 30 min.
324
321
  ```
325
322
 
326
323
  These badges are pure narration. They MUST NOT be sent inside the agent's
@@ -329,73 +326,78 @@ prompt; the agent's behavior is defined by the agent prompt files in
329
326
 
330
327
  ---
331
328
 
332
- ### Tier 4–5 (low risk: docs, prompts, config-only, no behavior change)
329
+ ### Tier 4?? (low risk: docs, prompts, config-only, no behavior change)
333
330
 
334
- 1. **`contract-reviewer`** (read-only) confirm no contracts are touched or all touched ones are already updated.
335
- - YOU write: `agent-log/contract-reviewer.yml`
331
+ 1. **`contract-reviewer`** (read-only) ??confirm no contracts are touched or all touched ones are already updated.
332
+ - Optional handoff note: `agent-log/contract-reviewer.yml`
336
333
  - YOU tick: `1.2`, applicable items in section 2
337
334
 
338
- 2. **`qa-reviewer`** (read-only) confirm release readiness.
339
- - YOU write: `agent-log/qa-reviewer.yml`
335
+ 2. **`qa-reviewer`** (read-only) ??confirm release readiness.
336
+ - Optional handoff note: `agent-log/qa-reviewer.yml`
340
337
  - YOU tick: `5.4`
341
338
 
342
339
  ---
343
340
 
344
- ### Tier 2–3 (normal: feature, enhancement, bug fix with behavior change)
341
+ ### Tier 2?? (normal: feature, enhancement, bug fix with behavior change)
345
342
 
346
- 1. **`contract-reviewer`** (read-only) update or create contracts in `contracts/` before any implementation starts.
347
- - YOU write: `agent-log/contract-reviewer.yml`
343
+ 1. **`contract-reviewer`** (read-only) ??update or create contracts in `contracts/` before any implementation starts.
344
+ - Optional handoff note: `agent-log/contract-reviewer.yml`
348
345
  - YOU tick: `1.2`, applicable items in section 2
349
346
 
350
- 2. **`test-strategist`** (write-capable) writes `specs/changes/<change-id>/test-plan.md` directly.
347
+ 2. **`test-strategist`** (write-capable) ??writes `specs/changes/<change-id>/test-plan.md` directly.
351
348
  - YOU tick: applicable items in section 3 based on what test families were planned
352
- - Provide the classifier's `## Inferred Acceptance Criteria` list to test-strategist. These become the `criterion id` column in the Acceptance Criteria Test Mapping table.
349
+ - Provide the classifier's `## Inferred Acceptance Criteria` list to test-strategist. These become the `criterion id` column in the Acceptance Criteria ??Test Mapping table.
353
350
 
354
- 3. **`spec-architect`** (write-capable) only if `change-classification.md` contains `Architecture Review Required: yes`.
351
+ 3. **`spec-architect`** (write-capable) ??only if `change-classification.md` contains `Architecture Review Required: yes`.
355
352
  - YOU tick: `1.3` (if it produced a gate plan)
356
353
 
357
- 4. **`backend-engineer`** (write-capable) if the change touches server, API, data, or business logic. Writes implementation and its own agent-log.
354
+ 4. **`ci-cd-gatekeeper`** (write-capable) ??writes `specs/changes/<change-id>/ci-gates.md` directly before implementation planning.
355
+ - YOU tick: `1.3`, `4.4`, applicable items in section 6
356
+
357
+ 5. **`implementation-planner`** (write-capable) ??writes `specs/changes/<change-id>/implementation-plan.md` directly after classification, contracts, test plan, design, and CI gate plan are available.
358
+ - This is the handoff packet for implementation agents. It should contain execution scope, non-goals, required changes, file-level plan, contract updates, test execution plan, and constraints.
359
+ - If it reports `blocked`, halt and surface the missing decision/context to the user.
360
+ - YOU tick: `1.4`
361
+
362
+ 6. **`backend-engineer`** (write-capable) ??if the change touches server, API, data, or business logic. Writes implementation directly; may write an optional handoff note.
358
363
  - YOU tick: `4.1` and/or `4.3` based on scope
359
- - Note: `tasks.yml` items 3.1–3.2 (unit/contract/integration tests) are written by `backend-engineer` and/or `frontend-engineer` in TDD fashion failing tests first, implementation second. Items 3.3–3.5 are written by dedicated test engineers (Tier 0–1 only or when classifier explicitly requires them).
364
+ - Note: `tasks.yml` items 3.1??.2 (unit/contract/integration tests) are written by `backend-engineer` and/or `frontend-engineer` in TDD fashion ??failing tests first, implementation second. Items 3.3??.5 are written by dedicated test engineers (Tier 0?? only or when classifier explicitly requires them).
360
365
 
361
- 5. **`frontend-engineer`** (write-capable) if the change touches UI, components, or client-side behavior. Writes implementation and its own agent-log.
366
+ 7. **`frontend-engineer`** (write-capable) ??if the change touches UI, components, or client-side behavior. Writes implementation directly; may write an optional handoff note.
362
367
  - YOU tick: `4.2`
363
368
 
364
- 6. **`dependency-security-reviewer`** (read-only) if the change touches lockfiles, package manifests, or DB migrations.
369
+ 8. **`dependency-security-reviewer`** (read-only) ??if the change touches lockfiles, package manifests, or DB migrations.
365
370
  - **Only invoke if** `change-classification.md` lists lockfiles, package manifests, or DB migrations as affected.
366
- - YOU write: `agent-log/dependency-security-reviewer.yml`
371
+ - Optional handoff note: `agent-log/dependency-security-reviewer.yml`
367
372
  - YOU tick: applicable security-related items
368
373
 
369
- 7. **`ui-ux-reviewer`** (read-only) if any UI change (run alongside or after frontend-engineer).
374
+ 9. **`ui-ux-reviewer`** (read-only) ??if any UI change (run alongside or after frontend-engineer).
370
375
  - **Only invoke if** classifier marks UI/CSS as affected.
371
- - YOU write: `agent-log/ui-ux-reviewer.yml`
376
+ - Optional handoff note: `agent-log/ui-ux-reviewer.yml`
372
377
  - YOU tick: `5.1`
373
378
 
374
- 8. **`visual-reviewer`** (read-only) if any UI change (run after ui-ux-reviewer).
379
+ 10. **`visual-reviewer`** (read-only) ??if any UI change (run after ui-ux-reviewer).
375
380
  - **Only invoke if** classifier marks UI/CSS as affected.
376
- - YOU write: `agent-log/visual-reviewer.yml`
381
+ - Optional handoff note: `agent-log/visual-reviewer.yml`
377
382
  - YOU tick: `5.2`
378
383
 
379
- 9. **`ci-cd-gatekeeper`** (write-capable) writes `specs/changes/<change-id>/ci-gates.md` directly.
380
- - YOU tick: `1.3`, `4.4`, applicable items in section 6
381
-
382
- 10. **`qa-reviewer`** (read-only) — release readiness decision (always last).
383
- - YOU write: `agent-log/qa-reviewer.yml`
384
+ 11. **`qa-reviewer`** (read-only) ??release readiness decision (always last).
385
+ - Optional handoff note: `agent-log/qa-reviewer.yml`
384
386
  - YOU tick: `5.4`
385
387
 
386
388
  ---
387
389
 
388
- ### Tier 0–1 (high risk: production data, concurrency, queues, large queries, auth, payments, exports)
390
+ ### Tier 0?? (high risk: production data, concurrency, queues, large queries, auth, payments, exports)
389
391
 
390
- All agents from Tier 2–3, plus insert these after `frontend-engineer` / `backend-engineer` and before `dependency-security-reviewer`:
392
+ All agents from Tier 2??, plus insert these after `frontend-engineer` / `backend-engineer` and before `dependency-security-reviewer`:
391
393
 
392
- - **`e2e-resilience-engineer`** (write-capable) E2E, failure-injection, data-boundary tests. Writes its own agent-log.
394
+ - **`e2e-resilience-engineer`** (write-capable) ??E2E, failure-injection, data-boundary tests. May write an optional handoff note.
393
395
  - YOU tick: `3.3`
394
396
 
395
- - **`monkey-test-engineer`** (write-capable) adversarial input, fuzz, rapid-UI-action tests. Writes its own agent-log.
397
+ - **`monkey-test-engineer`** (write-capable) ??adversarial input, fuzz, rapid-UI-action tests. May write an optional handoff note.
396
398
  - YOU tick: `3.4`
397
399
 
398
- - **`stress-soak-engineer`** (write-capable) load, soak, and long-running stability tests. Writes its own agent-log.
400
+ - **`stress-soak-engineer`** (write-capable) ??load, soak, and long-running stability tests. May write an optional handoff note.
399
401
  - YOU tick: `3.5`
400
402
 
401
403
  ---
@@ -428,20 +430,18 @@ cdd-kit gate <change-id>
428
430
  - YOU tick: `tasks.yml` item `6.1`
429
431
  - Proceed to Step 5.
430
432
 
431
- **If gate fails structured fix-back routing**:
433
+ **If gate fails ??structured fix-back routing**:
432
434
 
433
435
  Capture gate's full stderr verbatim. Parse error lines and route each to the
434
- right owner. The patterns below are exhaustive every gate error message
436
+ right owner. The patterns below are exhaustive ??every gate error message
435
437
  matches one of them.
436
438
 
437
439
  | Error pattern | Route to | Re-invocation prompt seed |
438
440
  |---|---|---|
439
- | `agent-log/<name>.yml: …` | the named agent | "PREVIOUS GATE FAILURE FOR THIS AGENT: <full error line>. Fix only your `agent-log/<name>.yml`. Re-output your Agent Log block." |
440
- | `change-classification.md: …` | `change-classifier` | "PREVIOUS CLASSIFICATION FAILED GATE: <error>. Re-emit only the failing section." |
441
- | `context-manifest.md: …` | `change-classifier` | "PREVIOUS MANIFEST FAILED GATE: <error>. Re-emit `## Context Manifest Draft`." |
442
- | `tasks.yml: …` (frontmatter / pending) | YOU (main Claude) direct edit | n/a fix `tasks.yml` yourself. Don't re-invoke an agent for a file you own. |
443
- | `Tier <N> change requires agent-log/<X>.yml` | invoke the missing agent `<X>` | "TIER <N> REQUIRES THIS LOG. Run your full work, not just the log." |
444
- | `dependency <id>: upstream change is not completed` | n/a — STOP | Tell user: "Upstream change `<id>` must complete before this change can gate. Run `/cdd-new <id>` first or run `cdd-kit archive <id>` if it's already done." |
441
+ | `change-classification.md: ?圳 | `change-classifier` | "PREVIOUS CLASSIFICATION FAILED GATE: <error>. Re-emit only the failing section." |
442
+ | `context-manifest.md: ?圳 | `change-classifier` | "PREVIOUS MANIFEST FAILED GATE: <error>. Re-emit `## Context Manifest Draft`." |
443
+ | `tasks.yml: ?圳 (frontmatter / pending) | YOU (main Claude) ??direct edit | n/a ??fix `tasks.yml` yourself. Don't re-invoke an agent for a file you own. |
444
+ | `dependency <id>: upstream change is not completed` | n/a ??STOP | Tell user: "Upstream change `<id>` must complete before this change can gate. Run `/cdd-new <id>` first or run `cdd-kit archive <id>` if it's already done." |
445
445
  | `validators returned non-zero` | `contract-reviewer` | "PREVIOUS CONTRACT VALIDATION FAILED: <last 10 lines of validator stderr>. Reconcile contracts." |
446
446
 
447
447
  **Re-invocation prompt template** (always use this exact prefix when re-invoking an agent for fix-back):
@@ -457,15 +457,15 @@ FIX TARGET:
457
457
  <the specific file or section that needs to change>
458
458
 
459
459
  REFERENCES:
460
- - references/agent-log-protocol.md (log format)
460
+ - references/agent-log-protocol.md (optional handoff note format, only if useful)
461
461
  - references/<agent-specific-standard>.md (if applicable)
462
462
 
463
463
  Fix this exact issue without re-doing your prior work. Re-output only the
464
- section that changed plus your updated Agent Log block.
464
+ section that changed plus any updated handoff note, if useful.
465
465
  ```
466
466
 
467
467
  After re-invoking, re-run `cdd-kit gate <change-id>`. Repeat up to **3 times**. Each
468
- iteration must be on a strictly smaller error set if the same error returns
468
+ iteration must be on a strictly smaller error set ??if the same error returns
469
469
  twice, halt and surface to user (an agent stuck in a loop is more expensive
470
470
  than a human read).
471
471
 
@@ -501,7 +501,7 @@ Next step:
501
501
  If gate did not pass after 3 iterations:
502
502
 
503
503
  ```
504
- ## /cdd-new gate blocked
504
+ ## /cdd-new ??gate blocked
505
505
 
506
506
  Change ID: <change-id>
507
507
  Gate failed after 3 attempts.
@@ -517,17 +517,18 @@ Please review the above items and re-run: cdd-kit gate <change-id>
517
517
 
518
518
  ## Rules
519
519
 
520
- - Never start implementation (backend/frontend-engineer) before `contract-reviewer` has completed for Tier 0–3 changes
521
- - Never skip `test-plan.md` for Tier 0–3 changes
520
+ - Never start implementation (backend/frontend-engineer) before `contract-reviewer` has completed for Tier 0?? changes
521
+ - Never start implementation (backend/frontend-engineer or dedicated test engineers) before `implementation-plan.md` exists and `tasks.yml` item `1.4` is done
522
+ - Never skip `test-plan.md` for Tier 0?? changes
522
523
  - Never skip `ci-gates.md` for any implementation change
523
- - Every agent must have its `agent-log/<name>.yml` written YOU write it for read-only agents after receiving their response; write-capable agents write their own
524
- - Tick the relevant `tasks.yml` checkbox immediately after each agent completes do not batch
524
+ - Agent logs are optional; do not create them just to satisfy a gate.
525
+ - Tick the relevant `tasks.yml` checkbox immediately after each agent completes ??do not batch
525
526
  - `qa-reviewer` always runs last and makes the release-readiness decision
526
527
 
527
528
  ---
528
529
 
529
530
  ## After Completion
530
531
 
531
- The `/cdd-new` workflow is now complete. **Return to normal assistant mode immediately.** Answer any question the user asks including questions unrelated to this change, new feature discussions, debugging help, or general conversation without requiring them to use a specific command. The git commit shown in the report is a suggestion, not a required next step; do not wait for it before resuming normal behavior.
532
+ The `/cdd-new` workflow is now complete. **Return to normal assistant mode immediately.** Answer any question the user asks ??including questions unrelated to this change, new feature discussions, debugging help, or general conversation ??without requiring them to use a specific command. The git commit shown in the report is a suggestion, not a required next step; do not wait for it before resuming normal behavior.
532
533
 
533
534
  When the change is merged and ready to close, run `/cdd-close <change-id>` to promote durable learnings to `contracts/` or project guidance (`CLAUDE.md`/`CODEX.md`) and archive the change directory.
@@ -42,6 +42,7 @@ Read only these state files first:
42
42
  - `specs/changes/<change-id>/context-manifest.md` if present
43
43
  - `specs/changes/<change-id>/agent-log/*.yml`
44
44
  - `specs/changes/<change-id>/change-classification.md`
45
+ - `specs/changes/<change-id>/implementation-plan.md` if present
45
46
 
46
47
  Do not run broad repository search during resume. Do not read `src/`, `tests/`, or `contracts/` unless the current `context-manifest.md` authorizes that path or an approved expansion lists it.
47
48
 
@@ -54,6 +55,8 @@ Read `specs/changes/<change-id>/agent-log/` to list which agents have already ru
54
55
 
55
56
  Read `specs/changes/<change-id>/change-classification.md` to recall the tier and required agents.
56
57
 
58
+ Read `specs/changes/<change-id>/implementation-plan.md` if it exists. If implementation tasks are still pending and the plan is missing or still a scaffold, resume from `implementation-planner` before invoking backend/frontend/test implementation agents.
59
+
57
60
  Read `specs/changes/<change-id>/context-manifest.md`:
58
61
  - Identify allowed paths and approved expansions.
59
62
  - Identify pending Context Expansion Requests.
@@ -76,6 +79,7 @@ Completed agents: <list from agent-log/>
76
79
  Pending tasks: <list of status: pending items>
77
80
  Pending context expansions: <none | list request ids and paths>
78
81
  Allowed context: <short summary from context-manifest.md>
82
+ Implementation plan: <ready | missing | scaffold | blocked>
79
83
 
80
84
  Next agent to run: <agent-name> (based on tier flow and what's missing)
81
85
  ```
@@ -110,5 +114,6 @@ Continue until all required agents are done, then run `cdd-kit gate <change-id>`
110
114
  - Never start from Step 1 of `/cdd-new` — only resume from the next pending agent
111
115
  - Never use broad search to reconstruct state; resume from `tasks.yml`, `context-manifest.md`, and `agent-log/`
112
116
  - Never continue past pending Context Expansion Requests
117
+ - Never resume backend/frontend/test implementation agents before `implementation-plan.md` is ready
113
118
  - If tasks.yml has `status: abandoned`, report to user and stop
114
119
  - If tasks.yml has `status: gate-blocked`, go directly to gate retry (max 3)
@@ -21,7 +21,7 @@ Use this skill to turn software requests into traceable, testable, CI/CD-gated c
21
21
  - Invoke repo-context-scanner to capture project profile and standardization gaps.
22
22
  3. Select required artifacts.
23
23
  - Use templates in `templates/`.
24
- - Do not force every artifact for tiny changes, but do require `change-classification.md`, `test-plan.md`, and `ci-gates.md` for implementation changes.
24
+ - Do not force every artifact for tiny changes, but do require `change-classification.md`, `implementation-plan.md`, `test-plan.md`, and `ci-gates.md` for implementation changes.
25
25
  4. Update contracts before or alongside implementation. Invoke contract-reviewer to validate API/CSS/env/data/business/CI-CD contracts before or alongside implementation.
26
26
  - API: `references/api-contract-standard.md`
27
27
  - CSS/UI: `references/css-contract-standard.md`
@@ -39,23 +39,29 @@ Use this skill to turn software requests into traceable, testable, CI/CD-gated c
39
39
  - `stress-soak-engineer` implements load, soak, and long-running stability tests.
40
40
  - Invoke the relevant test engineer(s) before or alongside implementation based on the risk tier.
41
41
  - Each engineer must read the matching standard before authoring tests: e2e-resilience-engineer → references/e2e-standard.md, monkey-test-engineer → references/monkey-operation-standard.md, stress-soak-engineer → references/stress-soak-standard.md.
42
- 6. Implement through the right role.
42
+ 6. Produce the implementation plan.
43
+ - Invoke `implementation-planner` after classification, contracts, test-plan, design (if any), and CI gate plan are known.
44
+ - `implementation-plan.md` is the execution packet for implementation agents: scope, non-goals, file-level plan, contract updates, tests, acceptance criteria, and constraints.
45
+ - Keep the plan concise. It should not duplicate the full investigation history or user discussion.
46
+ - If the planner reports missing decisions or context, stop before implementation and resolve that gap.
47
+ 7. Implement through the right role.
43
48
  - Backend/frontend work must follow contracts and tests.
49
+ - Backend/frontend/test implementation agents must read `implementation-plan.md` and should report `blocked` instead of inferring missing requirements from chat history.
44
50
  - Before invoking an agent with known concrete read paths, run
45
51
  `cdd-kit context check <change-id> --path <paths...>` and expand the
46
52
  manifest before the agent reads legitimate missing paths.
47
- - After each agent finishes, verify its agent-log exists and tick the
48
- related `tasks.yml` items before starting the next agent.
53
+ - After each agent finishes, verify the required artifact files exist and
54
+ tick the related `tasks.yml` items before starting the next agent.
49
55
  - UI changes require UI/UX and visual review.
50
56
  - Invoke ui-ux-reviewer for interaction, copy, accessibility, and information hierarchy review whenever UI changes.
51
57
  - Invoke visual-reviewer for layout, responsive, CSS contract, and screenshot diff review whenever UI changes.
52
58
  - If implementation reveals an unexpected boundary or architectural constraint, halt and re-invoke `spec-architect` before continuing.
53
- 7. Run quality gates.
59
+ 8. Run quality gates.
54
60
  - Use `references/qa-gates.md`.
55
61
  - CI/CD gate plan is mandatory.
56
62
  - `qa-reviewer` decides release readiness; Tier 1 gates must be green; Tier 3+ gates must be green or explicitly deferred with a recorded promotion policy.
57
63
  - Invoke ci-cd-gatekeeper to design and enforce the gate plan.
58
- 8. Archive and audit drift.
64
+ 9. Archive and audit drift.
59
65
  - Use `references/spec-drift-policy.md`.
60
66
  - General agents record evidence and findings only; durable learning
61
67
  promotion happens only during `/cdd-close` Step 3.
@@ -76,6 +82,7 @@ Use this skill to turn software requests into traceable, testable, CI/CD-gated c
76
82
  - classification
77
83
  - current behavior if modifying existing feature
78
84
  - proposal/spec/design as needed
85
+ - implementation-plan
79
86
  - contracts
80
87
  - test-plan
81
88
  - ci-gates
@@ -128,5 +135,6 @@ Run scripts with Python 3 from the repository root.
128
135
  ## Output discipline (file formats)
129
136
 
130
137
  - `tasks.yml`: structured YAML, validated by `src/schemas/tasks.schema.ts`.
131
- - `agent-log/<agent>.yml`: structured YAML per `references/agent-log-protocol.md`.
138
+ - `agent-log/<agent>.yml`: optional structured handoff note per `references/agent-log-protocol.md`.
139
+ - `implementation-plan.md`: required execution handoff for implementation agents.
132
140
  - All other change artifacts remain markdown prose.