specdacular 0.8.0 → 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.
Files changed (30) hide show
  1. package/README.md +166 -54
  2. package/commands/specd/continue.md +22 -14
  3. package/commands/specd/toolbox.md +58 -14
  4. package/package.json +1 -1
  5. package/specdacular/HELP.md +70 -9
  6. package/specdacular/STATE-MACHINE.md +376 -0
  7. package/specdacular/pipeline.json +76 -0
  8. package/specdacular/references/brain-routing.md +168 -0
  9. package/specdacular/references/commit-code.md +9 -6
  10. package/specdacular/references/commit-docs.md +9 -6
  11. package/specdacular/references/execute-hooks.md +127 -0
  12. package/specdacular/references/load-context.md +10 -9
  13. package/specdacular/references/resolve-pipeline.md +74 -0
  14. package/specdacular/references/select-feature.md +12 -5
  15. package/specdacular/references/validate-task.md +19 -11
  16. package/specdacular/templates/context/review-diff.md +60 -0
  17. package/specdacular/templates/context/section-display.md +51 -0
  18. package/specdacular/workflows/brain.md +378 -0
  19. package/specdacular/workflows/context-add.md +242 -0
  20. package/specdacular/workflows/context-manual-review.md +410 -0
  21. package/specdacular/workflows/continue.md +17 -259
  22. package/specdacular/workflows/execute.md +15 -42
  23. package/specdacular/workflows/map-codebase.md +14 -0
  24. package/specdacular/workflows/new.md +2 -2
  25. package/specdacular/workflows/phase-plan.md +142 -0
  26. package/specdacular/workflows/plan.md +10 -37
  27. package/specdacular/workflows/research.md +25 -7
  28. package/specdacular/workflows/review.md +11 -136
  29. package/specdacular/workflows/revise.md +126 -0
  30. package/specdacular/workflows/status.md +1 -1
@@ -1,14 +1,14 @@
1
1
  <purpose>
2
- Execute the next phase's PLAN.md. Runs tasks with verification, handles deviations, commits after each task, and automatically triggers review when the phase is complete.
2
+ Execute the current phase's PLAN.md. Runs tasks with verification, handles deviations, commits after each task. Does NOT trigger review the brain handles that.
3
3
 
4
- **Output:** Implemented code, CHANGELOG.md entries, automatic review trigger
4
+ **Output:** Implemented code, CHANGELOG.md entries
5
5
  </purpose>
6
6
 
7
7
  <philosophy>
8
8
 
9
9
  ## One Phase at a Time
10
10
 
11
- Execute one phase's PLAN.md, then review before moving on. Never skip review.
11
+ Execute one phase's PLAN.md. The brain decides what happens after.
12
12
 
13
13
  ## Verify Each Task
14
14
 
@@ -49,31 +49,21 @@ Continue to find_phase.
49
49
  </step>
50
50
 
51
51
  <step name="find_phase">
52
- Find the next phase to execute.
52
+ Find the phase to execute.
53
53
 
54
54
  **Read config.json:**
55
55
  - `phases.current` — current phase number
56
- - `phases.current_status` — pending, executing, executed, completed
57
-
58
- **If current_status is "executed":**
59
- Phase is done but not reviewed. Trigger review:
60
- @~/.claude/specdacular/workflows/review.md
61
- End this workflow.
62
-
63
- **If current_status is "completed":**
64
- Advance to next phase:
65
- - Increment `phases.current`
66
- - Set `phases.current_status` to "pending"
56
+ - `phases.current_status` — should be "pending" or "executing"
67
57
 
68
58
  **Find PLAN.md:**
69
59
  ```bash
70
- PHASE_DIR=".specd/tasks/$TASK_NAME/phases/phase-$(printf '%02d' $CURRENT_PHASE)"
60
+ PHASE_DIR="$TASK_DIR/phases/phase-$(printf '%02d' $CURRENT_PHASE)"
71
61
  [ -f "$PHASE_DIR/PLAN.md" ] || { echo "no plan"; exit 1; }
72
62
  ```
