contract-driven-delivery 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +383 -143
- package/assets/CLAUDE.template.md +16 -0
- package/assets/agents/backend-engineer.md +13 -0
- package/assets/agents/change-classifier.md +10 -0
- package/assets/agents/ci-cd-gatekeeper.md +13 -0
- package/assets/agents/contract-reviewer.md +13 -0
- package/assets/agents/e2e-resilience-engineer.md +13 -0
- package/assets/agents/frontend-engineer.md +13 -0
- package/assets/agents/monkey-test-engineer.md +13 -0
- package/assets/agents/qa-reviewer.md +13 -0
- package/assets/agents/spec-architect.md +13 -0
- package/assets/agents/stress-soak-engineer.md +13 -0
- package/assets/agents/test-strategist.md +13 -0
- package/assets/hooks/pre-commit +1 -1
- package/assets/skills/cdd-close/SKILL.md +123 -0
- package/assets/skills/cdd-new/SKILL.md +50 -24
- package/assets/skills/cdd-resume/SKILL.md +86 -0
- package/assets/skills/contract-driven-delivery/templates/change-classification.md +9 -8
- package/assets/skills/contract-driven-delivery/templates/tasks.md +7 -0
- package/assets/specs-templates/change-classification.md +9 -8
- package/assets/specs-templates/tasks.md +7 -0
- package/dist/cli/index.js +481 -39
- package/package.json +8 -5
|
@@ -85,6 +85,16 @@ Note: `archive.md` is created during change close-out, not at classification tim
|
|
|
85
85
|
## Required Agents
|
|
86
86
|
...
|
|
87
87
|
|
|
88
|
+
## Inferred Acceptance Criteria
|
|
89
|
+
(List 3-8 testable acceptance criteria derived from the change request. Format: `AC-N: <criterion>`. These will be used by test-strategist to populate the Acceptance Criteria → Test Mapping table.)
|
|
90
|
+
- AC-1:
|
|
91
|
+
- AC-2:
|
|
92
|
+
- AC-3:
|
|
93
|
+
|
|
94
|
+
## Tasks Not Applicable
|
|
95
|
+
(List task IDs from tasks.md that are NOT applicable to this change, using the format `2.2, 2.3, 4.2`. Main Claude will mark these as [-] in tasks.md.)
|
|
96
|
+
- not-applicable:
|
|
97
|
+
|
|
88
98
|
## Clarifications or Assumptions
|
|
89
99
|
...
|
|
90
100
|
```
|
|
@@ -56,6 +56,12 @@ CI/CD is mandatory. Every change must have a `ci-gates.md` plan, even if the pla
|
|
|
56
56
|
mergeable / blocked / informational-risk
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
## Read scope
|
|
60
|
+
|
|
61
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
62
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
63
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
64
|
+
|
|
59
65
|
## Machine-Verifiable Evidence
|
|
60
66
|
|
|
61
67
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -87,3 +93,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
87
93
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
88
94
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
89
95
|
without a pointer.
|
|
96
|
+
|
|
97
|
+
## Read scope
|
|
98
|
+
|
|
99
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
100
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
101
|
+
|
|
102
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -55,6 +55,12 @@ Record dependency or migration impacts in `contracts.md` only as contract-level
|
|
|
55
55
|
approved / changes-required
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
## Read scope
|
|
59
|
+
|
|
60
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
61
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
62
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
63
|
+
|
|
58
64
|
## Machine-Verifiable Evidence
|
|
59
65
|
|
|
60
66
|
After completing your task, include an **## Agent Log** section at the end of your response with this exact structure (lines starting with `- ` are required). The calling skill will write this block to `specs/changes/<change-id>/agent-log/contract-reviewer.md`.
|
|
@@ -86,3 +92,10 @@ After completing your task, include an **## Agent Log** section at the end of yo
|
|
|
86
92
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
87
93
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
88
94
|
without a pointer.
|
|
95
|
+
|
|
96
|
+
## Read scope
|
|
97
|
+
|
|
98
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
99
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
100
|
+
|
|
101
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -33,6 +33,12 @@ Your tests must prove that real user journeys and realistic failure modes behave
|
|
|
33
33
|
|
|
34
34
|
Record test files, scenarios, fixtures/mocks, commands, screenshots/videos, and mutation checks.
|
|
35
35
|
|
|
36
|
+
## Read scope
|
|
37
|
+
|
|
38
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
39
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
40
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
41
|
+
|
|
36
42
|
## Machine-Verifiable Evidence
|
|
37
43
|
|
|
38
44
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -64,3 +70,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
64
70
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
65
71
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
66
72
|
without a pointer.
|
|
73
|
+
|
|
74
|
+
## Read scope
|
|
75
|
+
|
|
76
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
77
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
78
|
+
|
|
79
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -28,6 +28,12 @@ Before editing, read the change artifacts, API contract, CSS/UI contract, compon
|
|
|
28
28
|
- Bundle size — dynamic import heavy routes; avoid full lodash / moment imports.
|
|
29
29
|
- Note: avoid double-submit / rapid-action implementation bugs — but do not author monkey tests here; that is `monkey-test-engineer`'s scope.
|
|
30
30
|
|
|
31
|
+
## Read scope
|
|
32
|
+
|
|
33
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
34
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
35
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
36
|
+
|
|
31
37
|
## Handoff
|
|
32
38
|
|
|
33
39
|
Report changed screens, component states covered, screenshots/videos if generated, tests added, commands run, and remaining UI risks.
|
|
@@ -68,3 +74,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
68
74
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
69
75
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
70
76
|
without a pointer.
|
|
77
|
+
|
|
78
|
+
## Read scope
|
|
79
|
+
|
|
80
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
81
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
82
|
+
|
|
83
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -36,6 +36,12 @@ Use fuzz payloads, Playwright action sequences, property-based tests, and target
|
|
|
36
36
|
- Adversarial corpora — common boundaries (empty, max-int, NaN, Unicode RTL, Zero-Width Joiner, surrogate pairs, BOM); SQL/JS injection strings.
|
|
37
37
|
- Determinism — every monkey test must seed its randomness; record the seed on failure for replay.
|
|
38
38
|
|
|
39
|
+
## Read scope
|
|
40
|
+
|
|
41
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
42
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
43
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
44
|
+
|
|
39
45
|
## Machine-Verifiable Evidence
|
|
40
46
|
|
|
41
47
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -66,3 +72,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
66
72
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
67
73
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
68
74
|
without a pointer.
|
|
75
|
+
|
|
76
|
+
## Read scope
|
|
77
|
+
|
|
78
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
79
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
80
|
+
|
|
81
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -67,6 +67,12 @@ Invoke `spec-drift-auditor` at the following points (do not wait for issues to s
|
|
|
67
67
|
approved / blocked / approved-with-risk
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## Read scope
|
|
71
|
+
|
|
72
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
73
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
74
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
75
|
+
|
|
70
76
|
## Machine-Verifiable Evidence
|
|
71
77
|
|
|
72
78
|
After completing your task, include an **## Agent Log** section at the end of your response with this exact structure (lines starting with `- ` are required). The calling skill will write this block to `specs/changes/<change-id>/agent-log/qa-reviewer.md`.
|
|
@@ -99,3 +105,10 @@ After completing your task, include an **## Agent Log** section at the end of yo
|
|
|
99
105
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
100
106
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
101
107
|
without a pointer.
|
|
108
|
+
|
|
109
|
+
## Read scope
|
|
110
|
+
|
|
111
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
112
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
113
|
+
|
|
114
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -85,6 +85,12 @@ Your output goes into `specs/changes/<id>/design.md`. It must capture architectu
|
|
|
85
85
|
Reference file paths instead of duplicating implementation content.
|
|
86
86
|
Target: `design.md` ≤ 150 lines.
|
|
87
87
|
|
|
88
|
+
## Read scope
|
|
89
|
+
|
|
90
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
91
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
92
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
93
|
+
|
|
88
94
|
## Machine-Verifiable Evidence
|
|
89
95
|
|
|
90
96
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -116,3 +122,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
116
122
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
117
123
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
118
124
|
without a pointer.
|
|
125
|
+
|
|
126
|
+
## Read scope
|
|
127
|
+
|
|
128
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
129
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
130
|
+
|
|
131
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -60,6 +60,12 @@ Use realistic load profiles rather than arbitrary request loops.
|
|
|
60
60
|
...
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
## Read scope
|
|
64
|
+
|
|
65
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
66
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
67
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
68
|
+
|
|
63
69
|
## Machine-Verifiable Evidence
|
|
64
70
|
|
|
65
71
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -91,3 +97,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
91
97
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
92
98
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
93
99
|
without a pointer.
|
|
100
|
+
|
|
101
|
+
## Read scope
|
|
102
|
+
|
|
103
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
104
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
105
|
+
|
|
106
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
|
@@ -64,6 +64,12 @@ Your output goes into `specs/changes/<id>/test-plan.md`. It must answer WHAT to
|
|
|
64
64
|
Implementation detail belongs in the test files, not in test-plan.md.
|
|
65
65
|
Target: `test-plan.md` ≤ 100 lines.
|
|
66
66
|
|
|
67
|
+
## Read scope
|
|
68
|
+
|
|
69
|
+
- Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
|
|
70
|
+
- **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
|
|
71
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
72
|
+
|
|
67
73
|
## Machine-Verifiable Evidence
|
|
68
74
|
|
|
69
75
|
After completing your task, write or append to `specs/changes/<change-id>/agent-log/<your-agent-name>.md`
|
|
@@ -95,3 +101,10 @@ with this exact structure (lines starting with `- ` are required):
|
|
|
95
101
|
- Evidence must be concrete: file:line, command name + last-10-line stdout,
|
|
96
102
|
contract path + section, test name, etc. NEVER write "verified" or "OK"
|
|
97
103
|
without a pointer.
|
|
104
|
+
|
|
105
|
+
## Read scope
|
|
106
|
+
|
|
107
|
+
- Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
|
|
108
|
+
- Forbidden: other `specs/changes/` directories, `specs/archive/`
|
|
109
|
+
|
|
110
|
+
Read only the current change's directory. Do NOT glob `specs/changes/**` — it pulls historical data into context and wastes tokens.
|
package/assets/hooks/pre-commit
CHANGED
|
@@ -14,7 +14,7 @@ change_ids=$(echo "$staged" | grep -oE '^specs/changes/[^/]+' | sort -u | sed 's
|
|
|
14
14
|
|
|
15
15
|
for id in $change_ids; do
|
|
16
16
|
echo "[cdd-kit] running gate for change: $id"
|
|
17
|
-
if ! cdd-kit gate "$id"; then
|
|
17
|
+
if ! cdd-kit gate "$id" --strict; then
|
|
18
18
|
echo "[cdd-kit] gate failed for $id — commit rejected."
|
|
19
19
|
echo "[cdd-kit] fix issues above; --no-verify bypasses but defeats the kit."
|
|
20
20
|
exit 1
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cdd-close
|
|
3
|
+
description: Close and archive a completed change. Confirms all tasks are done, promotes durable learnings, then runs cdd-kit archive. Args: <change-id>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cdd-close — Close and Archive a Change
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
A change is "done" when:
|
|
11
|
+
1. Gate has passed (`cdd-kit gate <change-id>` exits 0)
|
|
12
|
+
2. PR is merged (or change is abandoned)
|
|
13
|
+
3. Durable learnings have been promoted to `contracts/` or `CLAUDE.md`
|
|
14
|
+
|
|
15
|
+
This skill drives steps 2–3 and physically moves the change to `specs/archive/`.
|
|
16
|
+
|
|
17
|
+
## Input
|
|
18
|
+
|
|
19
|
+
The skill argument is the change-id (e.g., `add-jwt-auth`).
|
|
20
|
+
|
|
21
|
+
If not provided, ask: "Which change-id do you want to close?"
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Abandon path
|
|
26
|
+
|
|
27
|
+
If the user wants to **abandon** this change (not close as complete):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
cdd-kit abandon <change-id> --reason "<reason>"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This marks `tasks.md` as `status: abandoned` and records it in `specs/archive/INDEX.md`. The directory is preserved for git history. Do NOT run the rest of this skill after abandoning.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Step 1: Confirm gate status
|
|
38
|
+
|
|
39
|
+
Run: `cdd-kit gate <change-id>`
|
|
40
|
+
|
|
41
|
+
If gate fails: stop and report failures. Do NOT archive a change that hasn't passed gate.
|
|
42
|
+
|
|
43
|
+
Exception: if `tasks.md` contains `status: gate-blocked`, ask the user: "This change was gate-blocked. Abandon it? (yes/no)". If yes, run `cdd-kit abandon <change-id> --reason "gate-blocked after 3 attempts"` and stop.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 2: Review tasks.md section 7
|
|
48
|
+
|
|
49
|
+
Read `specs/changes/<change-id>/tasks.md`.
|
|
50
|
+
|
|
51
|
+
Check section 7:
|
|
52
|
+
- `7.1 Archive change` — will be ticked after Step 4
|
|
53
|
+
- `7.2 Promote durable learnings to contracts or CLAUDE.md` — must be done NOW
|
|
54
|
+
|
|
55
|
+
If `7.2` is `[ ]`, proceed to Step 2.5. If already `[x]` or `[-]`, skip Steps 2.5 and 3.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 2.5: Create archive.md
|
|
60
|
+
|
|
61
|
+
Read `specs/changes/<change-id>/agent-log/` (all log files) and `specs/changes/<change-id>/qa-report.md` (if exists).
|
|
62
|
+
|
|
63
|
+
Synthesize a `specs/changes/<change-id>/archive.md` file with:
|
|
64
|
+
- **Change Summary**: 1 paragraph what was changed and why
|
|
65
|
+
- **Final Behavior**: what the system now does differently
|
|
66
|
+
- **Final Contracts Updated**: list from agent-log evidence
|
|
67
|
+
- **Final Tests Added / Updated**: list from agent-log evidence
|
|
68
|
+
- **Final CI/CD Gates**: list from ci-gates.md
|
|
69
|
+
- **Production Reality Findings**: any surprises or deviations from the plan (from qa-reviewer agent-log)
|
|
70
|
+
- **Lessons Promoted to Standards**: (leave blank — to be filled in Step 3)
|
|
71
|
+
- **Follow-up Work**: any known issues deferred
|
|
72
|
+
|
|
73
|
+
This file is the source for Step 3's learning promotion.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Step 3: Promote learnings (task 7.2)
|
|
78
|
+
|
|
79
|
+
Read `specs/changes/<change-id>/archive.md` section `## Lessons Promoted to Standards`.
|
|
80
|
+
|
|
81
|
+
If there are lessons to promote, invoke `contract-reviewer` with:
|
|
82
|
+
- The archive.md lessons section
|
|
83
|
+
- Instruction: "Review these lessons and propose specific additions to the relevant contract files. For each lesson, output: target file, target section, proposed text (≤ 5 lines), schema-version bump required (yes/no)."
|
|
84
|
+
|
|
85
|
+
After contract-reviewer responds:
|
|
86
|
+
1. Apply each proposed addition to the contract file (YOU write)
|
|
87
|
+
2. Run `cdd-kit validate --contracts` to confirm format is preserved
|
|
88
|
+
3. Fill in `## Lessons Promoted to Standards` in archive.md with what was promoted
|
|
89
|
+
4. Tick `7.2` in tasks.md
|
|
90
|
+
|
|
91
|
+
If there are no lessons to promote, mark `[-]` for 7.2 with rationale.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 4: Archive
|
|
96
|
+
|
|
97
|
+
Run: `cdd-kit archive <change-id>`
|
|
98
|
+
|
|
99
|
+
If successful, tick `7.1` in tasks.md (the file is now in specs/archive/, update it there):
|
|
100
|
+
`specs/archive/<year>/<change-id>/tasks.md` — change `7.1` from `[ ]` to `[x]`.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Step 5: Report
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
## /cdd-close complete
|
|
108
|
+
|
|
109
|
+
Change ID: <change-id>
|
|
110
|
+
Archived to: specs/archive/<year>/<change-id>/
|
|
111
|
+
Learnings promoted: <list what was added to contracts/CLAUDE.md, or "none">
|
|
112
|
+
|
|
113
|
+
specs/changes/<change-id>/ has been removed from the active surface.
|
|
114
|
+
Token cost of future sessions reduced by ~<N> files.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Rules
|
|
120
|
+
|
|
121
|
+
- NEVER archive before gate passes (unless user explicitly confirms abandoned)
|
|
122
|
+
- NEVER skip Step 3 — lessons rot if not promoted
|
|
123
|
+
- The archive command is irreversible without git — remind user to commit after archiving
|
|
@@ -64,7 +64,9 @@ If no description is provided, ask the user: "Please describe the change you wan
|
|
|
64
64
|
|
|
65
65
|
## Artifact opt-in policy
|
|
66
66
|
|
|
67
|
-
Only create optional artifacts (`current-behavior.md`, `proposal.md`, `spec.md`, `design.md`, `qa-report.md`, `regression-report.md
|
|
67
|
+
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`.
|
|
68
|
+
|
|
69
|
+
Note: `archive.md` is created during `/cdd-close`, not during `/cdd-new` — it is not part of the classifier's opt-in surface.
|
|
68
70
|
|
|
69
71
|
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.
|
|
70
72
|
|
|
@@ -116,18 +118,25 @@ Create `specs/changes/<change-id>/change-classification.md` with blank template:
|
|
|
116
118
|
## Impact Radius
|
|
117
119
|
- isolated / module-level / cross-module / system-wide
|
|
118
120
|
|
|
121
|
+
## Tier
|
|
122
|
+
- 0 / 1 / 2 / 3 / 4 / 5
|
|
123
|
+
|
|
124
|
+
## Architecture Review Required
|
|
125
|
+
- yes / no
|
|
126
|
+
- reason: (fill only if yes)
|
|
127
|
+
|
|
119
128
|
## Required Artifacts
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
|
124
|
-
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
| qa-report.md | | |
|
|
130
|
-
| regression-report.md | | |
|
|
129
|
+
Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.md
|
|
130
|
+
|
|
131
|
+
## Optional Artifacts (default: no — set yes only with explicit reason)
|
|
132
|
+
| artifact | create? | reason |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| current-behavior.md | no | |
|
|
135
|
+
| proposal.md | no | |
|
|
136
|
+
| spec.md | no | |
|
|
137
|
+
| design.md | no | |
|
|
138
|
+
| qa-report.md | no | |
|
|
139
|
+
| regression-report.md | no | |
|
|
131
140
|
|
|
132
141
|
## Required Contracts
|
|
133
142
|
- API:
|
|
@@ -158,21 +167,19 @@ Create `specs/changes/<change-id>/test-plan.md` with blank template:
|
|
|
158
167
|
```
|
|
159
168
|
# Test Plan: <change-id>
|
|
160
169
|
|
|
161
|
-
##
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
## Contract Tests
|
|
170
|
+
## Acceptance Criteria → Test Mapping
|
|
171
|
+
| criterion id | test family | test file path | tier |
|
|
172
|
+
|---|---|---|---|
|
|
166
173
|
|
|
167
|
-
##
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
## Resilience / Data-Boundary Tests
|
|
172
|
-
|
|
173
|
-
## Stress / Soak Tests
|
|
174
|
+
## Test Families Required
|
|
175
|
+
| family | tier | notes |
|
|
176
|
+
|---|---|---|
|
|
177
|
+
| (unit / contract / integration / e2e / data-boundary / resilience / monkey / stress / soak) | | |
|
|
174
178
|
|
|
175
179
|
## Out of Scope
|
|
180
|
+
|
|
181
|
+
## Notes
|
|
182
|
+
(Keep under 10 lines. Implementation detail belongs in the test files themselves.)
|
|
176
183
|
```
|
|
177
184
|
|
|
178
185
|
Create `specs/changes/<change-id>/ci-gates.md` with blank template:
|
|
@@ -190,6 +197,13 @@ Create `specs/changes/<change-id>/ci-gates.md` with blank template:
|
|
|
190
197
|
|
|
191
198
|
Create `specs/changes/<change-id>/tasks.md` with ALL checkboxes unchecked:
|
|
192
199
|
```
|
|
200
|
+
---
|
|
201
|
+
change-id: <change-id>
|
|
202
|
+
status: in-progress
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
<!-- [x]=done [-]=N/A [ ]=pending -->
|
|
206
|
+
|
|
193
207
|
# Tasks: <change-id>
|
|
194
208
|
|
|
195
209
|
## 1. Preparation
|
|
@@ -252,6 +266,8 @@ Invoke `change-classifier` agent with:
|
|
|
252
266
|
|
|
253
267
|
Wait until these three writes are done before continuing.
|
|
254
268
|
|
|
269
|
+
**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.
|
|
270
|
+
|
|
255
271
|
---
|
|
256
272
|
|
|
257
273
|
## Step 3: Read the tier and commission agents
|
|
@@ -264,6 +280,13 @@ Read `change-classification.md` to determine the tier. Then invoke agents **in t
|
|
|
264
280
|
|
|
265
281
|
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.
|
|
266
282
|
|
|
283
|
+
**When invoking any agent, always begin the prompt with:**
|
|
284
|
+
```
|
|
285
|
+
CURRENT_CHANGE_ID: <change-id>
|
|
286
|
+
Change directory: specs/changes/<change-id>/
|
|
287
|
+
```
|
|
288
|
+
This ensures the agent's Read scope restriction points to the correct directory.
|
|
289
|
+
|
|
267
290
|
---
|
|
268
291
|
|
|
269
292
|
### Tier 4–5 (low risk: docs, prompts, config-only, no behavior change)
|
|
@@ -286,6 +309,7 @@ If any agent sets `status: blocked` in its log, halt immediately and report the
|
|
|
286
309
|
|
|
287
310
|
2. **`test-strategist`** (write-capable) — writes `specs/changes/<change-id>/test-plan.md` directly.
|
|
288
311
|
- YOU tick: applicable items in section 3 based on what test families were planned
|
|
312
|
+
- Provide the classifier's `## Inferred Acceptance Criteria` list to test-strategist. These become the `criterion id` column in the Acceptance Criteria → Test Mapping table.
|
|
289
313
|
|
|
290
314
|
3. **`spec-architect`** (write-capable) — only if `change-classification.md` contains `Architecture Review Required: yes`.
|
|
291
315
|
- YOU tick: `1.3` (if it produced a gate plan)
|
|
@@ -422,3 +446,5 @@ Please review the above items and re-run: cdd-kit gate <change-id>
|
|
|
422
446
|
## After Completion
|
|
423
447
|
|
|
424
448
|
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.
|
|
449
|
+
|
|
450
|
+
When the change is merged and ready to close, run `/cdd-close <change-id>` to promote learnings and archive the change directory.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
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>
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cdd-resume — Resume a Change
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use when returning to a change after a session break, or when `/cdd-new` was interrupted.
|
|
11
|
+
|
|
12
|
+
## Input
|
|
13
|
+
|
|
14
|
+
Provide the `change-id`. If unsure, run `cdd-kit list` to see active changes.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Step 0: Detect format version
|
|
19
|
+
|
|
20
|
+
Before reading state, check if `specs/changes/<change-id>/tasks.md` starts with `---` (YAML frontmatter).
|
|
21
|
+
|
|
22
|
+
If it does NOT start with `---`, this change was created with a pre-v1.11 version of cdd-kit. Run:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
cdd-kit migrate <change-id>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then commit the migration:
|
|
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"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If there are many mid-flight changes, suggest `cdd-kit migrate --all` instead.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step 1: Read current state
|
|
39
|
+
|
|
40
|
+
Read `specs/changes/<change-id>/tasks.md`:
|
|
41
|
+
- Identify all `[x]` (done) items
|
|
42
|
+
- Identify all `[-]` (N/A) items
|
|
43
|
+
- Identify all `[ ]` (pending) items
|
|
44
|
+
|
|
45
|
+
Read `specs/changes/<change-id>/agent-log/` to list which agents have already run.
|
|
46
|
+
|
|
47
|
+
Read `specs/changes/<change-id>/change-classification.md` to recall the tier and required agents.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 2: Report state and ask to continue
|
|
52
|
+
|
|
53
|
+
Output a resume summary:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
## Resume: <change-id>
|
|
57
|
+
|
|
58
|
+
Tier: <tier>
|
|
59
|
+
Status: <in-progress | gate-blocked>
|
|
60
|
+
|
|
61
|
+
Completed agents: <list from agent-log/>
|
|
62
|
+
Pending tasks: <list of [ ] items>
|
|
63
|
+
|
|
64
|
+
Next agent to run: <agent-name> (based on tier flow and what's missing)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Ask the user: "Continue from <next-agent>? (yes/no)"
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 3: Continue the flow
|
|
72
|
+
|
|
73
|
+
If user confirms, resume from the next agent in the Tier sequence (refer to `/cdd-new` Step 3 for the agent order).
|
|
74
|
+
|
|
75
|
+
**Critical**: Inject `CURRENT_CHANGE_ID: <change-id>` at the start of every agent prompt. Do NOT re-run agents that already have a `status: complete` agent-log.
|
|
76
|
+
|
|
77
|
+
Continue until all required agents are done, then run `cdd-kit gate <change-id>`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
- Never re-run an agent that already has `status: complete` in its agent-log
|
|
84
|
+
- Never start from Step 1 of `/cdd-new` — only resume from the next pending agent
|
|
85
|
+
- If tasks.md has `status: abandoned`, report to user and stop
|
|
86
|
+
- If tasks.md has `status: gate-blocked`, go directly to gate retry (max 3)
|
|
@@ -10,14 +10,18 @@
|
|
|
10
10
|
## Impact Radius
|
|
11
11
|
- isolated / module-level / cross-module / system-wide
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Tier
|
|
14
|
+
- 0 / 1 / 2 / 3 / 4 / 5
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
## Architecture Review Required
|
|
17
|
+
- yes / no
|
|
18
|
+
- reason: (fill only if yes)
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
## Required Artifacts
|
|
21
|
+
Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.md
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
## Optional Artifacts (default: no — set yes only with explicit reason)
|
|
24
|
+
| artifact | create? | reason |
|
|
21
25
|
|---|---|---|
|
|
22
26
|
| current-behavior.md | no | |
|
|
23
27
|
| proposal.md | no | |
|
|
@@ -25,9 +29,6 @@ Optional artifacts — only create when explicitly needed:
|
|
|
25
29
|
| design.md | no | |
|
|
26
30
|
| qa-report.md | no | |
|
|
27
31
|
| regression-report.md | no | |
|
|
28
|
-
| archive.md | no | |
|
|
29
|
-
|
|
30
|
-
Default is **no**. Change classifier must explicitly set `yes` with a reason.
|
|
31
32
|
|
|
32
33
|
## Required Contracts
|
|
33
34
|
- API:
|
|
@@ -10,14 +10,18 @@
|
|
|
10
10
|
## Impact Radius
|
|
11
11
|
- isolated / module-level / cross-module / system-wide
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Tier
|
|
14
|
+
- 0 / 1 / 2 / 3 / 4 / 5
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
## Architecture Review Required
|
|
17
|
+
- yes / no
|
|
18
|
+
- reason: (fill only if yes)
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
## Required Artifacts
|
|
21
|
+
Always required: change-request.md, change-classification.md, test-plan.md, ci-gates.md, tasks.md
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
## Optional Artifacts (default: no — set yes only with explicit reason)
|
|
24
|
+
| artifact | create? | reason |
|
|
21
25
|
|---|---|---|
|
|
22
26
|
| current-behavior.md | no | |
|
|
23
27
|
| proposal.md | no | |
|
|
@@ -25,9 +29,6 @@ Optional artifacts — only create when explicitly needed:
|
|
|
25
29
|
| design.md | no | |
|
|
26
30
|
| qa-report.md | no | |
|
|
27
31
|
| regression-report.md | no | |
|
|
28
|
-
| archive.md | no | |
|
|
29
|
-
|
|
30
|
-
Default is **no**. Change classifier must explicitly set `yes` with a reason.
|
|
31
32
|
|
|
32
33
|
## Required Contracts
|
|
33
34
|
- API:
|