specdacular 0.8.1 → 0.9.2
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 +166 -54
- package/commands/specd/continue.md +22 -14
- package/commands/specd/toolbox.md +58 -14
- package/package.json +1 -1
- package/specdacular/HELP.md +70 -9
- package/specdacular/STATE-MACHINE.md +376 -0
- package/specdacular/pipeline.json +76 -0
- package/specdacular/references/brain-routing.md +168 -0
- package/specdacular/references/commit-code.md +9 -6
- package/specdacular/references/commit-docs.md +9 -6
- package/specdacular/references/execute-hooks.md +127 -0
- package/specdacular/references/resolve-pipeline.md +74 -0
- package/specdacular/templates/context/review-diff.md +60 -0
- package/specdacular/templates/context/section-display.md +51 -0
- package/specdacular/workflows/brain.md +378 -0
- package/specdacular/workflows/context-add.md +242 -0
- package/specdacular/workflows/context-manual-review.md +410 -0
- package/specdacular/workflows/continue.md +17 -259
- package/specdacular/workflows/execute.md +15 -42
- package/specdacular/workflows/map-codebase.md +14 -0
- package/specdacular/workflows/phase-plan.md +142 -0
- package/specdacular/workflows/plan.md +10 -37
- package/specdacular/workflows/research.md +25 -7
- package/specdacular/workflows/review.md +11 -136
- package/specdacular/workflows/revise.md +126 -0
|
@@ -42,9 +42,22 @@ Load all task context. Extract:
|
|
|
42
42
|
- Technology stack (from codebase docs if available)
|
|
43
43
|
- Files to create/modify (from FEATURE.md)
|
|
44
44
|
|
|
45
|
+
**Detect phase-level research:**
|
|
46
|
+
Read `.specd/tasks/$TASK_NAME/config.json`. If `stage` is `"execution"`, this is phase-level research:
|
|
47
|
+
- Read `phases.current` to determine the current phase number
|
|
48
|
+
- Set `$PHASE_NUM` to the zero-padded phase number (e.g., `01`)
|
|
49
|
+
- Read the phase plan: `.specd/tasks/$TASK_NAME/phases/phase-$PHASE_NUM/PLAN.md`
|
|
50
|
+
- Append the phase plan contents to `$TASK_CONTEXT` so research agents have phase-specific context
|
|
51
|
+
- Set `$RESEARCH_OUTPUT` to `.specd/tasks/$TASK_NAME/phases/phase-$PHASE_NUM/RESEARCH.md`
|
|
52
|
+
- Set `$PHASE_LEVEL = true`
|
|
53
|
+
|
|
54
|
+
**If not in execution stage (task-level research):**
|
|
55
|
+
- Set `$RESEARCH_OUTPUT` to `.specd/tasks/$TASK_NAME/RESEARCH.md`
|
|
56
|
+
- Set `$PHASE_LEVEL = false`
|
|
57
|
+
|
|
45
58
|
**Check if RESEARCH.md already exists:**
|
|
46
59
|
```bash
|
|
47
|
-
[ -f "
|
|
60
|
+
[ -f "$RESEARCH_OUTPUT" ] && echo "existing"
|
|
48
61
|
```
|
|
49
62
|
|
|
50
63
|
**If exists:**
|
|
@@ -93,7 +106,7 @@ Continue to synthesize.
|
|
|
93
106
|
<step name="synthesize">
|
|
94
107
|
@~/.claude/specdacular/references/synthesize-research.md
|
|
95
108
|
|
|
96
|
-
Combine agent outputs into `.
|
|
109
|
+
Combine agent outputs into `$RESEARCH_OUTPUT`.
|
|
97
110
|
|
|
98
111
|
Continue to record_decisions.
|
|
99
112
|
</step>
|
|
@@ -109,10 +122,15 @@ Continue to update_state.
|
|
|
109
122
|
<step name="update_state">
|
|
110
123
|
Update STATE.md and config.json.
|
|
111
124
|
|
|
112
|
-
**
|
|
113
|
-
-
|
|
125
|
+
**If phase-level research (`$PHASE_LEVEL = true`):**
|
|
126
|
+
- Update STATE.md to note phase research was conducted
|
|
127
|
+
- Do NOT change `stage` in config.json (stay in "execution")
|
|
128
|
+
- Continue to commit
|
|
129
|
+
|
|
130
|
+
**If task-level research (`$PHASE_LEVEL = false`):**
|
|
131
|
+
- Mark research as conducted in STATE.md
|
|
114
132
|
- Mark RESEARCH.md as created
|
|
115
|
-
- Update decisions count
|
|
133
|
+
- Update decisions count in STATE.md and config.json
|
|
116
134
|
|
|
117
135
|
**config.json:**
|
|
118
136
|
- Update `decisions_count`
|
|
@@ -123,8 +141,8 @@ Continue to commit.
|
|
|
123
141
|
<step name="commit">
|
|
124
142
|
@~/.claude/specdacular/references/commit-docs.md
|
|
125
143
|
|
|
126
|
-
- **$FILES:**
|
|
127
|
-
- **$MESSAGE:** `docs({task-name}): research complete` with key findings summary
|
|
144
|
+
- **$FILES:** `$RESEARCH_OUTPUT .specd/tasks/{task-name}/DECISIONS.md .specd/tasks/{task-name}/STATE.md .specd/tasks/{task-name}/config.json`
|
|
145
|
+
- **$MESSAGE:** `docs({task-name}): research complete` (or `docs({task-name}): phase {NN} research complete` for phase-level) with key findings summary
|
|
128
146
|
- **$LABEL:** `research findings`
|
|
129
147
|
|
|
130
148
|
Continue to completion.
|
|
@@ -3,7 +3,7 @@ Review executed phase by comparing plan intent against actual code. Combines sem
|
|
|
3
3
|
|
|
4
4
|
**Core principle:** Claude inspects first, then shows findings to user. User decides.
|
|
5
5
|
|
|
6
|
-
**Output:**
|
|
6
|
+
**Output:** Review findings presented, user choice recorded for brain routing (approve, revise, or stop).
|
|
7
7
|
</purpose>
|
|
8
8
|
|
|
9
9
|
<philosophy>
|
|
@@ -16,10 +16,6 @@ Plans describe intent. Code implements intent. Check whether intent was fulfille
|
|
|
16
16
|
|
|
17
17
|
Claude reads the code and compares against the plan first. Then presents findings with the git diff. The user gets a curated view, not a raw dump.
|
|
18
18
|
|
|
19
|
-
## Fix Plans, Not Inline Fixes
|
|
20
|
-
|
|
21
|
-
When the user reports issues, create proper PLAN.md files in decimal phases. These get executed through the same execute workflow.
|
|
22
|
-
|
|
23
19
|
## Deviations Are Neutral
|
|
24
20
|
|
|
25
21
|
A deviation means code differs from plan. It might be an improvement. The review surfaces it; the user decides.
|
|
@@ -32,17 +28,8 @@ A deviation means code differs from plan. It might be an improvement. The review
|
|
|
32
28
|
@~/.claude/specdacular/references/validate-task.md
|
|
33
29
|
|
|
34
30
|
Use extended validation. Also check:
|
|
35
|
-
- `config.json` → `phases.current_status` must be "executed"
|
|
36
31
|
- `config.json` → `phases.phase_start_commit` must exist
|
|
37
32
|
|
|
38
|
-
**If status is not "executed":**
|
|
39
|
-
```
|
|
40
|
-
Phase {N} is not ready for review (status: {status}).
|
|
41
|
-
|
|
42
|
-
Run /specd:continue {task-name} to get to the right step.
|
|
43
|
-
```
|
|
44
|
-
End workflow.
|
|
45
|
-
|
|
46
33
|
Continue to load_context.
|
|
47
34
|
</step>
|
|
48
35
|
|
|
@@ -53,14 +40,14 @@ Load all context including the current phase's PLAN.md.
|
|
|
53
40
|
|
|
54
41
|
**Read phase plan:**
|
|
55
42
|
```bash
|
|
56
|
-
PHASE_NUM=$(cat
|
|
57
|
-
PHASE_DIR="
|
|
43
|
+
PHASE_NUM=$(cat $TASK_DIR/config.json | grep -o '"current": [0-9]*' | grep -o '[0-9]*')
|
|
44
|
+
PHASE_DIR="$TASK_DIR/phases/phase-$(printf '%02d' $PHASE_NUM)"
|
|
58
45
|
cat "$PHASE_DIR/PLAN.md"
|
|
59
46
|
```
|
|
60
47
|
|
|
61
48
|
**Get phase start commit:**
|
|
62
49
|
```bash
|
|
63
|
-
cat
|
|
50
|
+
cat $TASK_DIR/config.json | grep phase_start_commit
|
|
64
51
|
```
|
|
65
52
|
|
|
66
53
|
Continue to inspect_code.
|
|
@@ -156,121 +143,11 @@ Use AskUserQuestion:
|
|
|
156
143
|
- "I have concerns" — Describe issues
|
|
157
144
|
- "Stop for now" — Come back later
|
|
158
145
|
|
|
159
|
-
**
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
**If "Stop for now":**
|
|
166
|
-
```
|
|
167
|
-
Progress saved. Phase stays in "executed" state.
|
|
168
|
-
Resume review with /specd:continue {task-name}
|
|
169
|
-
```
|
|
170
|
-
End workflow.
|
|
171
|
-
</step>
|
|
172
|
-
|
|
173
|
-
<step name="collect_feedback">
|
|
174
|
-
Gather specific feedback from user.
|
|
175
|
-
|
|
176
|
-
```
|
|
177
|
-
Tell me what needs fixing. You can describe:
|
|
178
|
-
- Bugs or incorrect behavior
|
|
179
|
-
- Approach you'd prefer changed
|
|
180
|
-
- Missing functionality
|
|
181
|
-
- Code quality issues
|
|
182
|
-
|
|
183
|
-
Describe as many issues as you want — I'll create a fix plan for all of them.
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Wait for user response. Follow up to understand each issue clearly.
|
|
187
|
-
|
|
188
|
-
Continue to create_fix_plan.
|
|
189
|
-
</step>
|
|
190
|
-
|
|
191
|
-
<step name="create_fix_plan">
|
|
192
|
-
Create a fix plan in a decimal phase.
|
|
193
|
-
|
|
194
|
-
**Determine fix phase number:**
|
|
195
|
-
```bash
|
|
196
|
-
ls -d .specd/tasks/$TASK_NAME/phases/phase-$CURRENT.* 2>/dev/null | sort -V | tail -1
|
|
197
|
-
```
|
|
198
|
-
- If no decimal phases → create `phase-{N}.1/`
|
|
199
|
-
- If `phase-{N}.1/` exists → create `phase-{N}.2/`, etc.
|
|
200
|
-
|
|
201
|
-
**Create fix phase directory and PLAN.md:**
|
|
202
|
-
```bash
|
|
203
|
-
mkdir -p .specd/tasks/$TASK_NAME/phases/phase-{N.M}/
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
Write `PLAN.md` using standard plan format:
|
|
207
|
-
- Objective: Address review feedback for Phase {N}
|
|
208
|
-
- Tasks: One per issue reported, with clear fix description and verification
|
|
209
|
-
|
|
210
|
-
**Update ROADMAP.md:**
|
|
211
|
-
Add fix phase entry after the parent phase.
|
|
212
|
-
|
|
213
|
-
**Commit:**
|
|
214
|
-
@~/.claude/specdacular/references/commit-docs.md
|
|
215
|
-
- **$FILES:** fix plan directory + ROADMAP.md
|
|
216
|
-
- **$MESSAGE:** `docs({task-name}): create fix plan phase-{N.M}`
|
|
217
|
-
- **$LABEL:** `fix plan`
|
|
218
|
-
|
|
219
|
-
**Offer execution:**
|
|
220
|
-
Use AskUserQuestion:
|
|
221
|
-
- header: "Fix Plan"
|
|
222
|
-
- question: "Execute the fix plan now?"
|
|
223
|
-
- options:
|
|
224
|
-
- "Execute" — Run the fix plan
|
|
225
|
-
- "Stop for now" — Come back later
|
|
226
|
-
|
|
227
|
-
**If "Execute":**
|
|
228
|
-
Execute fix plan via:
|
|
229
|
-
@~/.claude/specdacular/workflows/execute.md
|
|
230
|
-
|
|
231
|
-
After fix execution, loop back to the validate step of this review workflow (re-review with updated diff).
|
|
232
|
-
|
|
233
|
-
**If "Stop for now":**
|
|
234
|
-
```
|
|
235
|
-
Fix plan saved. Resume with /specd:continue {task-name}
|
|
236
|
-
```
|
|
237
|
-
End workflow.
|
|
238
|
-
</step>
|
|
239
|
-
|
|
240
|
-
<step name="approve_phase">
|
|
241
|
-
Mark phase as completed and advance.
|
|
242
|
-
|
|
243
|
-
**Update config.json:**
|
|
244
|
-
- Set `phases.current_status` to "completed"
|
|
245
|
-
- Increment `phases.completed`
|
|
246
|
-
- Advance `phases.current` to next phase
|
|
247
|
-
- Reset `phases.phase_start_commit` to null
|
|
248
|
-
- Set new phase status to "pending"
|
|
249
|
-
|
|
250
|
-
**Update STATE.md:**
|
|
251
|
-
- Mark phase as complete in execution progress
|
|
252
|
-
|
|
253
|
-
**Add review cycle to STATE.md:**
|
|
254
|
-
```markdown
|
|
255
|
-
| {N} | 1 | {date} | {summary} | {fix plans or "—"} | clean |
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
**Commit:**
|
|
259
|
-
@~/.claude/specdacular/references/commit-docs.md
|
|
260
|
-
- **$FILES:** config.json + STATE.md
|
|
261
|
-
- **$MESSAGE:** `docs({task-name}): phase {N} approved`
|
|
262
|
-
- **$LABEL:** `phase approved`
|
|
263
|
-
|
|
264
|
-
**Present:**
|
|
265
|
-
```
|
|
266
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
267
|
-
PHASE {N} COMPLETE
|
|
268
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
269
|
-
|
|
270
|
-
Phase {N}: {phase-name} approved.
|
|
271
|
-
{If more phases: "Next: Phase {N+1}: {next-phase-name}"}
|
|
272
|
-
{If all phases done: "All phases complete! Task '{task-name}' is done."}
|
|
273
|
-
```
|
|
146
|
+
**Record the user's choice** so the brain can route accordingly.
|
|
147
|
+
The brain reads this choice and handles:
|
|
148
|
+
- "Looks good" → brain approves phase (updates config.json, advances)
|
|
149
|
+
- "I want to revise" / "I have concerns" → brain dispatches revise.md
|
|
150
|
+
- "Stop for now" → brain saves state, exits
|
|
274
151
|
|
|
275
152
|
End workflow (caller handles continuation).
|
|
276
153
|
</step>
|
|
@@ -282,8 +159,6 @@ End workflow (caller handles continuation).
|
|
|
282
159
|
- Git diff presented to user
|
|
283
160
|
- Per-task status with icons (✅ ⚠️ ❌)
|
|
284
161
|
- User can approve, revise, or stop
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
- Review loops after fix execution
|
|
288
|
-
- Phase advances only after explicit user approval
|
|
162
|
+
- User's choice recorded for brain routing
|
|
163
|
+
- Phase advances only through brain (not in this workflow)
|
|
289
164
|
</success_criteria>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Collect user feedback on review findings and create fix plans in decimal phases. Extracted from review.md — revise handles the "what to fix" conversation while review handles pure inspection.
|
|
3
|
+
|
|
4
|
+
**Output:** Fix plan in decimal phase directory (e.g., phase-01.1/PLAN.md), updated ROADMAP.md, config.json signaling for brain routing.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<philosophy>
|
|
8
|
+
|
|
9
|
+
## Fix Plans, Not Inline Fixes
|
|
10
|
+
|
|
11
|
+
When the user reports issues, create proper PLAN.md files in decimal phases. These get executed through the same execute workflow.
|
|
12
|
+
|
|
13
|
+
## Clear Signal to Brain
|
|
14
|
+
|
|
15
|
+
After creating a fix plan, signal the brain by setting `phases.current_status: "pending"` so the brain routes back to execute for the current phase.
|
|
16
|
+
|
|
17
|
+
</philosophy>
|
|
18
|
+
|
|
19
|
+
<process>
|
|
20
|
+
|
|
21
|
+
<step name="validate">
|
|
22
|
+
@~/.claude/specdacular/references/validate-task.md
|
|
23
|
+
|
|
24
|
+
Use extended validation. Check phases and ROADMAP exist.
|
|
25
|
+
|
|
26
|
+
Continue to load_context.
|
|
27
|
+
</step>
|
|
28
|
+
|
|
29
|
+
<step name="load_context">
|
|
30
|
+
@~/.claude/specdacular/references/load-context.md
|
|
31
|
+
|
|
32
|
+
Load all context including the current phase's PLAN.md and review findings.
|
|
33
|
+
|
|
34
|
+
**Read phase info:**
|
|
35
|
+
```bash
|
|
36
|
+
PHASE_NUM=$(cat $TASK_DIR/config.json | grep -o '"current": [0-9]*' | grep -o '[0-9]*')
|
|
37
|
+
PHASE_DIR="$TASK_DIR/phases/phase-$(printf '%02d' $PHASE_NUM)"
|
|
38
|
+
cat "$PHASE_DIR/PLAN.md"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Continue to collect_feedback.
|
|
42
|
+
</step>
|
|
43
|
+
|
|
44
|
+
<step name="collect_feedback">
|
|
45
|
+
Gather specific feedback from user.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Tell me what needs fixing. You can describe:
|
|
49
|
+
- Bugs or incorrect behavior
|
|
50
|
+
- Approach you'd prefer changed
|
|
51
|
+
- Missing functionality
|
|
52
|
+
- Code quality issues
|
|
53
|
+
|
|
54
|
+
Describe as many issues as you want — I'll create a fix plan for all of them.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Wait for user response. Follow up to understand each issue clearly.
|
|
58
|
+
|
|
59
|
+
Continue to create_fix_plan.
|
|
60
|
+
</step>
|
|
61
|
+
|
|
62
|
+
<step name="create_fix_plan">
|
|
63
|
+
Create a fix plan in a decimal phase.
|
|
64
|
+
|
|
65
|
+
**Determine fix phase number:**
|
|
66
|
+
```bash
|
|
67
|
+
CURRENT=$(printf '%02d' $PHASE_NUM)
|
|
68
|
+
ls -d $TASK_DIR/phases/phase-$CURRENT.* 2>/dev/null | sort -V | tail -1
|
|
69
|
+
```
|
|
70
|
+
- If no decimal phases → create `phase-{N}.1/`
|
|
71
|
+
- If `phase-{N}.1/` exists → create `phase-{N}.2/`, etc.
|
|
72
|
+
|
|
73
|
+
**Create fix phase directory and PLAN.md:**
|
|
74
|
+
```bash
|
|
75
|
+
mkdir -p $TASK_DIR/phases/phase-{N.M}/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Write `PLAN.md` using standard plan format:
|
|
79
|
+
- Objective: Address review feedback for Phase {N}
|
|
80
|
+
- Tasks: One per issue reported, with clear fix description and verification
|
|
81
|
+
|
|
82
|
+
**Update ROADMAP.md:**
|
|
83
|
+
Add fix phase entry after the parent phase.
|
|
84
|
+
|
|
85
|
+
Continue to signal_outcome.
|
|
86
|
+
</step>
|
|
87
|
+
|
|
88
|
+
<step name="signal_outcome">
|
|
89
|
+
Signal the brain that a fix plan was created and needs execution.
|
|
90
|
+
|
|
91
|
+
**Update config.json:**
|
|
92
|
+
- Set `phases.current_status` to `"pending"` — this tells the brain to route back to execute for the current phase (which will pick up the decimal fix phase)
|
|
93
|
+
|
|
94
|
+
Continue to commit.
|
|
95
|
+
</step>
|
|
96
|
+
|
|
97
|
+
<step name="commit">
|
|
98
|
+
@~/.claude/specdacular/references/commit-docs.md
|
|
99
|
+
|
|
100
|
+
- **$FILES:** fix plan directory + ROADMAP.md + config.json
|
|
101
|
+
- **$MESSAGE:** `docs({task-name}): create fix plan phase-{N.M}`
|
|
102
|
+
- **$LABEL:** `fix plan`
|
|
103
|
+
|
|
104
|
+
Continue to completion.
|
|
105
|
+
</step>
|
|
106
|
+
|
|
107
|
+
<step name="completion">
|
|
108
|
+
Present what was created.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
Fix plan created: phase-{N.M}
|
|
112
|
+
{count} tasks to address review feedback.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
End workflow (caller handles continuation).
|
|
116
|
+
</step>
|
|
117
|
+
|
|
118
|
+
</process>
|
|
119
|
+
|
|
120
|
+
<success_criteria>
|
|
121
|
+
- User feedback collected with clear understanding of issues
|
|
122
|
+
- Fix plan created in decimal phase directory
|
|
123
|
+
- ROADMAP.md updated with fix phase
|
|
124
|
+
- config.json signals brain to route back to execute
|
|
125
|
+
- Changes committed
|
|
126
|
+
</success_criteria>
|