73
63
 
74
64
  **Also check for fix plans (decimal phases):**
75
65
  ```bash
76
- ls -d .specd/tasks/$TASK_NAME/phases/phase-$CURRENT_PHASE.* 2>/dev/null
66
+ ls -d $TASK_DIR/phases/phase-$(printf '%02d' $CURRENT_PHASE).* 2>/dev/null
77
67
  ```
78
68
  If fix plans exist and are incomplete, execute those first.
79
69
 
@@ -85,21 +75,11 @@ Continue to record_start.
85
75
  <step name="record_start">
86
76
  Record phase execution start.
87
77
 
88
- **If status is "pending" (first time executing this phase):**
78
+ **If this is a fresh start (not resuming):**
89
79
  ```bash
90
80
  git rev-parse HEAD
91
81
  ```
92
- Store as `phases.phase_start_commit` in config.json.
93
- Set `phases.current_status` to "executing".
94
-
95
- Commit config update:
96
- ```bash
97
- git add .specd/tasks/{task-name}/config.json
98
- git commit -m "docs({task-name}): start phase {N} execution"
99
- ```
100
-
101
- **If status is already "executing":**
102
- Resuming — phase_start_commit already recorded.
82
+ Store as `phases.phase_start_commit` in config.json if not already set.
103
83
 
104
84
  Continue to execute_tasks.
105
85
  </step>
@@ -137,29 +117,23 @@ Continue to phase_complete.
137
117
  </step>
138
118
 
139
119
  <step name="phase_complete">
140
- Mark phase as executed and trigger review.
141
-
142
- **Update config.json:**
143
- - Set `phases.current_status` to "executed"
120
+ Mark phase execution as done.
144
121
 
145
122
  **Update STATE.md:**
146
- - Add phase to Completed Phases table
123
+ - Add phase to Completed Phases table (or update if fix phase)
147
124
  - Update current phase info
148
125
 
149
126
  **Commit state:**
150
127
  @~/.claude/specdacular/references/commit-docs.md
151
- - **$FILES:** `.specd/tasks/{task-name}/STATE.md .specd/tasks/{task-name}/config.json .specd/tasks/{task-name}/CHANGELOG.md`
128
+ - **$FILES:** `$TASK_DIR/STATE.md $TASK_DIR/CHANGELOG.md`
152
129
  - **$MESSAGE:** `docs({task-name}): phase {N} executed`
153
130
  - **$LABEL:** `phase execution complete`
154
131
 
155
- **Automatically trigger review:**
156
132
  ```
157
- Phase {N} execution complete. Starting code review...
133
+ Phase {N} execution complete.
158
134
  ```
159
135
 
160
- @~/.claude/specdacular/workflows/review.md
161
-
162
- End workflow (review takes over).
136
+ End workflow (caller handles continuation).
163
137
  </step>
164
138
 
165
139
  </process>
@@ -169,6 +143,5 @@ End workflow (review takes over).
169
143
  - Each task verified after implementation
170
144
  - Deviations logged in CHANGELOG.md
171
145
  - Code committed after each task
172
- - Phase marked as "executed" in config.json
173
- - Review automatically triggered after completion
146
+ - Ends cleanly without dispatching review
174
147
  </success_criteria>
@@ -609,6 +609,20 @@ Continue to commit_orchestrator_map.
609
609
  <step name="commit_orchestrator_map">
610
610
  Commit all mapping results (orchestrator + all sub-projects).
611
611
 
