contract-driven-delivery 1.16.0 → 2.0.1

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 (35) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +48 -28
  3. package/assets/CODEX.template.md +4 -4
  4. package/assets/agents/backend-engineer.md +2 -2
  5. package/assets/agents/change-classifier.md +6 -5
  6. package/assets/agents/ci-cd-gatekeeper.md +1 -1
  7. package/assets/agents/contract-reviewer.md +3 -2
  8. package/assets/agents/dependency-security-reviewer.md +3 -3
  9. package/assets/agents/e2e-resilience-engineer.md +1 -1
  10. package/assets/agents/frontend-engineer.md +1 -1
  11. package/assets/agents/monkey-test-engineer.md +1 -1
  12. package/assets/agents/qa-reviewer.md +3 -2
  13. package/assets/agents/repo-context-scanner.md +3 -3
  14. package/assets/agents/spec-architect.md +1 -1
  15. package/assets/agents/spec-drift-auditor.md +3 -3
  16. package/assets/agents/stress-soak-engineer.md +1 -1
  17. package/assets/agents/test-strategist.md +1 -1
  18. package/assets/agents/ui-ux-reviewer.md +3 -3
  19. package/assets/agents/visual-reviewer.md +3 -3
  20. package/assets/skills/cdd-close/SKILL.md +9 -9
  21. package/assets/skills/cdd-new/SKILL.md +28 -28
  22. package/assets/skills/cdd-resume/SKILL.md +15 -15
  23. package/assets/skills/contract-driven-delivery/SKILL.md +6 -0
  24. package/assets/skills/contract-driven-delivery/references/agent-log-protocol.md +90 -60
  25. package/assets/skills/contract-driven-delivery/scripts/generate_change_scaffold.py +1 -1
  26. package/assets/skills/contract-driven-delivery/scripts/validate_spec_traceability.py +1 -1
  27. package/assets/skills/contract-driven-delivery/templates/agent-log.example.yml +14 -0
  28. package/assets/skills/contract-driven-delivery/templates/change-classification.md +1 -1
  29. package/assets/skills/contract-driven-delivery/templates/tasks.yml +39 -0
  30. package/assets/specs-templates/change-classification.md +1 -1
  31. package/assets/specs-templates/tasks.yml +39 -0
  32. package/dist/cli/index.js +10228 -555
  33. package/package.json +6 -2
  34. package/assets/skills/contract-driven-delivery/templates/tasks.md +0 -50
  35. package/assets/specs-templates/tasks.md +0 -54
@@ -89,12 +89,12 @@ inevitable re-classification when the agents discover the ambiguity.
89
89
 
90
90
  **This distinction is critical — follow it for every step:**
91
91
 
92
- | Agent type | Who writes artifact files | Who writes agent-log | Who ticks tasks.md |
93
- |------------|--------------------------|----------------------|--------------------|
92
+ | Agent type | Who writes artifact files | Who writes agent-log | Who updates tasks.yml |
93
+ |------------|--------------------------|----------------------|----------------------|
94
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
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) |
96
96
 
97
- **Rule**: After EVERY agent completes (whether it writes itself or you write for it), YOU must update the relevant `tasks.md` checkbox(es) from `[ ]` to `[x]`.
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
  ---
100
100
 
@@ -106,7 +106,7 @@ Note: `archive.md` is created during `/cdd-close`, not during `/cdd-new` — it
106
106
 
107
107
  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.
108
108
 
109
- The 5 always-required artifacts are: `change-request.md`, `change-classification.md`, `test-plan.md`, `ci-gates.md`, `tasks.md`.
109
+ The 5 always-required artifacts are: `change-request.md`, `change-classification.md`, `test-plan.md`, `ci-gates.md`, `tasks.yml`.
110
110
 
111
111
  ## Step 1: Generate change-id, scaffold, and scan context
112
112
 
@@ -146,7 +146,7 @@ the kit and is bundled into every install.
146
146
  | `change-classification.md` | `specs/templates/change-classification.md` | Replace blank template with classifier output (Step 2) |
147
147
  | `test-plan.md` | `specs/templates/test-plan.md` | `test-strategist` writes this directly |
148
148
  | `ci-gates.md` | `specs/templates/ci-gates.md` | `ci-cd-gatekeeper` writes this directly |
149
- | `tasks.md` | `specs/templates/tasks.md` | Tick checkboxes as agents complete; backfill `tier:` frontmatter from classifier (Step 2.4) |
149
+ | `tasks.yml` | `specs/templates/tasks.yml` | Tick checkboxes as agents complete; backfill `tier:` frontmatter from classifier (Step 2.4) |
150
150
  | `context-manifest.md` | `specs/templates/context-manifest.md` | Replace from classifier `## Context Manifest Draft` (Step 2) |
151
151
 
152
152
  If `cdd-kit new` reports a missing template, run `cdd-kit upgrade --yes`.
