contract-driven-delivery 1.16.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +35 -28
- package/assets/agents/backend-engineer.md +2 -2
- package/assets/agents/change-classifier.md +4 -4
- package/assets/agents/ci-cd-gatekeeper.md +1 -1
- package/assets/agents/contract-reviewer.md +1 -1
- package/assets/agents/dependency-security-reviewer.md +1 -1
- package/assets/agents/e2e-resilience-engineer.md +1 -1
- package/assets/agents/frontend-engineer.md +1 -1
- package/assets/agents/monkey-test-engineer.md +1 -1
- package/assets/agents/qa-reviewer.md +1 -1
- package/assets/agents/repo-context-scanner.md +1 -1
- package/assets/agents/spec-architect.md +1 -1
- package/assets/agents/spec-drift-auditor.md +1 -1
- package/assets/agents/stress-soak-engineer.md +1 -1
- package/assets/agents/test-strategist.md +1 -1
- package/assets/agents/ui-ux-reviewer.md +1 -1
- package/assets/agents/visual-reviewer.md +1 -1
- package/assets/skills/cdd-close/SKILL.md +9 -9
- package/assets/skills/cdd-new/SKILL.md +28 -28
- package/assets/skills/cdd-resume/SKILL.md +15 -15
- package/assets/skills/contract-driven-delivery/SKILL.md +6 -0
- package/assets/skills/contract-driven-delivery/references/agent-log-protocol.md +90 -60
- package/assets/skills/contract-driven-delivery/scripts/generate_change_scaffold.py +1 -1
- package/assets/skills/contract-driven-delivery/scripts/validate_spec_traceability.py +1 -1
- package/assets/skills/contract-driven-delivery/templates/agent-log.example.yml +14 -0
- package/assets/skills/contract-driven-delivery/templates/change-classification.md +1 -1
- package/assets/skills/contract-driven-delivery/templates/tasks.yml +39 -0
- package/assets/specs-templates/change-classification.md +1 -1
- package/assets/specs-templates/tasks.yml +39 -0
- package/dist/cli/index.js +10228 -555
- package/package.json +6 -2
- package/assets/skills/contract-driven-delivery/templates/tasks.md +0 -50
- 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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
213
|
-
5. **YOU tick** `tasks.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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>.
|
|
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.
|
|
396
|
-
| `Tier <N> change requires agent-log/<X>.
|
|
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.
|
|
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
|
|
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>.
|
|
477
|
-
- Tick the relevant `tasks.
|
|
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.
|
|
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.
|
|
20
|
+
Before reading state, check if `specs/changes/<change-id>/tasks.yml` exists.
|
|
21
21
|
|
|
22
|
-
If
|
|
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.
|
|
31
|
-
git commit -m "chore: migrate <change-id> to
|
|
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.
|
|
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/*.
|
|
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.
|
|
49
|
-
- Identify all `
|
|
50
|
-
- Identify all `
|
|
51
|
-
- Identify all `
|
|
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
|
|
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.
|
|
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.
|
|
114
|
-
- If tasks.
|
|
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
|
|
4
|
-
is the single source of truth — agent prompts reference it instead of
|
|
5
|
-
the format. `cdd-kit gate`
|
|
6
|
-
|
|
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>.
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
30
|
-
- <evidence-type
|
|
31
|
-
- <evidence-type
|
|
32
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
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
|
|
68
|
-
A malformed log
|
|
69
|
-
|
|
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
|
|
94
|
+
Before sending your final response, re-read the YAML you intend to write and
|
|
73
95
|
verify each item:
|
|
74
96
|
|
|
75
|
-
- [ ] **All
|
|
76
|
-
`next-action
|
|
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
|
|
80
|
-
|
|
81
|
-
- GOOD: `
|
|
82
|
-
- GOOD: `
|
|
83
|
-
-
|
|
84
|
-
- BAD: `
|
|
85
|
-
- BAD: `
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
91
|
-
|
|
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
|
|
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.
|
|
103
|
-
3. `status
|
|
104
|
-
4. `
|
|
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
|
-
|
|
107
|
-
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 }
|