612
+ **IMPORTANT — Check auto-commit setting first:**
613
+
614
+ ```bash
615
+ cat .specd/config.json 2>/dev/null || echo '{"auto_commit_docs": true}'
616
+ ```
617
+
618
+ **If `auto_commit_docs` is `false`:** Do NOT commit. Print:
619
+ ```
620
+ Auto-commit disabled for docs — orchestrator codebase map not committed.
621
+ ```
622
+ Skip to orchestrator_completion.
623
+
624
+ **If `auto_commit_docs` is `true` or not set (default):**
625
+
612
626
  ```bash
613
627
  # Add orchestrator docs and config
614
628
  git add .specd/codebase/*.md .specd/config.json
@@ -52,10 +52,10 @@ Ask: "What's the name of this task?"
52
52
 
53
53
  **Validate:**
54
54
  - Task name should be kebab-case
55
- - Check if `.specd/tasks/{name}/` already exists
55
+ - Check if task already exists (in either `.specd/tasks/` or `.specd/features/`)
56
56
 
57
57
  ```bash
58
- [ -d ".specd/tasks/$TASK_NAME" ] && echo "exists"
58
+ { [ -d ".specd/tasks/$TASK_NAME" ] || [ -d ".specd/features/$TASK_NAME" ]; } && echo "exists"
59
59
  ```
60
60
 
61
61
  **If task exists:**
@@ -0,0 +1,142 @@
1
+ <purpose>
2
+ Create a detailed PLAN.md for the current phase. Reads the phase goal from ROADMAP.md, considers what happened in previous phases, and creates an actionable plan with tasks.
3
+
4
+ This is the phase-level counterpart to plan.md (which creates the high-level ROADMAP.md). Each phase gets its own just-in-time planning, allowing later phases to adapt based on earlier execution.
5
+
6
+ **Output:** `phases/phase-NN/PLAN.md`, updated STATE.md
7
+ </purpose>
8
+
9
+ <philosophy>
10
+
11
+ ## Just-In-Time Planning
12
+
13
+ Plans are created when the phase starts, not upfront. This means the plan can account for deviations, discoveries, and changes from earlier phases.
14
+
15
+ ## Small and Focused
16
+
17
+ One phase, one PLAN.md. 2-5 tasks. Each task creates or modifies 1-3 files.
18
+
19
+ ## Self-Contained Plans
20
+
21
+ Each PLAN.md should have enough context that the executing agent doesn't need to ask questions. Reference decisions, research, and codebase patterns.
22
+
23
+ </philosophy>
24
+
25
+ <process>
26
+
27
+ <step name="validate">
28
+ @~/.claude/specdacular/references/validate-task.md
29
+
30
+ Use basic validation with $TASK_NAME.
31
+
32
+ Also check:
33
+ - ROADMAP.md must exist (source of phase goals)
34
+ - config.json must have phases.current set
35
+
36
+ Continue to load_context.
37
+ </step>
38
+
39
+ <step name="load_context">
40
+ @~/.claude/specdacular/references/load-context.md
41
+
42
+ Load all task context including RESEARCH.md if available.
43
+
44
+ **Read phase info:**
45
+ - `phases.current` from config.json → current phase number
46
+ - Phase goal from ROADMAP.md → find the "Phase {N}" section
47
+
48
+ **Read previous phase context (if not phase 1):**
49
+ - Check completed phases for deviations in CHANGELOG.md
50
+ - Read previous phase PLAN.md files to understand what was done
51
+ - Note any decisions made during earlier execution
52
+
53
+ **Read global config:**
54
+ ```bash
55
+ cat .specd/config.json 2>/dev/null || echo '{}'
56
+ ```
57
+ Check `auto_commit_docs` setting.
58
+
59
+ Continue to create_plan.
60
+ </step>
61
+
62
+ <step name="create_plan">
63
+ Create the phase directory and write PLAN.md.
64
+
65
+ **Create phase directory:**
66
+ ```bash
67
+ PHASE_NUM=$(printf '%02d' $CURRENT_PHASE)
68
+ mkdir -p .specd/tasks/$TASK_NAME/phases/phase-$PHASE_NUM
69
+ ```
70
+
71
+ **Write PLAN.md:**
72
+ Use template from: `~/.claude/specdacular/templates/tasks/PLAN.md`
73
+
74
+ Fill in based on ROADMAP.md goal and full task context:
75
+ - Objective: what the phase accomplishes (from ROADMAP.md)
76
+ - Context: reference codebase patterns, relevant decisions, research findings, previous phase outcomes
77
+ - Tasks: 2-5 tasks with clear actions, verification, and done-when criteria
78
+
79
+ **Each task should include:**
80
+ - Files affected
81
+ - Clear action description
82
+ - Verification command
83
+ - Done-when checklist
84
+
85
+ **Adapt based on previous phases:**
86
+ If earlier phases had deviations or discoveries, adjust this phase's plan accordingly. This is the key benefit of just-in-time planning.
87
+
88
+ Continue to update_state.
89
+ </step>
90
+
91
+ <step name="update_state">
92
+ Update STATE.md to note phase planning.
93
+
94
+ **STATE.md:**
95
+ - Note that phase {N} plan was created
96
+ - Update documents status
97
+
98
+ **Do NOT change config.json stage or phases.current_status.** The brain manages state transitions. Phase status stays "pending" — the brain will check for PLAN.md existence and route to execute next.
99
+
100
+ Continue to commit.
101
+ </step>
102
+
103
+ <step name="commit">
104
+ @~/.claude/specdacular/references/commit-docs.md
105
+
106
+ - **$FILES:** `.specd/tasks/{task-name}/phases/phase-{NN}/PLAN.md .specd/tasks/{task-name}/STATE.md`
107
+ - **$MESSAGE:** `docs({task-name}): plan phase {N}` with brief plan summary
108
+ - **$LABEL:** `phase planning`
109
+
110
+ Continue to completion.
111
+ </step>
112
+
113
+ <step name="completion">
114
+ Present the phase plan.
115
+
116
+ ```
117
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+ PHASE {N} PLANNED
119
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
+
121
+ **Task:** {task-name}
122
+ **Phase:** {N} — {phase title}
123
+ **Tasks:** {count}
124
+
125
+ {For each task:}
126
+ Task {N}: {title}
127
+ Files: {file list}
128
+ ```
129
+
130
+ End workflow (caller handles continuation).
131
+ </step>
132
+
133
+ </process>
134
+
135
+ <success_criteria>
136
+ - Phase directory created
137
+ - PLAN.md written with detailed tasks from ROADMAP.md goal
138
+ - Previous phase outcomes considered in planning
139
+ - STATE.md updated
140
+ - Changes committed
141
+ - config.json NOT modified (brain manages state)
142
+ </success_criteria>
@@ -1,7 +1,7 @@
1
1
  <purpose>
2
- Create execution phases from task context. Derives phases based on dependencies, creates one PLAN.md per phase, and writes ROADMAP.md.
2
+ Create a high-level execution roadmap from task context. Derives phases based on dependencies and writes ROADMAP.md with phase goals. Does NOT create PLAN.md files or phase directories those are created just-in-time by phase-plan.md when each phase starts.
3
3
 
4
- **Output:** `phases/phase-NN/PLAN.md` files, ROADMAP.md, updated STATE.md
4
+ **Output:** ROADMAP.md, updated STATE.md, config.json
5
5
  </purpose>
6
6
 
7
7
  <philosophy>
@@ -98,36 +98,7 @@ Break the task into ordered phases based on dependencies.
98
98
  - Each task creates or modifies 1-3 files
99
99
  - If a phase has >5 tasks, split it
100
100
 
101
- ```bash
102
- mkdir -p .specd/tasks/{task-name}/phases
103
- ```
104
-
105
- Continue to write_plans.
106
- </step>
107
-
108
- <step name="write_plans">
109
- Write one PLAN.md for each phase.
110
-
111
- For each phase:
112
-
113
- ```bash
114
- mkdir -p .specd/tasks/{task-name}/phases/phase-$(printf '%02d' $N)
115
- ```
116
-
117
- Write `phases/phase-NN/PLAN.md` using template from:
118
- `~/.claude/specdacular/templates/tasks/PLAN.md`
119
-
120
- Fill in:
121
- - YAML frontmatter: task name, phase number, dependencies, creates, modifies
122
- - Objective: what the phase accomplishes
123
- - Context: reference codebase patterns, relevant decisions, research findings
124
- - Tasks: 2-5 tasks with clear actions, verification, and done-when criteria
125
-
126
- **Each task should include:**
127
- - Files affected
128
- - Clear action description
129
- - Verification command
130
- - Done-when checklist
101
+ **Do NOT create phase directories or PLAN.md files.** Those are created just-in-time by `phase-plan.md` when each phase starts execution. This allows later phases to adapt based on what happened in earlier phases.
131
102
 
132
103
  Continue to write_roadmap.
133
104
  </step>
@@ -151,9 +122,10 @@ Update STATE.md and config.json.
151
122
  - Update documents status
152
123
 
153
124
  **config.json:**
154
- - Set `stage` to `"planning"`
125
+ - Set `stage` to `"execution"`
155
126
  - Set `phases.total` to phase count
156
127
  - Set `phases.current` to 1
128
+ - Set `phases.current_status` to `"pending"`
157
129
 
158
130
  Continue to commit.
159
131
  </step>
@@ -161,7 +133,7 @@ Continue to commit.
161
133
  <step name="commit">
162
134
  @~/.claude/specdacular/references/commit-docs.md
163
135
 
164
- - **$FILES:** `.specd/tasks/{task-name}/ROADMAP.md .specd/tasks/{task-name}/phases/ .specd/tasks/{task-name}/STATE.md .specd/tasks/{task-name}/config.json`
136
+ - **$FILES:** `.specd/tasks/{task-name}/ROADMAP.md .specd/tasks/{task-name}/STATE.md .specd/tasks/{task-name}/config.json`
165
137
  - **$MESSAGE:** `docs({task-name}): create roadmap and phase plans` with phase summary
166
138
  - **$LABEL:** `planning complete`
167
139
 
@@ -194,8 +166,9 @@ End workflow (caller handles continuation).
194
166
 
195
167
  <success_criteria>
196
168
  - Phases derived from task requirements and dependencies
197
- - One PLAN.md per phase with clear tasks
198
- - ROADMAP.md created with phase overview
199
- - STATE.md updated to planning stage
169
+ - ROADMAP.md created with phase goals and scope (no PLAN.md files)
170
+ - No phase directories created (just-in-time by phase-plan.md)
171
+ - STATE.md updated
172
+ - config.json set to execution stage with phases info
200
173
  - Changes committed
201
174
  </success_criteria>
@@ -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 ".specd/tasks/$TASK_NAME/RESEARCH.md" ] && echo "existing"
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 `.specd/tasks/$TASK_NAME/RESEARCH.md`.
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
- **STATE.md:**
113
- - Mark research as conducted
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:** `.specd/tasks/{task-name}/RESEARCH.md .specd/tasks/{task-name}/DECISIONS.md .specd/tasks/{task-name}/STATE.md .specd/tasks/{task-name}/config.json`
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:** Phase approved (advance to next) or fix plans in decimal phases (e.g., phase-01.1/)
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 .specd/tasks/$TASK_NAME/config.json | grep -o '"current": [0-9]*' | grep -o '[0-9]*')
57
- PHASE_DIR=".specd/tasks/$TASK_NAME/phases/phase-$(printf '%02d' $PHASE_NUM)"
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 .specd/tasks/$TASK_NAME/config.json | grep phase_start_commit
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
- **If "Looks good":**
160
- Continue to approve_phase.
161
-
162
- **If "I want to revise" or "I have concerns":**
163
- Continue to collect_feedback.
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
- - Fix plans created in decimal phases when needed
286
- - Fix plans execute through same execute workflow
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>