@@ -207,14 +207,14 @@ If any of these are missing or still hold the literal placeholder text, STOP. Re
207
207
  ### When the classifier output passes lint
208
208
 
209
209
  1. **YOU write** `specs/changes/<change-id>/change-classification.md` — replace the blank template with the classifier's classification output.
210
- 2. **YOU write** `specs/changes/<change-id>/agent-log/change-classifier.md` — copy the Agent Log block from the classifier's response.
210
+ 2. **YOU write** `specs/changes/<change-id>/agent-log/change-classifier.yml` — copy the Agent Log block from the classifier's response.
211
211
  3. **YOU update** `specs/changes/<change-id>/context-manifest.md` from the classifier's `## Context Manifest Draft`.
212
- 4. **YOU update** `tasks.md` 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).
213
- 5. **YOU tick** `tasks.md` item `1.1`.
212
+ 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).
213
+ 5. **YOU tick** `tasks.yml` item `1.1`.
214
214
 
215
215
  Wait until these five writes are done before continuing.
216
216
 
217
- **After writing change-classification.md**: read the classifier's `## Tasks Not Applicable` list. For each listed task ID (e.g., `2.2`, `4.2`), update `tasks.md` to change that item from `[ ]` to `[-]`. Do this before invoking any other agent.
217
+ **After writing change-classification.md**: read the classifier's `## Tasks Not Applicable` list. For each listed task ID (e.g., `2.2`, `4.2`), update `tasks.yml` to change that item's `status:` from `pending` to `skipped`. Do this before invoking any other agent.
218
218
 
219
219
  ---
220
220
 
@@ -222,9 +222,9 @@ Wait until these five writes are done before continuing.
222
222
 
223
223
  Read `change-classification.md` to determine the tier. Then invoke agents **in the exact order below**.
224
224
 
225
- **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.md item(s).
225
+ **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).
226
226
 
227
- **For each write-capable agent**: wait for it to confirm completion → YOU tick relevant tasks.md item(s).
227
+ **For each write-capable agent**: wait for it to confirm completion → YOU tick relevant tasks.yml item(s).
228
228
 
229
229
  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.
230
230
 
@@ -292,11 +292,11 @@ prompt; the agent's behavior is defined by the agent prompt files in
292
292
  ### Tier 4–5 (low risk: docs, prompts, config-only, no behavior change)
293
293
 
294
294
  1. **`contract-reviewer`** (read-only) — confirm no contracts are touched or all touched ones are already updated.
295
- - YOU write: `agent-log/contract-reviewer.md`
295
+ - YOU write: `agent-log/contract-reviewer.yml`
296
296
  - YOU tick: `1.2`, applicable items in section 2
297
297
 
298
298
  2. **`qa-reviewer`** (read-only) — confirm release readiness.
299
- - YOU write: `agent-log/qa-reviewer.md`
299
+ - YOU write: `agent-log/qa-reviewer.yml`
300
300
  - YOU tick: `5.4`
301
301
 
302
302
  ---
@@ -304,7 +304,7 @@ prompt; the agent's behavior is defined by the agent prompt files in
304
304
  ### Tier 2–3 (normal: feature, enhancement, bug fix with behavior change)
305
305
 
306
306
  1. **`contract-reviewer`** (read-only) — update or create contracts in `contracts/` before any implementation starts.
307
- - YOU write: `agent-log/contract-reviewer.md`
307
+ - YOU write: `agent-log/contract-reviewer.yml`
308
308
  - YOU tick: `1.2`, applicable items in section 2
309
309
 
310
310
  2. **`test-strategist`** (write-capable) — writes `specs/changes/<change-id>/test-plan.md` directly.
@@ -316,31 +316,31 @@ prompt; the agent's behavior is defined by the agent prompt files in
316
316
 
317
317
  4. **`backend-engineer`** (write-capable) — if the change touches server, API, data, or business logic. Writes implementation and its own agent-log.
318
318
  - YOU tick: `4.1` and/or `4.3` based on scope
319
- - Note: `tasks.md` 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).
319
+ - 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).
320
320
 
321
321
  5. **`frontend-engineer`** (write-capable) — if the change touches UI, components, or client-side behavior. Writes implementation and its own agent-log.
322
322
  - YOU tick: `4.2`
323
323
 
324
324
  6. **`dependency-security-reviewer`** (read-only) — if the change touches lockfiles, package manifests, or DB migrations.
325
325
  - **Only invoke if** `change-classification.md` lists lockfiles, package manifests, or DB migrations as affected.
326
- - YOU write: `agent-log/dependency-security-reviewer.md`
326
+ - YOU write: `agent-log/dependency-security-reviewer.yml`
327
327
  - YOU tick: applicable security-related items
328
328
 
329
329
  7. **`ui-ux-reviewer`** (read-only) — if any UI change (run alongside or after frontend-engineer).
330
330
  - **Only invoke if** classifier marks UI/CSS as affected.
