sdd-flow 1.0.0 → 1.2.5
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 +23 -21
- package/bin/cli.js +74 -8
- package/package.json +32 -32
- package/templates/QUICKSTART.md +48 -28
- package/templates/agents/AGENTS.md +92 -92
- package/templates/agents/RULES.md +116 -116
- package/templates/agents/harness/claude-code/.hooks/guard-delete.sh +21 -21
- package/templates/agents/harness/claude-code/.hooks/guard-deps.sh +24 -24
- package/templates/agents/harness/claude-code/.hooks/guard-git.sh +23 -23
- package/templates/agents/harness/claude-code/commands/sdd-implement.md +3 -3
- package/templates/agents/harness/claude-code/commands/sdd-plan.md +3 -3
- package/templates/agents/harness/claude-code/commands/sdd-research.md +3 -3
- package/templates/agents/harness/claude-code/commands/sdd-validate.md +3 -3
- package/templates/agents/harness/opencode/commands/sdd-implement.md +3 -3
- package/templates/agents/harness/opencode/commands/sdd-plan.md +3 -3
- package/templates/agents/harness/opencode/commands/sdd-research.md +3 -3
- package/templates/agents/harness/opencode/commands/sdd-validate.md +3 -3
- package/templates/agents/prompts/rpi-implement.md +46 -46
- package/templates/agents/prompts/rpi-plan.md +117 -117
- package/templates/agents/prompts/rpi-validate.md +96 -96
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
# Prompt: Plan (RPI — Phase 2)
|
|
2
|
-
|
|
3
|
-
Use this prompt to generate all planning artifacts for a spec.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Agent instruction
|
|
8
|
-
|
|
9
|
-
You will plan the implementation of an already-researched feature.
|
|
10
|
-
|
|
11
|
-
**Before starting, read:**
|
|
12
|
-
- `agents/AGENTS.md`
|
|
13
|
-
- `agents/PROJECT.md`
|
|
14
|
-
- `agents/RULES.md`
|
|
15
|
-
- `agents/specs/NNN-name/RESEARCH.md`
|
|
16
|
-
- Check which files already exist in `agents/specs/NNN-name/`
|
|
17
|
-
|
|
18
|
-
**Expected input:**
|
|
19
|
-
- Spec number and name (e.g. `001-user-authentication`)
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Adaptive behavior
|
|
24
|
-
|
|
25
|
-
| Situation | Action |
|
|
26
|
-
|---|---|
|
|
27
|
-
| SPEC.md does not exist | Create all artifacts from scratch |
|
|
28
|
-
| SPEC.md exists, TASK.md does not | Generate only TASK.md and PROGRESS.md based on existing SPEC.md |
|
|
29
|
-
| All artifacts exist | Review and update only what is incomplete or outdated |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Deliverables
|
|
34
|
-
|
|
35
|
-
Generate the following files inside `agents/specs/NNN-name/`:
|
|
36
|
-
|
|
37
|
-
### SPEC.md
|
|
38
|
-
```markdown
|
|
39
|
-
# SPEC — [Feature Name]
|
|
40
|
-
|
|
41
|
-
## Goal
|
|
42
|
-
What this feature delivers (refined from RESEARCH.md).
|
|
43
|
-
|
|
44
|
-
## Entities involved
|
|
45
|
-
Data structures created or modified, with full field list.
|
|
46
|
-
|
|
47
|
-
## Business Rules
|
|
48
|
-
Numbered list. Only rules that directly affect implementation.
|
|
49
|
-
|
|
50
|
-
## Expected behaviors
|
|
51
|
-
Per behavior: what triggers it, what it does, what the output is.
|
|
52
|
-
|
|
53
|
-
## UI
|
|
54
|
-
Describe components, states, interactions and validations.
|
|
55
|
-
Write `N/A` if no UI is involved.
|
|
56
|
-
|
|
57
|
-
## Out of scope
|
|
58
|
-
Explicit list of what this spec does NOT cover.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### TASK.md
|
|
62
|
-
```markdown
|
|
63
|
-
# TASK — [Feature Name]
|
|
64
|
-
|
|
65
|
-
## Tasks
|
|
66
|
-
|
|
67
|
-
- [ ] T01 — [Verb + object + target file] (e.g. Create User entity schema in config)
|
|
68
|
-
verify: [observable condition confirming completion — e.g. endpoint returns 201 with `id` field; returns 400 if `email` is missing]
|
|
69
|
-
- [ ] T02 — ...
|
|
70
|
-
verify: [specific and testable condition — never "works correctly"]
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Task rules:
|
|
74
|
-
- One task = one file created/modified, or one isolated function
|
|
75
|
-
- Order must respect dependencies (schema → data layer → service → route → UI)
|
|
76
|
-
- No circular dependencies between tasks
|
|
77
|
-
- Preferred verbs: `Add`, `Create`, `Implement`, `Update`, `Extract`, `Register`
|
|
78
|
-
- Each task must include a `verify:` line with a specific, observable condition — never "works correctly"
|
|
79
|
-
|
|
80
|
-
### PROGRESS.md
|
|
81
|
-
```markdown
|
|
82
|
-
# PROGRESS — [Feature Name]
|
|
83
|
-
|
|
84
|
-
## Status: 🔴 Not started
|
|
85
|
-
|
|
86
|
-
## Tasks
|
|
87
|
-
|
|
88
|
-
| Task | Status | Notes |
|
|
89
|
-
|---|---|---|
|
|
90
|
-
| T01 | Pending | |
|
|
91
|
-
| T02 | Pending | |
|
|
92
|
-
|
|
93
|
-
## History
|
|
94
|
-
|
|
95
|
-
(updated during implementation)
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### TEST.md
|
|
99
|
-
```markdown
|
|
100
|
-
# TEST — [Feature Name]
|
|
101
|
-
|
|
102
|
-
## Acceptance Test Cases
|
|
103
|
-
|
|
104
|
-
### TC01 — [Behavior being tested]
|
|
105
|
-
- **Given** [initial state]
|
|
106
|
-
- **When** [action performed]
|
|
107
|
-
- **Then** [expected outcome]
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Constraints
|
|
113
|
-
|
|
114
|
-
- Do not write code in this phase
|
|
115
|
-
- Do not implement any task — only plan
|
|
116
|
-
- If the RESEARCH.md has unresolved open questions, **stop and ask** before planning
|
|
117
|
-
- After delivering all artifacts, **wait for approval** before advancing to Implement
|
|
1
|
+
# Prompt: Plan (RPI — Phase 2)
|
|
2
|
+
|
|
3
|
+
Use this prompt to generate all planning artifacts for a spec.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Agent instruction
|
|
8
|
+
|
|
9
|
+
You will plan the implementation of an already-researched feature.
|
|
10
|
+
|
|
11
|
+
**Before starting, read:**
|
|
12
|
+
- `agents/AGENTS.md`
|
|
13
|
+
- `agents/PROJECT.md`
|
|
14
|
+
- `agents/RULES.md`
|
|
15
|
+
- `agents/specs/NNN-name/RESEARCH.md`
|
|
16
|
+
- Check which files already exist in `agents/specs/NNN-name/`
|
|
17
|
+
|
|
18
|
+
**Expected input:**
|
|
19
|
+
- Spec number and name (e.g. `001-user-authentication`)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Adaptive behavior
|
|
24
|
+
|
|
25
|
+
| Situation | Action |
|
|
26
|
+
|---|---|
|
|
27
|
+
| SPEC.md does not exist | Create all artifacts from scratch |
|
|
28
|
+
| SPEC.md exists, TASK.md does not | Generate only TASK.md and PROGRESS.md based on existing SPEC.md |
|
|
29
|
+
| All artifacts exist | Review and update only what is incomplete or outdated |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Deliverables
|
|
34
|
+
|
|
35
|
+
Generate the following files inside `agents/specs/NNN-name/`:
|
|
36
|
+
|
|
37
|
+
### SPEC.md
|
|
38
|
+
```markdown
|
|
39
|
+
# SPEC — [Feature Name]
|
|
40
|
+
|
|
41
|
+
## Goal
|
|
42
|
+
What this feature delivers (refined from RESEARCH.md).
|
|
43
|
+
|
|
44
|
+
## Entities involved
|
|
45
|
+
Data structures created or modified, with full field list.
|
|
46
|
+
|
|
47
|
+
## Business Rules
|
|
48
|
+
Numbered list. Only rules that directly affect implementation.
|
|
49
|
+
|
|
50
|
+
## Expected behaviors
|
|
51
|
+
Per behavior: what triggers it, what it does, what the output is.
|
|
52
|
+
|
|
53
|
+
## UI
|
|
54
|
+
Describe components, states, interactions and validations.
|
|
55
|
+
Write `N/A` if no UI is involved.
|
|
56
|
+
|
|
57
|
+
## Out of scope
|
|
58
|
+
Explicit list of what this spec does NOT cover.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### TASK.md
|
|
62
|
+
```markdown
|
|
63
|
+
# TASK — [Feature Name]
|
|
64
|
+
|
|
65
|
+
## Tasks
|
|
66
|
+
|
|
67
|
+
- [ ] T01 — [Verb + object + target file] (e.g. Create User entity schema in config)
|
|
68
|
+
verify: [observable condition confirming completion — e.g. endpoint returns 201 with `id` field; returns 400 if `email` is missing]
|
|
69
|
+
- [ ] T02 — ...
|
|
70
|
+
verify: [specific and testable condition — never "works correctly"]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Task rules:
|
|
74
|
+
- One task = one file created/modified, or one isolated function
|
|
75
|
+
- Order must respect dependencies (schema → data layer → service → route → UI)
|
|
76
|
+
- No circular dependencies between tasks
|
|
77
|
+
- Preferred verbs: `Add`, `Create`, `Implement`, `Update`, `Extract`, `Register`
|
|
78
|
+
- Each task must include a `verify:` line with a specific, observable condition — never "works correctly"
|
|
79
|
+
|
|
80
|
+
### PROGRESS.md
|
|
81
|
+
```markdown
|
|
82
|
+
# PROGRESS — [Feature Name]
|
|
83
|
+
|
|
84
|
+
## Status: 🔴 Not started
|
|
85
|
+
|
|
86
|
+
## Tasks
|
|
87
|
+
|
|
88
|
+
| Task | Status | Notes |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| T01 | Pending | |
|
|
91
|
+
| T02 | Pending | |
|
|
92
|
+
|
|
93
|
+
## History
|
|
94
|
+
|
|
95
|
+
(updated during implementation)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### TEST.md
|
|
99
|
+
```markdown
|
|
100
|
+
# TEST — [Feature Name]
|
|
101
|
+
|
|
102
|
+
## Acceptance Test Cases
|
|
103
|
+
|
|
104
|
+
### TC01 — [Behavior being tested]
|
|
105
|
+
- **Given** [initial state]
|
|
106
|
+
- **When** [action performed]
|
|
107
|
+
- **Then** [expected outcome]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Constraints
|
|
113
|
+
|
|
114
|
+
- Do not write code in this phase
|
|
115
|
+
- Do not implement any task — only plan
|
|
116
|
+
- If the RESEARCH.md has unresolved open questions, **stop and ask** before planning
|
|
117
|
+
- After delivering all artifacts, **wait for approval** before advancing to Implement
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
# Prompt: Validate (RPI — Phase 4)
|
|
2
|
-
|
|
3
|
-
Use this prompt to verify that the implementation satisfies the spec and all acceptance criteria.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Agent instruction
|
|
8
|
-
|
|
9
|
-
You will validate the implementation of a completed feature against its spec and test cases.
|
|
10
|
-
|
|
11
|
-
**Before starting, read:**
|
|
12
|
-
- `agents/AGENTS.md`
|
|
13
|
-
- `agents/PROJECT.md`
|
|
14
|
-
- `agents/RULES.md`
|
|
15
|
-
- `agents/specs/NNN-name/SPEC.md`
|
|
16
|
-
- `agents/specs/NNN-name/TASK.md` — confirm all tasks are marked `[x]`
|
|
17
|
-
- `agents/specs/NNN-name/TEST.md`
|
|
18
|
-
- `agents/specs/NNN-name/PROGRESS.md`
|
|
19
|
-
- The code files produced during Implement (listed in PROGRESS.md History)
|
|
20
|
-
|
|
21
|
-
**Expected input:**
|
|
22
|
-
- Spec number and name (e.g. `001-user-authentication`)
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Validation procedure
|
|
27
|
-
|
|
28
|
-
### Step 1 — Confirm implementation is complete
|
|
29
|
-
Check that every task in `TASK.md` is marked `[x]`.
|
|
30
|
-
If any `[ ]` remains, **stop and report** — do not proceed with validation.
|
|
31
|
-
|
|
32
|
-
### Step 2 — Verify task-level conditions
|
|
33
|
-
For each task in `TASK.md`, read its `verify:` condition and check whether
|
|
34
|
-
the produced code satisfies it. Examine the actual files — do not assume.
|
|
35
|
-
|
|
36
|
-
### Step 3 — Verify acceptance test cases
|
|
37
|
-
For each test case in `TEST.md`, assess whether the implementation satisfies
|
|
38
|
-
the Given/When/Then scenario. Read the relevant code directly.
|
|
39
|
-
|
|
40
|
-
### Step 4 — Produce VALIDATION.md
|
|
41
|
-
Write `agents/specs/NNN-name/VALIDATION.md` with the structure below.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Deliverable: VALIDATION.md
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
# VALIDATION — [Feature Name]
|
|
49
|
-
|
|
50
|
-
## Status: [✅ Approved | ⚠️ Partial | ❌ Failed]
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Task Verification
|
|
55
|
-
|
|
56
|
-
| Task | verify: condition | Status |
|
|
57
|
-
|---|---|---|
|
|
58
|
-
| T01 | [condition from TASK.md] | ✅ Met / ❌ Not met / ⚠️ Partial |
|
|
59
|
-
| T02 | ... | ... |
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Acceptance Test Coverage
|
|
64
|
-
|
|
65
|
-
| Test Case | Description | Status | Evidence |
|
|
66
|
-
|---|---|---|---|
|
|
67
|
-
| TC01 | [behavior being tested] | ✅ Verified / ❌ Not met / ⚠️ Partial | [file and line or behavior observed in code] |
|
|
68
|
-
| TC02 | ... | ... | ... |
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Gaps Found
|
|
73
|
-
|
|
74
|
-
List any `verify:` conditions or test cases that are not fully met.
|
|
75
|
-
Write `None` if everything is satisfied.
|
|
76
|
-
|
|
77
|
-
- [ ] [Gap description — what is missing or incorrect]
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Recommendation
|
|
82
|
-
|
|
83
|
-
[Approve — all criteria met]
|
|
84
|
-
[Request fixes — list the gaps that must be resolved before approval]
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Constraints
|
|
90
|
-
|
|
91
|
-
- Do not write or modify any code in this phase
|
|
92
|
-
- Do not mark gaps as acceptable — report them, even if minor
|
|
93
|
-
- If a test case cannot be verified from static code analysis alone, flag it explicitly:
|
|
94
|
-
`⚠️ Requires runtime verification — cannot confirm from code alone`
|
|
95
|
-
- After delivering VALIDATION.md, **wait for developer review**
|
|
96
|
-
- If gaps are found and fixed, a new Validate session must be run — do not reuse this report
|
|
1
|
+
# Prompt: Validate (RPI — Phase 4)
|
|
2
|
+
|
|
3
|
+
Use this prompt to verify that the implementation satisfies the spec and all acceptance criteria.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Agent instruction
|
|
8
|
+
|
|
9
|
+
You will validate the implementation of a completed feature against its spec and test cases.
|
|
10
|
+
|
|
11
|
+
**Before starting, read:**
|
|
12
|
+
- `agents/AGENTS.md`
|
|
13
|
+
- `agents/PROJECT.md`
|
|
14
|
+
- `agents/RULES.md`
|
|
15
|
+
- `agents/specs/NNN-name/SPEC.md`
|
|
16
|
+
- `agents/specs/NNN-name/TASK.md` — confirm all tasks are marked `[x]`
|
|
17
|
+
- `agents/specs/NNN-name/TEST.md`
|
|
18
|
+
- `agents/specs/NNN-name/PROGRESS.md`
|
|
19
|
+
- The code files produced during Implement (listed in PROGRESS.md History)
|
|
20
|
+
|
|
21
|
+
**Expected input:**
|
|
22
|
+
- Spec number and name (e.g. `001-user-authentication`)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Validation procedure
|
|
27
|
+
|
|
28
|
+
### Step 1 — Confirm implementation is complete
|
|
29
|
+
Check that every task in `TASK.md` is marked `[x]`.
|
|
30
|
+
If any `[ ]` remains, **stop and report** — do not proceed with validation.
|
|
31
|
+
|
|
32
|
+
### Step 2 — Verify task-level conditions
|
|
33
|
+
For each task in `TASK.md`, read its `verify:` condition and check whether
|
|
34
|
+
the produced code satisfies it. Examine the actual files — do not assume.
|
|
35
|
+
|
|
36
|
+
### Step 3 — Verify acceptance test cases
|
|
37
|
+
For each test case in `TEST.md`, assess whether the implementation satisfies
|
|
38
|
+
the Given/When/Then scenario. Read the relevant code directly.
|
|
39
|
+
|
|
40
|
+
### Step 4 — Produce VALIDATION.md
|
|
41
|
+
Write `agents/specs/NNN-name/VALIDATION.md` with the structure below.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Deliverable: VALIDATION.md
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
# VALIDATION — [Feature Name]
|
|
49
|
+
|
|
50
|
+
## Status: [✅ Approved | ⚠️ Partial | ❌ Failed]
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Task Verification
|
|
55
|
+
|
|
56
|
+
| Task | verify: condition | Status |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| T01 | [condition from TASK.md] | ✅ Met / ❌ Not met / ⚠️ Partial |
|
|
59
|
+
| T02 | ... | ... |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Acceptance Test Coverage
|
|
64
|
+
|
|
65
|
+
| Test Case | Description | Status | Evidence |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| TC01 | [behavior being tested] | ✅ Verified / ❌ Not met / ⚠️ Partial | [file and line or behavior observed in code] |
|
|
68
|
+
| TC02 | ... | ... | ... |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Gaps Found
|
|
73
|
+
|
|
74
|
+
List any `verify:` conditions or test cases that are not fully met.
|
|
75
|
+
Write `None` if everything is satisfied.
|
|
76
|
+
|
|
77
|
+
- [ ] [Gap description — what is missing or incorrect]
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Recommendation
|
|
82
|
+
|
|
83
|
+
[Approve — all criteria met]
|
|
84
|
+
[Request fixes — list the gaps that must be resolved before approval]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Constraints
|
|
90
|
+
|
|
91
|
+
- Do not write or modify any code in this phase
|
|
92
|
+
- Do not mark gaps as acceptable — report them, even if minor
|
|
93
|
+
- If a test case cannot be verified from static code analysis alone, flag it explicitly:
|
|
94
|
+
`⚠️ Requires runtime verification — cannot confirm from code alone`
|
|
95
|
+
- After delivering VALIDATION.md, **wait for developer review**
|
|
96
|
+
- If gaps are found and fixed, a new Validate session must be run — do not reuse this report
|