get-research-done 1.1.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.
Files changed (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +560 -0
  3. package/agents/grd-architect.md +789 -0
  4. package/agents/grd-codebase-mapper.md +738 -0
  5. package/agents/grd-critic.md +1065 -0
  6. package/agents/grd-debugger.md +1203 -0
  7. package/agents/grd-evaluator.md +948 -0
  8. package/agents/grd-executor.md +784 -0
  9. package/agents/grd-explorer.md +2063 -0
  10. package/agents/grd-graduator.md +484 -0
  11. package/agents/grd-integration-checker.md +423 -0
  12. package/agents/grd-phase-researcher.md +641 -0
  13. package/agents/grd-plan-checker.md +745 -0
  14. package/agents/grd-planner.md +1386 -0
  15. package/agents/grd-project-researcher.md +865 -0
  16. package/agents/grd-research-synthesizer.md +256 -0
  17. package/agents/grd-researcher.md +2361 -0
  18. package/agents/grd-roadmapper.md +605 -0
  19. package/agents/grd-verifier.md +778 -0
  20. package/bin/install.js +1294 -0
  21. package/commands/grd/add-phase.md +207 -0
  22. package/commands/grd/add-todo.md +193 -0
  23. package/commands/grd/architect.md +283 -0
  24. package/commands/grd/audit-milestone.md +277 -0
  25. package/commands/grd/check-todos.md +228 -0
  26. package/commands/grd/complete-milestone.md +136 -0
  27. package/commands/grd/debug.md +169 -0
  28. package/commands/grd/discuss-phase.md +86 -0
  29. package/commands/grd/evaluate.md +1095 -0
  30. package/commands/grd/execute-phase.md +339 -0
  31. package/commands/grd/explore.md +258 -0
  32. package/commands/grd/graduate.md +323 -0
  33. package/commands/grd/help.md +482 -0
  34. package/commands/grd/insert-phase.md +227 -0
  35. package/commands/grd/insights.md +231 -0
  36. package/commands/grd/join-discord.md +18 -0
  37. package/commands/grd/list-phase-assumptions.md +50 -0
  38. package/commands/grd/map-codebase.md +71 -0
  39. package/commands/grd/new-milestone.md +721 -0
  40. package/commands/grd/new-project.md +1008 -0
  41. package/commands/grd/pause-work.md +134 -0
  42. package/commands/grd/plan-milestone-gaps.md +295 -0
  43. package/commands/grd/plan-phase.md +525 -0
  44. package/commands/grd/progress.md +364 -0
  45. package/commands/grd/quick-explore.md +236 -0
  46. package/commands/grd/quick.md +309 -0
  47. package/commands/grd/remove-phase.md +349 -0
  48. package/commands/grd/research-phase.md +200 -0
  49. package/commands/grd/research.md +681 -0
  50. package/commands/grd/resume-work.md +40 -0
  51. package/commands/grd/set-profile.md +106 -0
  52. package/commands/grd/settings.md +136 -0
  53. package/commands/grd/update.md +172 -0
  54. package/commands/grd/verify-work.md +219 -0
  55. package/get-research-done/config/default.json +15 -0
  56. package/get-research-done/references/checkpoints.md +1078 -0
  57. package/get-research-done/references/continuation-format.md +249 -0
  58. package/get-research-done/references/git-integration.md +254 -0
  59. package/get-research-done/references/model-profiles.md +73 -0
  60. package/get-research-done/references/planning-config.md +94 -0
  61. package/get-research-done/references/questioning.md +141 -0
  62. package/get-research-done/references/tdd.md +263 -0
  63. package/get-research-done/references/ui-brand.md +160 -0
  64. package/get-research-done/references/verification-patterns.md +612 -0
  65. package/get-research-done/templates/DEBUG.md +159 -0
  66. package/get-research-done/templates/UAT.md +247 -0
  67. package/get-research-done/templates/archive-reason.md +195 -0
  68. package/get-research-done/templates/codebase/architecture.md +255 -0
  69. package/get-research-done/templates/codebase/concerns.md +310 -0
  70. package/get-research-done/templates/codebase/conventions.md +307 -0
  71. package/get-research-done/templates/codebase/integrations.md +280 -0
  72. package/get-research-done/templates/codebase/stack.md +186 -0
  73. package/get-research-done/templates/codebase/structure.md +285 -0
  74. package/get-research-done/templates/codebase/testing.md +480 -0
  75. package/get-research-done/templates/config.json +35 -0
  76. package/get-research-done/templates/context.md +283 -0
  77. package/get-research-done/templates/continue-here.md +78 -0
  78. package/get-research-done/templates/critic-log.md +288 -0
  79. package/get-research-done/templates/data-report.md +173 -0
  80. package/get-research-done/templates/debug-subagent-prompt.md +91 -0
  81. package/get-research-done/templates/decision-log.md +58 -0
  82. package/get-research-done/templates/decision.md +138 -0
  83. package/get-research-done/templates/discovery.md +146 -0
  84. package/get-research-done/templates/experiment-readme.md +104 -0
  85. package/get-research-done/templates/graduated-script.md +180 -0
  86. package/get-research-done/templates/iteration-summary.md +234 -0
  87. package/get-research-done/templates/milestone-archive.md +123 -0
  88. package/get-research-done/templates/milestone.md +115 -0
  89. package/get-research-done/templates/objective.md +271 -0
  90. package/get-research-done/templates/phase-prompt.md +567 -0
  91. package/get-research-done/templates/planner-subagent-prompt.md +117 -0
  92. package/get-research-done/templates/project.md +184 -0
  93. package/get-research-done/templates/requirements.md +231 -0
  94. package/get-research-done/templates/research-project/ARCHITECTURE.md +204 -0
  95. package/get-research-done/templates/research-project/FEATURES.md +147 -0
  96. package/get-research-done/templates/research-project/PITFALLS.md +200 -0
  97. package/get-research-done/templates/research-project/STACK.md +120 -0
  98. package/get-research-done/templates/research-project/SUMMARY.md +170 -0
  99. package/get-research-done/templates/research.md +529 -0
  100. package/get-research-done/templates/roadmap.md +202 -0
  101. package/get-research-done/templates/scorecard.json +113 -0
  102. package/get-research-done/templates/state.md +287 -0
  103. package/get-research-done/templates/summary.md +246 -0
  104. package/get-research-done/templates/user-setup.md +311 -0
  105. package/get-research-done/templates/verification-report.md +322 -0
  106. package/get-research-done/workflows/complete-milestone.md +756 -0
  107. package/get-research-done/workflows/diagnose-issues.md +231 -0
  108. package/get-research-done/workflows/discovery-phase.md +289 -0
  109. package/get-research-done/workflows/discuss-phase.md +433 -0
  110. package/get-research-done/workflows/execute-phase.md +657 -0
  111. package/get-research-done/workflows/execute-plan.md +1844 -0
  112. package/get-research-done/workflows/list-phase-assumptions.md +178 -0
  113. package/get-research-done/workflows/map-codebase.md +322 -0
  114. package/get-research-done/workflows/resume-project.md +307 -0
  115. package/get-research-done/workflows/transition.md +556 -0
  116. package/get-research-done/workflows/verify-phase.md +628 -0
  117. package/get-research-done/workflows/verify-work.md +596 -0
  118. package/hooks/dist/grd-check-update.js +61 -0
  119. package/hooks/dist/grd-statusline.js +84 -0
  120. package/package.json +47 -0
  121. package/scripts/audit-help-commands.sh +115 -0
  122. package/scripts/build-hooks.js +42 -0
  123. package/scripts/verify-all-commands.sh +246 -0
  124. package/scripts/verify-architect-warning.sh +35 -0
  125. package/scripts/verify-insights-mode.sh +40 -0
  126. package/scripts/verify-quick-mode.sh +20 -0
  127. package/scripts/verify-revise-data-routing.sh +139 -0
@@ -0,0 +1,525 @@
1
+ ---
2
+ name: grd:plan-phase
3
+ description: Create detailed execution plan for a phase (PLAN.md) with verification loop
4
+ argument-hint: "[phase] [--research] [--skip-research] [--gaps] [--skip-verify]"
5
+ agent: grd-planner
6
+ allowed-tools:
7
+ - Read
8
+ - Write
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Task
13
+ - WebFetch
14
+ - mcp__context7__*
15
+ ---
16
+
17
+ <execution_context>
18
+ @~/.claude/get-research-done/references/ui-brand.md
19
+ </execution_context>
20
+
21
+ <objective>
22
+ Create executable phase prompts (PLAN.md files) for a roadmap phase with integrated research and verification.
23
+
24
+ **Default flow:** Research (if needed) → Plan → Verify → Done
25
+
26
+ **Orchestrator role:** Parse arguments, validate phase, research domain (unless skipped or exists), spawn grd-planner agent, verify plans with grd-plan-checker, iterate until plans pass or max iterations reached, present results.
27
+
28
+ **Why subagents:** Research and planning burn context fast. Verification uses fresh context. User sees the flow between agents in main context.
29
+ </objective>
30
+
31
+ <context>
32
+ Phase number: $ARGUMENTS (optional - auto-detects next unplanned phase if not provided)
33
+
34
+ **Flags:**
35
+ - `--research` — Force re-research even if RESEARCH.md exists
36
+ - `--skip-research` — Skip research entirely, go straight to planning
37
+ - `--gaps` — Gap closure mode (reads VERIFICATION.md, skips research)
38
+ - `--skip-verify` — Skip planner → checker verification loop
39
+
40
+ Normalize phase input in step 2 before any directory lookups.
41
+ </context>
42
+
43
+ <process>
44
+
45
+ ## 1. Validate Environment and Resolve Model Profile
46
+
47
+ ```bash
48
+ ls .planning/ 2>/dev/null
49
+ ```
50
+
51
+ **If not found:** Error - user should run `/grd:new-project` first.
52
+
53
+ **Resolve model profile for agent spawning:**
54
+
55
+ ```bash
56
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
57
+ ```
58
+
59
+ Default to "balanced" if not set.
60
+
61
+ **Model lookup table:**
62
+
63
+ | Agent | quality | balanced | budget |
64
+ |-------|---------|----------|--------|
65
+ | grd-phase-researcher | opus | sonnet | haiku |
66
+ | grd-planner | opus | opus | sonnet |
67
+ | grd-plan-checker | sonnet | sonnet | haiku |
68
+
69
+ Store resolved models for use in Task calls below.
70
+
71
+ ## 2. Parse and Normalize Arguments
72
+
73
+ Extract from $ARGUMENTS:
74
+
75
+ - Phase number (integer or decimal like `2.1`)
76
+ - `--research` flag to force re-research
77
+ - `--skip-research` flag to skip research
78
+ - `--gaps` flag for gap closure mode
79
+ - `--skip-verify` flag to bypass verification loop
80
+
81
+ **If no phase number:** Detect next unplanned phase from roadmap.
82
+
83
+ **Normalize phase to zero-padded format:**
84
+
85
+ ```bash
86
+ # Normalize phase number (8 → 08, but preserve decimals like 2.1 → 02.1)
87
+ if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
88
+ PHASE=$(printf "%02d" "$PHASE")
89
+ elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
90
+ PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
91
+ fi
92
+ ```
93
+
94
+ **Check for existing research and plans:**
95
+
96
+ ```bash
97
+ ls .planning/phases/${PHASE}-*/*-RESEARCH.md 2>/dev/null
98
+ ls .planning/phases/${PHASE}-*/*-PLAN.md 2>/dev/null
99
+ ```
100
+
101
+ ## 3. Validate Phase
102
+
103
+ ```bash
104
+ grep -A5 "Phase ${PHASE}:" .planning/ROADMAP.md 2>/dev/null
105
+ ```
106
+
107
+ **If not found:** Error with available phases. **If found:** Extract phase number, name, description.
108
+
109
+ ## 4. Ensure Phase Directory Exists
110
+
111
+ ```bash
112
+ # PHASE is already normalized (08, 02.1, etc.) from step 2
113
+ PHASE_DIR=$(ls -d .planning/phases/${PHASE}-* 2>/dev/null | head -1)
114
+ if [ -z "$PHASE_DIR" ]; then
115
+ # Create phase directory from roadmap name
116
+ PHASE_NAME=$(grep "Phase ${PHASE}:" .planning/ROADMAP.md | sed 's/.*Phase [0-9]*: //' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
117
+ mkdir -p ".planning/phases/${PHASE}-${PHASE_NAME}"
118
+ PHASE_DIR=".planning/phases/${PHASE}-${PHASE_NAME}"
119
+ fi
120
+ ```
121
+
122
+ ## 5. Handle Research
123
+
124
+ **If `--gaps` flag:** Skip research (gap closure uses VERIFICATION.md instead).
125
+
126
+ **If `--skip-research` flag:** Skip to step 6.
127
+
128
+ **Check config for research setting:**
129
+
130
+ ```bash
131
+ WORKFLOW_RESEARCH=$(cat .planning/config.json 2>/dev/null | grep -o '"research"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
132
+ ```
133
+
134
+ **If `workflow.research` is `false` AND `--research` flag NOT set:** Skip to step 6.
135
+
136
+ **Otherwise:**
137
+
138
+ Check for existing research:
139
+
140
+ ```bash
141
+ ls "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null
142
+ ```
143
+
144
+ **If RESEARCH.md exists AND `--research` flag NOT set:**
145
+ - Display: `Using existing research: ${PHASE_DIR}/${PHASE}-RESEARCH.md`
146
+ - Skip to step 6
147
+
148
+ **If RESEARCH.md missing OR `--research` flag set:**
149
+
150
+ Display stage banner:
151
+ ```
152
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153
+ GRD ► RESEARCHING PHASE {X}
154
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
+
156
+ ◆ Spawning researcher...
157
+ ```
158
+
159
+ Proceed to spawn researcher
160
+
161
+ ### Spawn grd-phase-researcher
162
+
163
+ Gather context for research prompt:
164
+
165
+ ```bash
166
+ # Get phase description from roadmap
167
+ PHASE_DESC=$(grep -A3 "Phase ${PHASE}:" .planning/ROADMAP.md)
168
+
169
+ # Get requirements if they exist
170
+ REQUIREMENTS=$(cat .planning/REQUIREMENTS.md 2>/dev/null | grep -A100 "## Requirements" | head -50)
171
+
172
+ # Get prior decisions from STATE.md
173
+ DECISIONS=$(grep -A20 "### Decisions Made" .planning/STATE.md 2>/dev/null)
174
+
175
+ # Get phase context if exists
176
+ PHASE_CONTEXT=$(cat "${PHASE_DIR}"/*-CONTEXT.md 2>/dev/null)
177
+ ```
178
+
179
+ Fill research prompt and spawn:
180
+
181
+ ```markdown
182
+ <objective>
183
+ Research how to implement Phase {phase_number}: {phase_name}
184
+
185
+ Answer: "What do I need to know to PLAN this phase well?"
186
+ </objective>
187
+
188
+ <context>
189
+ **Phase description:**
190
+ {phase_description}
191
+
192
+ **Requirements (if any):**
193
+ {requirements}
194
+
195
+ **Prior decisions:**
196
+ {decisions}
197
+
198
+ **Phase context (if any):**
199
+ {phase_context}
200
+ </context>
201
+
202
+ <output>
203
+ Write research findings to: {phase_dir}/{phase}-RESEARCH.md
204
+ </output>
205
+ ```
206
+
207
+ ```
208
+ Task(
209
+ prompt="First, read ~/.claude/agents/grd-phase-researcher.md for your role and instructions.\n\n" + research_prompt,
210
+ subagent_type="general-purpose",
211
+ model="{researcher_model}",
212
+ description="Research Phase {phase}"
213
+ )
214
+ ```
215
+
216
+ ### Handle Researcher Return
217
+
218
+ **`## RESEARCH COMPLETE`:**
219
+ - Display: `Research complete. Proceeding to planning...`
220
+ - Continue to step 6
221
+
222
+ **`## RESEARCH BLOCKED`:**
223
+ - Display blocker information
224
+ - Offer: 1) Provide more context, 2) Skip research and plan anyway, 3) Abort
225
+ - Wait for user response
226
+
227
+ ## 6. Check Existing Plans
228
+
229
+ ```bash
230
+ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
231
+ ```
232
+
233
+ **If exists:** Offer: 1) Continue planning (add more plans), 2) View existing, 3) Replan from scratch. Wait for response.
234
+
235
+ ## 7. Read Context Files
236
+
237
+ Read and store context file contents for the planner agent. The `@` syntax does not work across Task() boundaries - content must be inlined.
238
+
239
+ ```bash
240
+ # Read required files
241
+ STATE_CONTENT=$(cat .planning/STATE.md)
242
+ ROADMAP_CONTENT=$(cat .planning/ROADMAP.md)
243
+
244
+ # Read optional files (empty string if missing)
245
+ REQUIREMENTS_CONTENT=$(cat .planning/REQUIREMENTS.md 2>/dev/null)
246
+ CONTEXT_CONTENT=$(cat "${PHASE_DIR}"/*-CONTEXT.md 2>/dev/null)
247
+ RESEARCH_CONTENT=$(cat "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null)
248
+
249
+ # Gap closure files (only if --gaps mode)
250
+ VERIFICATION_CONTENT=$(cat "${PHASE_DIR}"/*-VERIFICATION.md 2>/dev/null)
251
+ UAT_CONTENT=$(cat "${PHASE_DIR}"/*-UAT.md 2>/dev/null)
252
+ ```
253
+
254
+ ## 8. Spawn grd-planner Agent
255
+
256
+ Display stage banner:
257
+ ```
258
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
259
+ GRD ► PLANNING PHASE {X}
260
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
261
+
262
+ ◆ Spawning planner...
263
+ ```
264
+
265
+ Fill prompt with inlined content and spawn:
266
+
267
+ ```markdown
268
+ <planning_context>
269
+
270
+ **Phase:** {phase_number}
271
+ **Mode:** {standard | gap_closure}
272
+
273
+ **Project State:**
274
+ {state_content}
275
+
276
+ **Roadmap:**
277
+ {roadmap_content}
278
+
279
+ **Requirements (if exists):**
280
+ {requirements_content}
281
+
282
+ **Phase Context (if exists):**
283
+ {context_content}
284
+
285
+ **Research (if exists):**
286
+ {research_content}
287
+
288
+ **Gap Closure (if --gaps mode):**
289
+ {verification_content}
290
+ {uat_content}
291
+
292
+ </planning_context>
293
+
294
+ <downstream_consumer>
295
+ Output consumed by /grd:execute-phase
296
+ Plans must be executable prompts with:
297
+
298
+ - Frontmatter (wave, depends_on, files_modified, autonomous)
299
+ - Tasks in XML format
300
+ - Verification criteria
301
+ - must_haves for goal-backward verification
302
+ </downstream_consumer>
303
+
304
+ <quality_gate>
305
+ Before returning PLANNING COMPLETE:
306
+
307
+ - [ ] PLAN.md files created in phase directory
308
+ - [ ] Each plan has valid frontmatter
309
+ - [ ] Tasks are specific and actionable
310
+ - [ ] Dependencies correctly identified
311
+ - [ ] Waves assigned for parallel execution
312
+ - [ ] must_haves derived from phase goal
313
+ </quality_gate>
314
+ ```
315
+
316
+ ```
317
+ Task(
318
+ prompt="First, read ~/.claude/agents/grd-planner.md for your role and instructions.\n\n" + filled_prompt,
319
+ subagent_type="general-purpose",
320
+ model="{planner_model}",
321
+ description="Plan Phase {phase}"
322
+ )
323
+ ```
324
+
325
+ ## 9. Handle Planner Return
326
+
327
+ Parse planner output:
328
+
329
+ **`## PLANNING COMPLETE`:**
330
+ - Display: `Planner created {N} plan(s). Files on disk.`
331
+ - If `--skip-verify`: Skip to step 13
332
+ - Check config: `WORKFLOW_PLAN_CHECK=$(cat .planning/config.json 2>/dev/null | grep -o '"plan_check"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")`
333
+ - If `workflow.plan_check` is `false`: Skip to step 13
334
+ - Otherwise: Proceed to step 10
335
+
336
+ **`## CHECKPOINT REACHED`:**
337
+ - Present to user, get response, spawn continuation (see step 12)
338
+
339
+ **`## PLANNING INCONCLUSIVE`:**
340
+ - Show what was attempted
341
+ - Offer: Add context, Retry, Manual
342
+ - Wait for user response
343
+
344
+ ## 10. Spawn grd-plan-checker Agent
345
+
346
+ Display:
347
+ ```
348
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
349
+ GRD ► VERIFYING PLANS
350
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
351
+
352
+ ◆ Spawning plan checker...
353
+ ```
354
+
355
+ Read plans and requirements for the checker:
356
+
357
+ ```bash
358
+ # Read all plans in phase directory
359
+ PLANS_CONTENT=$(cat "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
360
+
361
+ # Read requirements (reuse from step 7 if available)
362
+ REQUIREMENTS_CONTENT=$(cat .planning/REQUIREMENTS.md 2>/dev/null)
363
+ ```
364
+
365
+ Fill checker prompt with inlined content and spawn:
366
+
367
+ ```markdown
368
+ <verification_context>
369
+
370
+ **Phase:** {phase_number}
371
+ **Phase Goal:** {goal from ROADMAP}
372
+
373
+ **Plans to verify:**
374
+ {plans_content}
375
+
376
+ **Requirements (if exists):**
377
+ {requirements_content}
378
+
379
+ </verification_context>
380
+
381
+ <expected_output>
382
+ Return one of:
383
+ - ## VERIFICATION PASSED — all checks pass
384
+ - ## ISSUES FOUND — structured issue list
385
+ </expected_output>
386
+ ```
387
+
388
+ ```
389
+ Task(
390
+ prompt=checker_prompt,
391
+ subagent_type="grd-plan-checker",
392
+ model="{checker_model}",
393
+ description="Verify Phase {phase} plans"
394
+ )
395
+ ```
396
+
397
+ ## 11. Handle Checker Return
398
+
399
+ **If `## VERIFICATION PASSED`:**
400
+ - Display: `Plans verified. Ready for execution.`
401
+ - Proceed to step 13
402
+
403
+ **If `## ISSUES FOUND`:**
404
+ - Display: `Checker found issues:`
405
+ - List issues from checker output
406
+ - Check iteration count
407
+ - Proceed to step 12
408
+
409
+ ## 12. Revision Loop (Max 3 Iterations)
410
+
411
+ Track: `iteration_count` (starts at 1 after initial plan + check)
412
+
413
+ **If iteration_count < 3:**
414
+
415
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
416
+
417
+ Read current plans for revision context:
418
+
419
+ ```bash
420
+ PLANS_CONTENT=$(cat "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
421
+ ```
422
+
423
+ Spawn grd-planner with revision prompt:
424
+
425
+ ```markdown
426
+ <revision_context>
427
+
428
+ **Phase:** {phase_number}
429
+ **Mode:** revision
430
+
431
+ **Existing plans:**
432
+ {plans_content}
433
+
434
+ **Checker issues:**
435
+ {structured_issues_from_checker}
436
+
437
+ </revision_context>
438
+
439
+ <instructions>
440
+ Make targeted updates to address checker issues.
441
+ Do NOT replan from scratch unless issues are fundamental.
442
+ Return what changed.
443
+ </instructions>
444
+ ```
445
+
446
+ ```
447
+ Task(
448
+ prompt="First, read ~/.claude/agents/grd-planner.md for your role and instructions.\n\n" + revision_prompt,
449
+ subagent_type="general-purpose",
450
+ model="{planner_model}",
451
+ description="Revise Phase {phase} plans"
452
+ )
453
+ ```
454
+
455
+ - After planner returns → spawn checker again (step 10)
456
+ - Increment iteration_count
457
+
458
+ **If iteration_count >= 3:**
459
+
460
+ Display: `Max iterations reached. {N} issues remain:`
461
+ - List remaining issues
462
+
463
+ Offer options:
464
+ 1. Force proceed (execute despite issues)
465
+ 2. Provide guidance (user gives direction, retry)
466
+ 3. Abandon (exit planning)
467
+
468
+ Wait for user response.
469
+
470
+ ## 13. Present Final Status
471
+
472
+ Route to `<offer_next>`.
473
+
474
+ </process>
475
+
476
+ <offer_next>
477
+ Output this markdown directly (not as a code block):
478
+
479
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
480
+ GRD ► PHASE {X} PLANNED ✓
481
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
482
+
483
+ **Phase {X}: {Name}** — {N} plan(s) in {M} wave(s)
484
+
485
+ | Wave | Plans | What it builds |
486
+ |------|-------|----------------|
487
+ | 1 | 01, 02 | [objectives] |
488
+ | 2 | 03 | [objective] |
489
+
490
+ Research: {Completed | Used existing | Skipped}
491
+ Verification: {Passed | Passed with override | Skipped}
492
+
493
+ ───────────────────────────────────────────────────────────────
494
+
495
+ ## ▶ Next Up
496
+
497
+ **Execute Phase {X}** — run all {N} plans
498
+
499
+ /grd:execute-phase {X}
500
+
501
+ <sub>/clear first → fresh context window</sub>
502
+
503
+ ───────────────────────────────────────────────────────────────
504
+
505
+ **Also available:**
506
+ - cat .planning/phases/{phase-dir}/*-PLAN.md — review plans
507
+ - /grd:plan-phase {X} --research — re-research first
508
+
509
+ ───────────────────────────────────────────────────────────────
510
+ </offer_next>
511
+
512
+ <success_criteria>
513
+ - [ ] .planning/ directory validated
514
+ - [ ] Phase validated against roadmap
515
+ - [ ] Phase directory created if needed
516
+ - [ ] Research completed (unless --skip-research or --gaps or exists)
517
+ - [ ] grd-phase-researcher spawned if research needed
518
+ - [ ] Existing plans checked
519
+ - [ ] grd-planner spawned with context (including RESEARCH.md if available)
520
+ - [ ] Plans created (PLANNING COMPLETE or CHECKPOINT handled)
521
+ - [ ] grd-plan-checker spawned (unless --skip-verify)
522
+ - [ ] Verification passed OR user override OR max iterations with user decision
523
+ - [ ] User sees status between agent spawns
524
+ - [ ] User knows next steps (execute or review)
525
+ </success_criteria>