331
- - YOU write: `agent-log/ui-ux-reviewer.md`
331
+ - YOU write: `agent-log/ui-ux-reviewer.yml`
332
332
  - YOU tick: `5.1`
333
333
 
334
334
  8. **`visual-reviewer`** (read-only) — if any UI change (run after ui-ux-reviewer).
335
335
  - **Only invoke if** classifier marks UI/CSS as affected.
336
- - YOU write: `agent-log/visual-reviewer.md`
336
+ - YOU write: `agent-log/visual-reviewer.yml`
337
337
  - YOU tick: `5.2`
338
338
 
339
339
  9. **`ci-cd-gatekeeper`** (write-capable) — writes `specs/changes/<change-id>/ci-gates.md` directly.
340
340
  - YOU tick: `1.3`, `4.4`, applicable items in section 6
341
341
 
342
342
  10. **`qa-reviewer`** (read-only) — release readiness decision (always last).
343
- - YOU write: `agent-log/qa-reviewer.md`
343
+ - YOU write: `agent-log/qa-reviewer.yml`
344
344
  - YOU tick: `5.4`
345
345
 
346
346
  ---
@@ -371,14 +371,14 @@ All agents from Tier 2–3, plus insert these after `frontend-engineer` / `backe
371
371
 
372
372
  ## Step 4: Run the gate
373
373
 
374
- After all required agents have completed and all tasks.md items for their sections are ticked:
374
+ After all required agents have completed and all tasks.yml items for their sections are ticked:
375
375
 
376
376
  ```
377
377
  cdd-kit gate <change-id>
378
378
  ```
379
379
 
380
380
  **If gate passes**:
381
- - YOU tick: `tasks.md` item `6.1`
381
+ - YOU tick: `tasks.yml` item `6.1`
382
382
  - Proceed to Step 5.
383
383
 
384
384
  **If gate fails — structured fix-back routing**:
@@ -389,11 +389,11 @@ matches one of them.
389
389
 
390
390
  | Error pattern | Route to | Re-invocation prompt seed |
391
391
  |---|---|---|
392
- | `agent-log/<name>.md: …` | the named agent | "PREVIOUS GATE FAILURE FOR THIS AGENT: <full error line>. Fix only your `agent-log/<name>.md`. Re-output your Agent Log block." |
392
+ | `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." |
393
393
  | `change-classification.md: …` | `change-classifier` | "PREVIOUS CLASSIFICATION FAILED GATE: <error>. Re-emit only the failing section." |
394
394
  | `context-manifest.md: …` | `change-classifier` | "PREVIOUS MANIFEST FAILED GATE: <error>. Re-emit `## Context Manifest Draft`." |
395
- | `tasks.md: …` (frontmatter / pending) | YOU (main Claude) — direct edit | n/a — fix `tasks.md` yourself. Don't re-invoke an agent for a file you own. |
396
- | `Tier <N> change requires agent-log/<X>.md` | invoke the missing agent `<X>` | "TIER <N> REQUIRES THIS LOG. Run your full work, not just the log." |
395
+ | `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. |
396
+ | `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." |
397
397
  | `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." |
398
398
  | `validators returned non-zero` | `contract-reviewer` | "PREVIOUS CONTRACT VALIDATION FAILED: <last 10 lines of validator stderr>. Reconcile contracts." |
399
399
 
@@ -422,7 +422,7 @@ iteration must be on a strictly smaller error set — if the same error returns
422
422
  twice, halt and surface to user (an agent stuck in a loop is more expensive
423
423
  than a human read).
424
424
 
425
- **Terminal state after 3 failures**: Update `tasks.md` frontmatter with
425
+ **Terminal state after 3 failures**: Update `tasks.yml` frontmatter with
426
426
  `status: gate-blocked` and report all remaining errors to the user, grouped
427
427
  by responsible agent, so they know who to manually direct next.
428
428
 
@@ -441,7 +441,7 @@ Agents invoked: <list in order>
441
441
  Gate: PASSED
442
442
 
443
443
  Tasks completed:
444
- - [x] all applicable items checked in specs/changes/<change-id>/tasks.md
444
+ - [x] all applicable items have status: done in specs/changes/<change-id>/tasks.yml
445
445
 
446
446
  All artifacts written to: specs/changes/<change-id>/
447
447
 
@@ -473,8 +473,8 @@ Please review the above items and re-run: cdd-kit gate <change-id>
473
473
  - Never start implementation (backend/frontend-engineer) before `contract-reviewer` has completed for Tier 0–3 changes
474
474
  - Never skip `test-plan.md` for Tier 0–3 changes
475
475
  - Never skip `ci-gates.md` for any implementation change
476
- - Every agent must have its `agent-log/<name>.md` written — YOU write it for read-only agents after receiving their response; write-capable agents write their own
477
- - Tick the relevant `tasks.md` checkbox immediately after each agent completes — do not batch
476
+ - 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
477
+ - Tick the relevant `tasks.yml` checkbox immediately after each agent completes — do not batch
478
478
  - `qa-reviewer` always runs last and makes the release-readiness decision
479
479
 
480
480
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cdd-resume
3
- description: Resume an in-progress change across sessions. Reads tasks.md and agent-log/ to determine where to continue. Args: <change-id>
3
+ description: Resume an in-progress change across sessions. Reads tasks.yml and agent-log/ to determine where to continue. Args: <change-id>
4
4
  ---
5
5
 
6
6
  # cdd-resume — Resume a Change
@@ -17,9 +17,9 @@ Provide the `change-id`. If unsure, run `cdd-kit list` to see active changes.
17
17
 
18
18
  ## Step 0: Detect format version
19
19
 
20
- Before reading state, check if `specs/changes/<change-id>/tasks.md` starts with `---` (YAML frontmatter).
20
+ Before reading state, check if `specs/changes/<change-id>/tasks.yml` exists.
21
21
 
22
- If it does NOT start with `---`, this change was created with a pre-v1.11 version of cdd-kit. Run:
22
+ If only `specs/changes/<change-id>/tasks.md` exists (no `tasks.yml`), this change was created with a pre-v2.0 version of cdd-kit. Run:
23
23
 
24
24
  ```
