create-merlin-brain 3.10.0 → 3.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/files/agents/code-organization-supervisor.md +8 -0
- package/files/agents/context-guardian.md +8 -0
- package/files/agents/docs-keeper.md +10 -1
- package/files/agents/dry-refactor.md +11 -1
- package/files/agents/elite-code-refactorer.md +9 -0
- package/files/agents/hardening-guard.md +12 -1
- package/files/agents/implementation-dev.md +11 -1
- package/files/agents/merlin-api-designer.md +9 -0
- package/files/agents/merlin-codebase-mapper.md +8 -0
- package/files/agents/merlin-debugger.md +10 -0
- package/files/agents/merlin-executor.md +11 -1
- package/files/agents/merlin-frontend.md +9 -0
- package/files/agents/merlin-integration-checker.md +9 -1
- package/files/agents/merlin-migrator.md +9 -0
- package/files/agents/merlin-milestone-auditor.md +8 -0
- package/files/agents/merlin-performance.md +8 -0
- package/files/agents/merlin-planner.md +10 -0
- package/files/agents/merlin-researcher.md +10 -0
- package/files/agents/merlin-reviewer.md +41 -7
- package/files/agents/merlin-security.md +9 -0
- package/files/agents/merlin-verifier.md +9 -0
- package/files/agents/merlin-work-verifier.md +9 -0
- package/files/agents/merlin.md +10 -0
- package/files/agents/ops-railway.md +11 -1
- package/files/agents/orchestrator-retrofit.md +9 -1
- package/files/agents/product-spec.md +11 -1
- package/files/agents/remotion.md +8 -0
- package/files/agents/system-architect.md +11 -1
- package/files/agents/tests-qa.md +11 -1
- package/files/commands/merlin/course-correct.md +219 -0
- package/files/commands/merlin/debug.md +2 -2
- package/files/commands/merlin/execute-phase.md +4 -4
- package/files/commands/merlin/execute-plan.md +2 -2
- package/files/commands/merlin/map-codebase.md +4 -4
- package/files/commands/merlin/next.md +240 -0
- package/files/commands/merlin/plan-phase.md +1 -1
- package/files/commands/merlin/readiness-gate.md +208 -0
- package/files/commands/merlin/research-phase.md +2 -2
- package/files/commands/merlin/research-project.md +4 -4
- package/files/commands/merlin/verify-work.md +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: merlin:course-correct
|
|
3
|
+
description: Handle plan pivots — when implementation reveals the plan needs changing
|
|
4
|
+
argument-hint: "\"description of what changed\""
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Grep
|
|
11
|
+
- Glob
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
- mcp__merlin__merlin_get_context
|
|
14
|
+
- mcp__merlin__merlin_get_project_status
|
|
15
|
+
- mcp__merlin__merlin_search
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<objective>
|
|
19
|
+
Handle "the plan was wrong" — a dedicated workflow for pivots discovered during implementation.
|
|
20
|
+
|
|
21
|
+
Most planning flows only handle the happy path. This command handles the other reality:
|
|
22
|
+
a technical constraint appeared, a dependency changed, a requirement turned out to be wrong.
|
|
23
|
+
|
|
24
|
+
It assesses impact across all phases, proposes a minimal change set, and applies changes
|
|
25
|
+
only after the user approves. Nothing is modified until the user says go.
|
|
26
|
+
</objective>
|
|
27
|
+
|
|
28
|
+
<process>
|
|
29
|
+
|
|
30
|
+
## Step 1: Parse Arguments
|
|
31
|
+
|
|
32
|
+
Extract from $ARGUMENTS:
|
|
33
|
+
- **change_description**: Free-text description of what went wrong or what changed
|
|
34
|
+
(e.g., "Auth provider changed from Auth0 to Clerk")
|
|
35
|
+
|
|
36
|
+
If no argument provided, ask:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
What changed or went wrong? Describe the situation briefly.
|
|
40
|
+
(e.g., "We discovered the third-party API we planned to use requires a paid plan"
|
|
41
|
+
or "The database schema for users needs an extra field throughout the system")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Step 2: Load Planning Context
|
|
45
|
+
|
|
46
|
+
Read all planning state. This step is intentionally thorough — impact assessment requires full context.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cat .planning/PROJECT.md 2>/dev/null
|
|
50
|
+
cat .planning/ROADMAP.md 2>/dev/null
|
|
51
|
+
cat .planning/REQUIREMENTS.md 2>/dev/null
|
|
52
|
+
cat .planning/STATE.md 2>/dev/null
|
|
53
|
+
ls .planning/phases/ 2>/dev/null
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For each phase directory found:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Completed phases: read summaries
|
|
60
|
+
ls .planning/phases/*/ *-SUMMARY.md 2>/dev/null
|
|
61
|
+
|
|
62
|
+
# Active phase: read all plans
|
|
63
|
+
ls .planning/phases/${CURRENT_PHASE_DIR}/*-PLAN.md 2>/dev/null
|
|
64
|
+
|
|
65
|
+
# Upcoming phases: read any existing plans
|
|
66
|
+
ls .planning/phases/*-PLAN.md 2>/dev/null
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Get Sights context for the change topic:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Call: merlin_get_context
|
|
73
|
+
Task: "course correction — {change_description}"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Step 3: Impact Assessment
|
|
77
|
+
|
|
78
|
+
Analyze the loaded context against the change description. Determine:
|
|
79
|
+
|
|
80
|
+
**Completed work affected:**
|
|
81
|
+
- Which SUMMARY.md phases/plans touched the area that changed?
|
|
82
|
+
- What specifically needs to be revised in already-built work?
|
|
83
|
+
- Is this a patch (small addition/change) or a rewrite (fundamental change)?
|
|
84
|
+
|
|
85
|
+
**Active plans affected:**
|
|
86
|
+
- Which PLAN.md files in the current phase directly address the changed area?
|
|
87
|
+
- Classify each: rewrite needed, update needed, or unaffected.
|
|
88
|
+
|
|
89
|
+
**Upcoming plans affected:**
|
|
90
|
+
- Which future phases or plans will need to change based on the pivot?
|
|
91
|
+
- Are any roadmap milestones invalidated?
|
|
92
|
+
|
|
93
|
+
**Requirements affected:**
|
|
94
|
+
- Which entries in REQUIREMENTS.md reference the changed component/decision?
|
|
95
|
+
- Do any requirement acceptance criteria need updating?
|
|
96
|
+
|
|
97
|
+
**New work required:**
|
|
98
|
+
- Does the pivot introduce entirely new tasks (e.g., a migration helper, a new adapter)?
|
|
99
|
+
|
|
100
|
+
## Step 4: Generate Change Proposal
|
|
101
|
+
|
|
102
|
+
Produce a structured, numbered change proposal. Every entry must name the exact file.
|
|
103
|
+
|
|
104
|
+
Classify each change as:
|
|
105
|
+
- **Rewrite** — file needs to be replaced
|
|
106
|
+
- **Update** — targeted edits to existing file
|
|
107
|
+
- **Patch** — small addition to completed work
|
|
108
|
+
- **New** — entirely new file needs to be created
|
|
109
|
+
|
|
110
|
+
Compute scope impact:
|
|
111
|
+
- Count rewrites, updates, patches, new files
|
|
112
|
+
- Flag if any milestone-level changes are needed (i.e., ROADMAP.md phases added/removed)
|
|
113
|
+
- Estimate net new plans required
|
|
114
|
+
|
|
115
|
+
Present the full proposal before taking any action:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
🔮 **Course Correction** · "{change_description}"
|
|
119
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
|
+
|
|
121
|
+
### Impact Assessment
|
|
122
|
+
{bullet list of affected areas — completed, active, upcoming, requirements}
|
|
123
|
+
|
|
124
|
+
### Change Proposal
|
|
125
|
+
{numbered list, each entry: [TYPE] filename — reason}
|
|
126
|
+
|
|
127
|
+
### Scope Impact
|
|
128
|
+
- {X} rewrites, {Y} updates, {Z} patches, {W} new files
|
|
129
|
+
- {milestone impact or "No milestone-level changes needed"}
|
|
130
|
+
- {estimated net new plans}
|
|
131
|
+
|
|
132
|
+
[1] Apply all changes
|
|
133
|
+
[2] Apply selectively — I'll choose
|
|
134
|
+
[3] Discuss first
|
|
135
|
+
[4] Cancel
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Wait for user response before proceeding.
|
|
139
|
+
|
|
140
|
+
## Step 5: Apply Changes (with approval)
|
|
141
|
+
|
|
142
|
+
**If user selects [1] — Apply all:**
|
|
143
|
+
|
|
144
|
+
Execute the change proposal in this order:
|
|
145
|
+
1. Update REQUIREMENTS.md (requirements changes first — they anchor everything else)
|
|
146
|
+
2. Update ROADMAP.md (if milestone or phase structure changes)
|
|
147
|
+
3. Update STATE.md — log the pivot under a "Course Corrections" section
|
|
148
|
+
4. Rewrite or update active PLAN.md files
|
|
149
|
+
5. Patch completed work notes (add patch notes to SUMMARY.md, do not delete history)
|
|
150
|
+
6. Create any new PLAN.md files required
|
|
151
|
+
|
|
152
|
+
**If user selects [2] — Apply selectively:**
|
|
153
|
+
|
|
154
|
+
Present each proposed change as a y/n question using AskUserQuestion. Apply only approved changes.
|
|
155
|
+
|
|
156
|
+
**After applying:**
|
|
157
|
+
|
|
158
|
+
Update STATE.md with a course correction log entry:
|
|
159
|
+
|
|
160
|
+
```markdown
|
|
161
|
+
## Course Corrections
|
|
162
|
+
|
|
163
|
+
### {date} — {change_description}
|
|
164
|
+
- Trigger: {what the user described}
|
|
165
|
+
- Changes applied: {count and summary}
|
|
166
|
+
- Files modified: {list}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Step 6: Present Completion Summary
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Course correction applied.
|
|
173
|
+
|
|
174
|
+
### Changes Made
|
|
175
|
+
{list of files modified, created, or patched}
|
|
176
|
+
|
|
177
|
+
### Updated State
|
|
178
|
+
STATE.md updated with correction log.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
Next:
|
|
183
|
+
[1] Re-check readiness: /merlin:readiness-gate {phase}
|
|
184
|
+
[2] Continue executing: /merlin:execute-phase {phase}
|
|
185
|
+
[3] Review updated plans: /merlin:progress
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</process>
|
|
189
|
+
|
|
190
|
+
<critical_rules>
|
|
191
|
+
|
|
192
|
+
**NEVER MODIFY BEFORE APPROVAL.** The full proposal must be presented and the user must
|
|
193
|
+
select an action before any file is written or edited.
|
|
194
|
+
|
|
195
|
+
**PRESERVE HISTORY.** Do not delete SUMMARY.md content from completed phases. Add patch
|
|
196
|
+
notes as addenda. The record of what was built stays intact.
|
|
197
|
+
|
|
198
|
+
**STATE.MD IS ALWAYS UPDATED.** Every course correction must be logged in STATE.md
|
|
199
|
+
regardless of scope. Future agents need to know a pivot happened.
|
|
200
|
+
|
|
201
|
+
**BE CONCRETE.** Every item in the change proposal names an exact file path, not a vague
|
|
202
|
+
description like "update the auth files."
|
|
203
|
+
|
|
204
|
+
**REQUIREMENTS FIRST.** If requirements change, update REQUIREMENTS.md before updating
|
|
205
|
+
any PLAN.md. Plans derive from requirements, not the other way around.
|
|
206
|
+
|
|
207
|
+
</critical_rules>
|
|
208
|
+
|
|
209
|
+
<success_criteria>
|
|
210
|
+
- [ ] Change description captured (from args or prompt)
|
|
211
|
+
- [ ] Full planning context loaded
|
|
212
|
+
- [ ] Sights context retrieved for the change area
|
|
213
|
+
- [ ] Impact assessment covers completed, active, and upcoming work
|
|
214
|
+
- [ ] Change proposal presented with exact file names before any edit
|
|
215
|
+
- [ ] User approves before any modification
|
|
216
|
+
- [ ] Changes applied in correct order (requirements → roadmap → plans → summaries)
|
|
217
|
+
- [ ] STATE.md updated with course correction log
|
|
218
|
+
- [ ] Next steps offered
|
|
219
|
+
</success_criteria>
|
|
@@ -80,7 +80,7 @@ Create: .planning/debug/{slug}.md
|
|
|
80
80
|
|
|
81
81
|
```
|
|
82
82
|
## Spawn fresh debugger process via Bash:
|
|
83
|
-
cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
83
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
84
84
|
--agent merlin-debugger \
|
|
85
85
|
-p \
|
|
86
86
|
--permission-mode acceptEdits \
|
|
@@ -134,7 +134,7 @@ goal: find_and_fix
|
|
|
134
134
|
|
|
135
135
|
```
|
|
136
136
|
## Spawn fresh continuation process via Bash:
|
|
137
|
-
cat "$HANDOFF_DIR/continuation.md" | claude \
|
|
137
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/continuation.md" | claude \
|
|
138
138
|
--agent merlin-debugger \
|
|
139
139
|
-p \
|
|
140
140
|
--permission-mode acceptEdits \
|
|
@@ -140,7 +140,7 @@ Checkpoint: <if needed>
|
|
|
140
140
|
EOF
|
|
141
141
|
|
|
142
142
|
# Spawn fresh executor
|
|
143
|
-
RESULT=$(cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
143
|
+
RESULT=$(unset CLAUDECODE && cat "$HANDOFF_DIR/handoff.md" | claude \
|
|
144
144
|
--agent merlin-executor \
|
|
145
145
|
-p \
|
|
146
146
|
--permission-mode acceptEdits \
|
|
@@ -167,7 +167,7 @@ Spawn parallel fresh processes (use `&` and `wait`):
|
|
|
167
167
|
```bash
|
|
168
168
|
# Plan 1 in worktree 1
|
|
169
169
|
(cd "${REPO_ROOT}/../${REPO_NAME}-worktree-01" && \
|
|
170
|
-
cat "$HANDOFF_DIR/plan-01.md" | claude \
|
|
170
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/plan-01.md" | claude \
|
|
171
171
|
--agent merlin-executor \
|
|
172
172
|
-p \
|
|
173
173
|
--permission-mode acceptEdits \
|
|
@@ -177,7 +177,7 @@ PID1=$!
|
|
|
177
177
|
|
|
178
178
|
# Plan 2 in worktree 2
|
|
179
179
|
(cd "${REPO_ROOT}/../${REPO_NAME}-worktree-02" && \
|
|
180
|
-
cat "$HANDOFF_DIR/plan-02.md" | claude \
|
|
180
|
+
unset CLAUDECODE && cat "$HANDOFF_DIR/plan-02.md" | claude \
|
|
181
181
|
--agent merlin-executor \
|
|
182
182
|
-p \
|
|
183
183
|
--permission-mode acceptEdits \
|
|
@@ -238,7 +238,7 @@ Summary: <verification summary>
|
|
|
238
238
|
---END_VERIFY_RESULT---
|
|
239
239
|
EOF
|
|
240
240
|
|
|
241
|
-
VERIFY_RESULT=$(cat "/tmp/merlin-verify-$$/handoff.md" | claude \
|
|
241
|
+
VERIFY_RESULT=$(unset CLAUDECODE && cat "/tmp/merlin-verify-$$/handoff.md" | claude \
|
|
242
242
|
--agent merlin-verifier \
|
|
243
243
|
-p \
|
|
244
244
|
--permission-mode acceptEdits \
|
|
@@ -153,7 +153,7 @@ Checkpoint: <only if status=checkpoint — what you need>
|
|
|
153
153
|
## Step 9: Spawn Fresh Executor Process
|
|
154
154
|
|
|
155
155
|
```bash
|
|
156
|
-
RESULT=$(cat "$HANDOFF_FILE" | claude \
|
|
156
|
+
RESULT=$(unset CLAUDECODE && cat "$HANDOFF_FILE" | claude \
|
|
157
157
|
--agent merlin-executor \
|
|
158
158
|
-p \
|
|
159
159
|
--permission-mode acceptEdits \
|
|
@@ -295,7 +295,7 @@ Summary: <what was verified>
|
|
|
295
295
|
VERIFY
|
|
296
296
|
|
|
297
297
|
# Spawn fresh verifier
|
|
298
|
-
VERIFY_RESULT=$(cat "/tmp/merlin-verify-$$/handoff.md" | claude \
|
|
298
|
+
VERIFY_RESULT=$(unset CLAUDECODE && cat "/tmp/merlin-verify-$$/handoff.md" | claude \
|
|
299
299
|
--agent merlin-verifier \
|
|
300
300
|
-p \
|
|
301
301
|
--permission-mode acceptEdits \
|
|
@@ -89,22 +89,22 @@ Focus area: ${FOCUS_AREA}
|
|
|
89
89
|
EOF
|
|
90
90
|
|
|
91
91
|
# Spawn all 4 in parallel as fresh processes
|
|
92
|
-
(cat "$HANDOFF_DIR/tech.md" | claude --agent merlin-codebase-mapper -p \
|
|
92
|
+
(unset CLAUDECODE && cat "$HANDOFF_DIR/tech.md" | claude --agent merlin-codebase-mapper -p \
|
|
93
93
|
--permission-mode acceptEdits --output-format text \
|
|
94
94
|
> "$HANDOFF_DIR/result-tech.txt" 2>&1) &
|
|
95
95
|
PID1=$!
|
|
96
96
|
|
|
97
|
-
(cat "$HANDOFF_DIR/arch.md" | claude --agent merlin-codebase-mapper -p \
|
|
97
|
+
(unset CLAUDECODE && cat "$HANDOFF_DIR/arch.md" | claude --agent merlin-codebase-mapper -p \
|
|
98
98
|
--permission-mode acceptEdits --output-format text \
|
|
99
99
|
> "$HANDOFF_DIR/result-arch.txt" 2>&1) &
|
|
100
100
|
PID2=$!
|
|
101
101
|
|
|
102
|
-
(cat "$HANDOFF_DIR/quality.md" | claude --agent merlin-codebase-mapper -p \
|
|
102
|
+
(unset CLAUDECODE && cat "$HANDOFF_DIR/quality.md" | claude --agent merlin-codebase-mapper -p \
|
|
103
103
|
--permission-mode acceptEdits --output-format text \
|
|
104
104
|
> "$HANDOFF_DIR/result-quality.txt" 2>&1) &
|
|
105
105
|
PID3=$!
|
|
106
106
|
|
|
107
|
-
(cat "$HANDOFF_DIR/concerns.md" | claude --agent merlin-codebase-mapper -p \
|
|
107
|
+
(unset CLAUDECODE && cat "$HANDOFF_DIR/concerns.md" | claude --agent merlin-codebase-mapper -p \
|
|
108
108
|
--permission-mode acceptEdits --output-format text \
|
|
109
109
|
> "$HANDOFF_DIR/result-concerns.txt" 2>&1) &
|
|
110
110
|
PID4=$!
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: merlin:next
|
|
3
|
+
description: Smart navigator — detects state and recommends the single best next action
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Bash
|
|
7
|
+
- Grep
|
|
8
|
+
- Glob
|
|
9
|
+
- mcp__merlin__merlin_get_project_status
|
|
10
|
+
- mcp__merlin__merlin_get_context
|
|
11
|
+
- mcp__merlin__merlin_get_next_task
|
|
12
|
+
- mcp__merlin__merlin_ensure_tasks
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Answer one question: what should you do RIGHT NOW?
|
|
17
|
+
|
|
18
|
+
This is the "I just opened my laptop" command. No long reports. No history.
|
|
19
|
+
One recommended action, instantly. Merlin Sights powers the detection so the
|
|
20
|
+
answer reflects real project state, not guesswork.
|
|
21
|
+
</objective>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<process>
|
|
25
|
+
|
|
26
|
+
<step name="status">
|
|
27
|
+
**Get project status from Merlin Cloud.**
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Call: merlin_get_project_status
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Note: checkpoint existence, blocker flags, task counts, recommended_action.
|
|
34
|
+
</step>
|
|
35
|
+
|
|
36
|
+
<step name="detect">
|
|
37
|
+
**Detect state in priority order. Stop at the first match.**
|
|
38
|
+
|
|
39
|
+
**P1 — Active checkpoint**
|
|
40
|
+
|
|
41
|
+
If `merlin_get_project_status` reports a checkpoint, or if
|
|
42
|
+
`.planning/HANDOFF.md` exists → go to **Route: Resume**.
|
|
43
|
+
|
|
44
|
+
**P2 — Blockers**
|
|
45
|
+
|
|
46
|
+
If STATE.md contains lines under a "Blockers" heading with content →
|
|
47
|
+
go to **Route: Blocker**.
|
|
48
|
+
|
|
49
|
+
**P3 — UAT gaps**
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
grep -rl "status: diagnosed" .planning/phases/ 2>/dev/null | head -1
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If any file found → go to **Route: UAT Gaps**.
|
|
56
|
+
|
|
57
|
+
**P4 — Unexecuted plans**
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
ls -1 .planning/phases/*/*.planning*-PLAN.md 2>/dev/null
|
|
61
|
+
ls -1 .planning/phases/*/*-PLAN.md 2>/dev/null
|
|
62
|
+
ls -1 .planning/phases/*/*-SUMMARY.md 2>/dev/null
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Compare plan count vs summary count per phase directory.
|
|
66
|
+
If any phase has more PLANs than SUMMARYs → go to **Route: Execute Plan**.
|
|
67
|
+
|
|
68
|
+
**P5 — Unplanned phase**
|
|
69
|
+
|
|
70
|
+
Read ROADMAP.md. Check current phase number from STATE.md.
|
|
71
|
+
If the current phase directory has 0 PLAN.md files → go to **Route: Plan Phase**.
|
|
72
|
+
If the next phase directory does not exist yet → go to **Route: Plan Phase** (next N).
|
|
73
|
+
|
|
74
|
+
**P6 — Pending todos**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
ls .planning/todos/pending/*.md 2>/dev/null | wc -l
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If count > 0 → go to **Route: Todos**.
|
|
81
|
+
|
|
82
|
+
**P7 — Milestone complete**
|
|
83
|
+
|
|
84
|
+
If all phases in current milestone have matching PLAN+SUMMARY counts and
|
|
85
|
+
no ROADMAP.md exists but PROJECT.md does → go to **Route: Between Milestones**.
|
|
86
|
+
|
|
87
|
+
If ROADMAP.md exists and current phase = highest phase number in milestone
|
|
88
|
+
and all plans have summaries → go to **Route: Complete Milestone**.
|
|
89
|
+
|
|
90
|
+
**P8 — No planning structure**
|
|
91
|
+
|
|
92
|
+
If no `.planning/` directory → go to **Route: No Project**.
|
|
93
|
+
If no ROADMAP.md and no PROJECT.md → go to **Route: No Project**.
|
|
94
|
+
If PROJECT.md exists but no ROADMAP.md → go to **Route: New Roadmap**.
|
|
95
|
+
</step>
|
|
96
|
+
|
|
97
|
+
<step name="output">
|
|
98
|
+
**Output exactly one recommendation. Be brief.**
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
**Route: Resume**
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Next -> /merlin:resume-work
|
|
106
|
+
Checkpoint found: [description from HANDOFF.md or status]
|
|
107
|
+
|
|
108
|
+
[1] Resume from checkpoint
|
|
109
|
+
[2] See full status (/merlin:progress)
|
|
110
|
+
[3] Do something else
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
**Route: Blocker**
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Next -> Address blocker first
|
|
119
|
+
[blocker description from STATE.md]
|
|
120
|
+
|
|
121
|
+
Resolve the blocker, then re-run /merlin:next.
|
|
122
|
+
|
|
123
|
+
[1] See full status (/merlin:progress)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
**Route: UAT Gaps**
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
Next -> /merlin:plan-phase [N] --gaps
|
|
132
|
+
[N] gap(s) found in [phase-name] UAT
|
|
133
|
+
|
|
134
|
+
[1] Plan gap fixes
|
|
135
|
+
[2] See full status (/merlin:progress)
|
|
136
|
+
[3] Skip and continue
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**Route: Execute Plan**
|
|
142
|
+
|
|
143
|
+
Find the first PLAN.md without a matching SUMMARY.md. Read its `<objective>`.
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
Next -> /merlin:execute-plan [full-path-to-PLAN.md]
|
|
147
|
+
[Phase N, Plan M]: [one-line objective]
|
|
148
|
+
|
|
149
|
+
[1] Execute this plan
|
|
150
|
+
[2] See full status (/merlin:progress)
|
|
151
|
+
[3] Do something else
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
**Route: Plan Phase**
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Next -> /merlin:plan-phase [N]
|
|
160
|
+
Phase [N]: [phase name from ROADMAP.md]
|
|
161
|
+
|
|
162
|
+
[1] Plan this phase
|
|
163
|
+
[2] Gather context first (/merlin:discuss-phase [N])
|
|
164
|
+
[3] See full status (/merlin:progress)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
**Route: Todos**
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Next -> /merlin:check-todos
|
|
173
|
+
[count] pending todo(s) need review
|
|
174
|
+
|
|
175
|
+
[1] Review todos
|
|
176
|
+
[2] See full status (/merlin:progress)
|
|
177
|
+
[3] Skip for now
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
**Route: Complete Milestone**
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Next -> /merlin:complete-milestone
|
|
186
|
+
All phases done — milestone ready to close
|
|
187
|
+
|
|
188
|
+
[1] Complete milestone
|
|
189
|
+
[2] Verify first (/merlin:verify-work)
|
|
190
|
+
[3] See full status (/merlin:progress)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
**Route: Between Milestones**
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
Next -> /merlin:discuss-milestone
|
|
199
|
+
Last milestone complete — ready to plan what's next
|
|
200
|
+
|
|
201
|
+
[1] Discuss next milestone
|
|
202
|
+
[2] See full status (/merlin:progress)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Route: New Roadmap**
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Next -> /merlin:create-roadmap
|
|
211
|
+
PROJECT.md exists but no roadmap yet
|
|
212
|
+
|
|
213
|
+
[1] Create roadmap
|
|
214
|
+
[2] See full status (/merlin:progress)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
**Route: No Project**
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
Next -> /merlin:new-project
|
|
223
|
+
No planning structure found
|
|
224
|
+
|
|
225
|
+
[1] Start a new project
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
</step>
|
|
231
|
+
|
|
232
|
+
</process>
|
|
233
|
+
|
|
234
|
+
<success_criteria>
|
|
235
|
+
- [ ] Responds in under 10 lines of output
|
|
236
|
+
- [ ] One clear action recommended
|
|
237
|
+
- [ ] Priority order respected (checkpoint > blockers > UAT > execute > plan)
|
|
238
|
+
- [ ] Numbered options always present
|
|
239
|
+
- [ ] Full status always available as an option
|
|
240
|
+
</success_criteria>
|
|
@@ -149,7 +149,7 @@ Summary: <2-3 sentence summary>
|
|
|
149
149
|
## Step 8: Spawn Fresh Planner Process
|
|
150
150
|
|
|
151
151
|
```bash
|
|
152
|
-
RESULT=$(cat "$HANDOFF_FILE" | claude \
|
|
152
|
+
RESULT=$(unset CLAUDECODE && cat "$HANDOFF_FILE" | claude \
|
|
153
153
|
--agent merlin-planner \
|
|
154
154
|
-p \
|
|
155
155
|
--permission-mode acceptEdits \
|