25
25
  cdd-kit migrate <change-id>
@@ -27,8 +27,8 @@ cdd-kit migrate <change-id>
27
27
 
28
28
  Then commit the migration:
29
29
  ```
30
- git add specs/changes/<change-id>/tasks.md specs/changes/<change-id>/change-classification.md
31
- git commit -m "chore: migrate <change-id> to v1.11 format"
30
+ git add specs/changes/<change-id>/tasks.yml specs/changes/<change-id>/agent-log
31
+ git commit -m "chore: migrate <change-id> to v2.0 YAML format"
32
32
  ```
33
33
 
34
34
  If there are many mid-flight changes, suggest `cdd-kit migrate --all` instead.
@@ -38,17 +38,17 @@ If there are many mid-flight changes, suggest `cdd-kit migrate --all` instead.
38
38
  ## Step 1: Read current state
39
39
 
40
40
  Read only these state files first:
41
- - `specs/changes/<change-id>/tasks.md`
41
+ - `specs/changes/<change-id>/tasks.yml`
42
42
  - `specs/changes/<change-id>/context-manifest.md` if present
43
- - `specs/changes/<change-id>/agent-log/*.md`
43
+ - `specs/changes/<change-id>/agent-log/*.yml`
44
44
  - `specs/changes/<change-id>/change-classification.md`
45
45
 
46
46
  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
47
 
48
- From `tasks.md`:
49
- - Identify all `[x]` (done) items
50
- - Identify all `[-]` (N/A) items
51
- - Identify all `[ ]` (pending) items
48
+ From `tasks.yml`:
49
+ - Identify all `status: done` items
50
+ - Identify all `status: skipped` (N/A) items
51
+ - Identify all `status: pending` items
52
52
 
53
53
  Read `specs/changes/<change-id>/agent-log/` to list which agents have already run.
54
54
 
@@ -73,7 +73,7 @@ Tier: <tier>
73
73
  Status: <in-progress | gate-blocked>
74
74
 
75
75
  Completed agents: <list from agent-log/>
76
- Pending tasks: <list of [ ] items>
76
+ Pending tasks: <list of status: pending items>
77
77
  Pending context expansions: <none | list request ids and paths>
78
78
  Allowed context: <short summary from context-manifest.md>
79
79
 
@@ -108,7 +108,7 @@ Continue until all required agents are done, then run `cdd-kit gate <change-id>`
108
108
 
109
109
  - Never re-run an agent that already has `status: complete` in its agent-log
110
110
  - Never start from Step 1 of `/cdd-new` — only resume from the next pending agent
111
- - Never use broad search to reconstruct state; resume from `tasks.md`, `context-manifest.md`, and `agent-log/`
111
+ - Never use broad search to reconstruct state; resume from `tasks.yml`, `context-manifest.md`, and `agent-log/`
112
112
  - Never continue past pending Context Expansion Requests
113
- - If tasks.md has `status: abandoned`, report to user and stop
114
- - If tasks.md has `status: gate-blocked`, go directly to gate retry (max 3)
113
+ - If tasks.yml has `status: abandoned`, report to user and stop
114
+ - If tasks.yml has `status: gate-blocked`, go directly to gate retry (max 3)
@@ -116,3 +116,9 @@ When using this skill, produce concrete artifact content instead of vague recomm
116
116
  - `scripts/validate_spec_traceability.py`: check coarse traceability between spec, tasks, tests, and CI gates.
117
117
 
118
118
  Run scripts with Python 3 from the repository root.
119
+
120
+ ## Output discipline (file formats)
121
+
122
+ - `tasks.yml`: structured YAML, validated by `src/schemas/tasks.schema.ts`.
123
+ - `agent-log/<agent>.yml`: structured YAML per `references/agent-log-protocol.md`.
124
+ - All other change artifacts remain markdown prose.
@@ -1,16 +1,17 @@
1
- # Agent Log Protocol
1
+ # Agent Log Protocol (YAML)
2
2
 
3
- All cdd-kit agents share the same machine-verifiable agent-log format. This file
4
- is the single source of truth — agent prompts reference it instead of inlining
5
- the format. `cdd-kit gate` parses these files; drift here equals silent gate
6
- skips, so do not re-document this in agent prompts.
3
+ All cdd-kit agents share the same machine-verifiable agent-log format. This
4
+ file is the single source of truth — agent prompts reference it instead of
5
+ inlining the format. `cdd-kit gate` validates these files against
6
+ `src/schemas/agent-log.schema.ts` (JSON Schema, draft-07). Drift here equals
7
+ silent gate skips, so do not re-document this in agent prompts.
7
8
 
8
9
  ## Output target
9
10
 
10
11
  Each agent writes (or has main Claude write) one file per run:
11
12
 
12
13
  ```
13
- specs/changes/<change-id>/agent-log/<agent-name>.md
14
+ specs/changes/<change-id>/agent-log/<agent-name>.yml
14
15
  ```
15
16
 
16
17
  If the same agent runs more than once for a change (e.g., after fix-back),
@@ -18,42 +19,63 @@ overwrite the file — only the latest run is gate-relevant.
18
19
 
19
20
  ## Required structure
20
21
 
21
- ```
22
- # <Agent Display Name> Log
23
- - change-id: <id>
24
- - timestamp: <ISO 8601, e.g. 2026-04-27T14:30:00Z>
25
- - status: complete | needs-review | blocked
26
- - files-read:
22
+ The file is pure YAML (no markdown wrapping, no checklist).
23
+
24
+ ```yaml
25
+ change-id: <id>
26
+ agent: <agent-name>
27
+ timestamp: <ISO 8601 UTC, e.g. 2026-04-27T14:30:00Z>
28
+ status: complete # complete | needs-review | blocked
29
+ files-read:
27
30
  - <repo-relative path>
28
31
  - <repo-relative path>
29
- - artifacts:
30
- - <evidence-type>: <concrete pointer>
31
- - <evidence-type>: <concrete pointer>
32
- - next-action: <one line, or "none">
32
+ artifacts:
33
+ - { type: <evidence-type>, pointer: <concrete pointer> }
34
+ - { type: <evidence-type>, pointer: <concrete pointer> }
35
+ next-action: <one line, or "none">
36
+ notes: <optional free-form>
33
37
  ```
34
38
 
35
39
  ### Field rules
36
40
 
37
- - `change-id` must match the directory name. Mismatch is a contract violation.
38
- - `timestamp` — ISO 8601 UTC. Used by spec-drift-auditor for ordering.
39
- - `status` exactly one of `complete | needs-review | blocked`. Anything
40
- else (e.g. `done`, `OK`, `pending`) fails gate.
41
- - `files-read` required for context-governed changes (`tasks.md` frontmatter
42
- has `context-governance: v1`). Each entry must be a repo-relative path.
43
- Absolute paths and `..` traversal are rejected. If you legitimately read
44
- nothing beyond your own change directory, write:
45
- ```
46
- - files-read:
47
- - specs/changes/<change-id>/
48
- ```
49
- - `artifacts` — concrete pointers only. Allowed forms:
50
- - `path/to/file.ts:10-45`
51
- - `tests/foo.test.ts::should reject empty body`
52
- - `cdd-kit gate <id>: 0 errors` (command + outcome)
53
- - `contracts/api/api-contract.md#endpoints` (file + anchor)
54
- - **Never** `verified`, `OK`, `done`, or unscoped prose.
55
- - `next-action` — when `status: blocked`, this must be ≥ 10 chars and
56
- not `none`. When `status: complete`, `none` is acceptable.
41
+ | field | required | rule |
42
+ |---|---|---|
43
+ | `change-id` | yes | must equal the parent change directory name |
44
+ | `agent` | yes | canonical agent name (matches the agent's filename) |
45
+ | `timestamp` | yes | ISO 8601 UTC; used by spec-drift-auditor for ordering |
46
+ | `status` | yes | exactly one of `complete` \| `needs-review` \| `blocked` |
47
+ | `files-read` | conditional | required for context-governed changes (see below) |
48
+ | `artifacts` | yes | array of `{type, pointer}` objects, ≥ 1 item |
49
+ | `next-action` | yes | when `status: blocked`, ≥ 10 chars and not `none` |
50
+ | `notes` | no | optional |
51
+
52
+ #### `files-read`
53
+
54
+ Required when `tasks.yml` has `context-governance: v1`. Each entry is a
55
+ repo-relative path. Absolute paths and `..` traversal are rejected. If you
56
+ legitimately read nothing beyond your own change directory, write:
57
+
58
+ ```yaml
59
+ files-read:
60
+ - specs/changes/<change-id>/
61
+ ```
62
+
63
+ #### `artifacts`
64
+
65
+ Concrete pointers only. Allowed forms:
66
+
67
+ - `path/to/file.ts:10-45`
68
+ - `tests/foo.test.ts::should reject empty body`
69
+ - `cdd-kit gate <id>: 0 errors`
70
+ - `contracts/api/api-contract.md#endpoints`
71
+
72
+ Never `verified`, `OK`, `done`, or unscoped prose.
73
+
74
+ #### `next-action`
75
+
76
+ When `status: blocked`, this must be ≥ 10 chars, must not be `none`, `tbd`,
77
+ `investigate further`, or `n/a`, and must name the actual next step a human
78
+ can act on. When `status: complete`, `none` is acceptable.
57
79
 
58
80
  ## Per-agent additional artifact requirements
59
81
 
@@ -64,34 +86,39 @@ agent prompt, also update the qa-reviewer checklist.
64
86
 
65
87
  ## Self-validation before submitting your response
66
88
 
67
- **Every agent MUST self-validate its draft Agent Log block before finishing.**
68
- A malformed log block forces `cdd-kit gate` to fail, which forces the skill
69
- to re-invoke you, which costs the user another full agent round. Self-lint is
89
+ **Every agent MUST self-validate its draft agent-log YAML before finishing.**
90
+ A malformed log forces `cdd-kit gate` to fail, which forces the skill to
91
+ re-invoke you, which costs the user another full agent round. Self-lint is
70
92
  ~5 seconds; a re-run is minutes and dollars.
71
93
 
72
- Before sending your final response, re-read your `## Agent Log` block and
94
+ Before sending your final response, re-read the YAML you intend to write and
73
95
  verify each item:
74
96
 
75
- - [ ] **All four required keys exist**: `status`, `files-read`, `artifacts`,
76
- `next-action`. (Plus `change-id`, `timestamp` at the top.)
97
+ - [ ] **All required keys exist**: `change-id`, `agent`, `timestamp`,
98
+ `status`, `artifacts`, `next-action` (plus `files-read` for
99
+ context-governed changes).
77
100
  - [ ] **`status` is one of**: `complete`, `needs-review`, `blocked` — not
78
101
  `done`, `OK`, `pending`, `wip`, or anything else.
79
- - [ ] **Every `artifacts:` line has a concrete pointer**:
80
- - GOOD: `tests-added: tests/foo.test.ts::should reject empty body`
81
- - GOOD: `files-changed: src/api/users.ts:45-67`
82
- - GOOD: `test-output: 5 passed (last 10 lines: …)`
83
- - BAD: `tests-added: verified`
84
- - BAD: `files-changed: yes`
85
- - BAD: `contract: OK`
86
- Reject any line whose value would not let a reviewer click through.
87
- - [ ] **If `status: blocked`, `next-action`** is 10 chars, is NOT `none`,
102
+ - [ ] **Every `artifacts` item is a `{type, pointer}` mapping** with a
103
+ concrete pointer:
104
+ - GOOD: `{ type: tests-added, pointer: "tests/foo.test.ts::should reject empty body" }`
105
+ - GOOD: `{ type: files-changed, pointer: "src/api/users.ts:45-67" }`
106
+ - GOOD: `{ type: test-output, pointer: "5 passed (last 10 lines: …)" }`
107
+ - BAD: `{ type: tests-added, pointer: verified }`
108
+ - BAD: `{ type: files-changed, pointer: yes }`
109
+ - BAD: `{ type: contract, pointer: OK }`
110
+ Reject any line whose pointer would not let a reviewer click through.
111
+ - [ ] **If `status: blocked`**, `next-action` is ≥ 10 chars, is NOT `none`,
88
112
  `investigate further`, `tbd`, or `n/a`, and names the actual next step
89
113
  a human can act on.
90
- - [ ] **Every `files-read:` entry**: repo-relative path, no leading `/`,
91
- no `..`, no `~`. If you read your own change directory only, write
114
+ - [ ] **Every `files-read` entry**: repo-relative path, no leading `/`, no
115
+ `..`, no `~`. If you read your own change directory only, write
92
116
  `- specs/changes/<change-id>/`.
117
+ - [ ] **YAML is parseable**: indentation is consistent (2 spaces), strings
118
+ with special characters (`:`, `#`, leading numbers like `001`) are
119
+ quoted.
93
120
 
94
- If any check fails, **fix the block before sending your response**. Do not
121
+ If any check fails, **fix the YAML before sending your response**. Do not
95
122
  ship a known-bad log and rely on the gate to catch it.
96
123
 
97
124
  ## Gate enforcement summary
@@ -99,12 +126,14 @@ ship a known-bad log and rely on the gate to catch it.
99
126
  `cdd-kit gate` rejects an agent log when any of these are true:
100
127
 
101
128
  1. The file is missing for a tier-required agent (see CONTRACTS for tier matrix).
102
- 2. `status:` line is missing or has an unknown value.
103
- 3. `status: blocked` without a concrete `next-action`.
104
- 4. `files-read` is missing for a context-governed change, or contains an
129
+ 2. YAML fails to parse, or top-level is not a mapping.
130
+ 3. `status` is missing or has an unknown value.
131
+ 4. `status: blocked` without a concrete `next-action`.
132
+ 5. `files-read` is missing for a context-governed change, or contains an
105
133
  absolute path / `..` segment / forbidden path.
106
- 5. With `--strict`: any `- artifacts:` entry whose value looks like a path but
107
- does not exist on disk.
134
+ 6. Any `artifacts` item is missing `type` or `pointer`, or the array is empty.
135
+ 7. With `--strict`: any `artifacts` pointer that looks like a path but does
136
+ not exist on disk; or any runtime-logged read not declared in `files-read`.
108
137
 
109
138
  ## Why this lives in references/
110
139
 
@@ -114,4 +143,5 @@ spawn. Moving it here:
114
143
 
115
144
  - Cuts per-agent prompt size by 25–35%.
116
145
  - Makes drift between agents impossible (one file to change).
117
- - Lets gate.ts behavior, tests, and prompts stay in sync via this single doc.
146
+ - Lets gate.ts behavior, schemas, tests, and prompts stay in sync via this
147
+ single doc.
@@ -24,7 +24,7 @@ def main():
24
24
  'contracts.md':'contracts.md',
25
25
  'test-plan.md':'test-plan.md',
26
26
  'ci-gates.md':'ci-gates.md',
27
- 'tasks.md':'tasks.md',
27
+ 'tasks.yml':'tasks.yml',
28
28
  'qa-report.md':'qa-report.md',
29
29
  'regression-report.md':'regression-report.md',
30
30
  'archive.md':'archive.md',
@@ -2,7 +2,7 @@
2
2
  """Coarse traceability check for a change folder."""
3
3
  from pathlib import Path
4
4
  import argparse, sys
5
- REQUIRED=['change-classification.md','test-plan.md','ci-gates.md','tasks.md']
5
+ REQUIRED=['change-classification.md','test-plan.md','ci-gates.md','tasks.yml']
6
6
  def check_change_dir(d):
7
7
  """Check one change directory. Returns list of error strings (empty = pass)."""
8
8
  errors=[]
@@ -0,0 +1,14 @@
1
+ change-id: feat-001
2
+ agent: backend-engineer
3
+ timestamp: 2026-04-27T14:30:00Z
4
+ status: complete
5
+ files-read:
6
+ - contracts/api/api-contract.md
7
+ - src/api/users.ts
8
+ - specs/changes/feat-001/test-plan.md
9
+ artifacts:
10
+ - { type: files-changed, pointer: "src/api/users.ts:45-67" }
11
+ - { type: tests-added, pointer: "tests/api/users.test.ts::should reject empty body" }
12
+ - { type: contracts-touched, pointer: "contracts/api/api-contract.md#endpoints" }
13
+ - { type: test-output, pointer: "5 passed (vitest run --filter users)" }
14
+ next-action: none
@@ -18,7 +18,7 @@
18
18
  - reason: (fill only if yes)
19
19
 
20
20
  ## Required Artifacts
21
- Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.md
21
+ Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.yml
22
22
 
23
23
  ## Optional Artifacts (default: no — set yes only with explicit reason)
24
24
  | artifact | create? | reason |
@@ -0,0 +1,39 @@
1
+ change-id: <change-id>
2
+ status: in-progress
3
+ tier: null
4
+ context-governance: v1
5
+ archive-tasks:
6
+ - "7.1"
7
+ - "7.2"
8
+ depends-on: []
9
+
10
+ tasks:
11
+ # status: pending | done | skipped
12
+ - { id: "1.1", section: Preparation, title: "Confirm classification and required artifacts", status: pending }
13
+ - { id: "1.2", section: Preparation, title: "Confirm contracts to update", status: pending }
14
+ - { id: "1.3", section: Preparation, title: "Confirm CI/CD gate plan", status: pending }
15
+ - { id: "2.1", section: "Contract Updates", title: "API contract", status: pending }
16
+ - { id: "2.2", section: "Contract Updates", title: "CSS/UI contract", status: pending }
17
+ - { id: "2.3", section: "Contract Updates", title: "Env contract", status: pending }
18
+ - { id: "2.4", section: "Contract Updates", title: "Data shape contract", status: pending }
19
+ - { id: "2.5", section: "Contract Updates", title: "Business logic contract", status: pending }
20
+ - { id: "2.6", section: "Contract Updates", title: "CI/CD contract", status: pending }
21
+ - { id: "3.1", section: "Tests First", title: "Unit/contract tests", status: pending }
22
+ - { id: "3.2", section: "Tests First", title: "Integration tests", status: pending }
23
+ - { id: "3.3", section: "Tests First", title: "E2E/resilience tests", status: pending }
24
+ - { id: "3.4", section: "Tests First", title: "Data-boundary/monkey tests", status: pending }
25
+ - { id: "3.5", section: "Tests First", title: "Stress/soak tests if required", status: pending }
26
+ - { id: "4.1", section: Implementation, title: "Backend", status: pending }
27
+ - { id: "4.2", section: Implementation, title: "Frontend", status: pending }
28
+ - { id: "4.3", section: Implementation, title: "Env/deploy", status: pending }
29
+ - { id: "4.4", section: Implementation, title: "CI/CD workflows", status: pending }
30
+ - { id: "5.1", section: Review, title: "UI/UX review", status: pending }
31
+ - { id: "5.2", section: Review, title: "Visual review", status: pending }
32
+ - { id: "5.3", section: Review, title: "Contract review", status: pending }
33
+ - { id: "5.4", section: Review, title: "QA review", status: pending }
34
+ - { id: "6.1", section: Verification, title: "Local gates", status: pending }
35
+ - { id: "6.2", section: Verification, title: "PR required gates", status: pending }
36
+ - { id: "6.3", section: Verification, title: "Informational gates", status: pending }
37
+ - { id: "6.4", section: Verification, title: "Nightly/weekly/manual gates if required", status: pending }
38
+ - { id: "7.1", section: Archive, title: "Archive change", status: pending }
39
+ - { id: "7.2", section: Archive, title: "Promote durable learnings to contracts or CLAUDE.md", status: pending }
@@ -18,7 +18,7 @@
18
18
  - reason: (fill only if yes)
19
19
 
20
20
  ## Required Artifacts
21
- Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.md
21
+ Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.yml
22
22
 
23
23
  ## Optional Artifacts (default: no — set yes only with explicit reason)
24
24
  | artifact | create? | reason |
@@ -0,0 +1,39 @@
1
+ change-id: <change-id>
2
+ status: in-progress
3
+ tier: null
4
+ context-governance: v1
5
+ archive-tasks:
6
+ - "7.1"
7
+ - "7.2"
8
+ depends-on: []
9
+
10
+ tasks:
11
+ # status: pending | done | skipped
12
+ - { id: "1.1", section: Preparation, title: "Confirm classification and required artifacts", status: pending }
13
+ - { id: "1.2", section: Preparation, title: "Confirm contracts to update", status: pending }
14
+ - { id: "1.3", section: Preparation, title: "Confirm CI/CD gate plan", status: pending }
15
+ - { id: "2.1", section: "Contract Updates", title: "API contract", status: pending }
16
+ - { id: "2.2", section: "Contract Updates", title: "CSS/UI contract", status: pending }
17
+ - { id: "2.3", section: "Contract Updates", title: "Env contract", status: pending }
18
+ - { id: "2.4", section: "Contract Updates", title: "Data shape contract", status: pending }
19
+ - { id: "2.5", section: "Contract Updates", title: "Business logic contract", status: pending }
20
+ - { id: "2.6", section: "Contract Updates", title: "CI/CD contract", status: pending }
21
+ - { id: "3.1", section: "Tests First", title: "Unit/contract tests", status: pending }
22
+ - { id: "3.2", section: "Tests First", title: "Integration tests", status: pending }
23
+ - { id: "3.3", section: "Tests First", title: "E2E/resilience tests", status: pending }
24
+ - { id: "3.4", section: "Tests First", title: "Data-boundary/monkey tests", status: pending }
25
+ - { id: "3.5", section: "Tests First", title: "Stress/soak tests if required", status: pending }
26
+ - { id: "4.1", section: Implementation, title: "Backend", status: pending }
27
+ - { id: "4.2", section: Implementation, title: "Frontend", status: pending }
28
+ - { id: "4.3", section: Implementation, title: "Env/deploy", status: pending }
29
+ - { id: "4.4", section: Implementation, title: "CI/CD workflows", status: pending }
30
+ - { id: "5.1", section: Review, title: "UI/UX review", status: pending }
31
+ - { id: "5.2", section: Review, title: "Visual review", status: pending }
32
+ - { id: "5.3", section: Review, title: "Contract review", status: pending }
33
+ - { id: "5.4", section: Review, title: "QA review", status: pending }
34
+ - { id: "6.1", section: Verification, title: "Local gates", status: pending }
35
+ - { id: "6.2", section: Verification, title: "PR required gates", status: pending }
36
+ - { id: "6.3", section: Verification, title: "Informational gates", status: pending }
37
+ - { id: "6.4", section: Verification, title: "Nightly/weekly/manual gates if required", status: pending }
38
+ - { id: "7.1", section: Archive, title: "Archive change", status: pending }
39
+ - { id: "7.2", section: Archive, title: "Promote durable learnings to contracts or CLAUDE.md", status: pending }