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,596 @@
1
+ <purpose>
2
+ Validate built features through conversational testing with persistent state. Creates UAT.md that tracks test progress, survives /clear, and feeds gaps into /grd:plan-phase --gaps.
3
+
4
+ User tests, Claude records. One test at a time. Plain text responses.
5
+ </purpose>
6
+
7
+ <philosophy>
8
+ **Show expected, ask if reality matches.**
9
+
10
+ Claude presents what SHOULD happen. User confirms or describes what's different.
11
+ - "yes" / "y" / "next" / empty → pass
12
+ - Anything else → logged as issue, severity inferred
13
+
14
+ No Pass/Fail buttons. No severity questions. Just: "Here's what should happen. Does it?"
15
+ </philosophy>
16
+
17
+ <template>
18
+ @~/.claude/get-research-done/templates/UAT.md
19
+ </template>
20
+
21
+ <process>
22
+
23
+ <step name="resolve_model_profile" priority="first">
24
+ Read model profile for agent spawning:
25
+
26
+ ```bash
27
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
28
+ ```
29
+
30
+ Default to "balanced" if not set.
31
+
32
+ **Model lookup table:**
33
+
34
+ | Agent | quality | balanced | budget |
35
+ |-------|---------|----------|--------|
36
+ | grd-planner | opus | opus | sonnet |
37
+ | grd-plan-checker | sonnet | sonnet | haiku |
38
+
39
+ Store resolved models for use in Task calls below.
40
+ </step>
41
+
42
+ <step name="check_active_session">
43
+ **First: Check for active UAT sessions**
44
+
45
+ ```bash
46
+ find .planning/phases -name "*-UAT.md" -type f 2>/dev/null | head -5
47
+ ```
48
+
49
+ **If active sessions exist AND no $ARGUMENTS provided:**
50
+
51
+ Read each file's frontmatter (status, phase) and Current Test section.
52
+
53
+ Display inline:
54
+
55
+ ```
56
+ ## Active UAT Sessions
57
+
58
+ | # | Phase | Status | Current Test | Progress |
59
+ |---|-------|--------|--------------|----------|
60
+ | 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
61
+ | 2 | 05-auth | testing | 1. Login Form | 0/4 |
62
+
63
+ Reply with a number to resume, or provide a phase number to start new.
64
+ ```
65
+
66
+ Wait for user response.
67
+
68
+ - If user replies with number (1, 2) → Load that file, go to `resume_from_file`
69
+ - If user replies with phase number → Treat as new session, go to `create_uat_file`
70
+
71
+ **If active sessions exist AND $ARGUMENTS provided:**
72
+
73
+ Check if session exists for that phase. If yes, offer to resume or restart.
74
+ If no, continue to `create_uat_file`.
75
+
76
+ **If no active sessions AND no $ARGUMENTS:**
77
+
78
+ ```
79
+ No active UAT sessions.
80
+
81
+ Provide a phase number to start testing (e.g., /grd:verify-work 4)
82
+ ```
83
+
84
+ **If no active sessions AND $ARGUMENTS provided:**
85
+
86
+ Continue to `create_uat_file`.
87
+ </step>
88
+
89
+ <step name="find_summaries">
90
+ **Find what to test:**
91
+
92
+ Parse $ARGUMENTS as phase number (e.g., "4") or plan number (e.g., "04-02").
93
+
94
+ ```bash
95
+ # Find phase directory (match both zero-padded and unpadded)
96
+ PADDED_PHASE=$(printf "%02d" ${PHASE_ARG} 2>/dev/null || echo "${PHASE_ARG}")
97
+ PHASE_DIR=$(ls -d .planning/phases/${PADDED_PHASE}-* .planning/phases/${PHASE_ARG}-* 2>/dev/null | head -1)
98
+
99
+ # Find SUMMARY files
100
+ ls "$PHASE_DIR"/*-SUMMARY.md 2>/dev/null
101
+ ```
102
+
103
+ Read each SUMMARY.md to extract testable deliverables.
104
+ </step>
105
+
106
+ <step name="extract_tests">
107
+ **Extract testable deliverables from SUMMARY.md:**
108
+
109
+ Parse for:
110
+ 1. **Accomplishments** - Features/functionality added
111
+ 2. **User-facing changes** - UI, workflows, interactions
112
+
113
+ Focus on USER-OBSERVABLE outcomes, not implementation details.
114
+
115
+ For each deliverable, create a test:
116
+ - name: Brief test name
117
+ - expected: What the user should see/experience (specific, observable)
118
+
119
+ Examples:
120
+ - Accomplishment: "Added comment threading with infinite nesting"
121
+ → Test: "Reply to a Comment"
122
+ → Expected: "Clicking Reply opens inline composer below comment. Submitting shows reply nested under parent with visual indentation."
123
+
124
+ Skip internal/non-observable items (refactors, type changes, etc.).
125
+ </step>
126
+
127
+ <step name="create_uat_file">
128
+ **Create UAT file with all tests:**
129
+
130
+ ```bash
131
+ mkdir -p "$PHASE_DIR"
132
+ ```
133
+
134
+ Build test list from extracted deliverables.
135
+
136
+ Create file:
137
+
138
+ ```markdown
139
+ ---
140
+ status: testing
141
+ phase: XX-name
142
+ source: [list of SUMMARY.md files]
143
+ started: [ISO timestamp]
144
+ updated: [ISO timestamp]
145
+ ---
146
+
147
+ ## Current Test
148
+ <!-- OVERWRITE each test - shows where we are -->
149
+
150
+ number: 1
151
+ name: [first test name]
152
+ expected: |
153
+ [what user should observe]
154
+ awaiting: user response
155
+
156
+ ## Tests
157
+
158
+ ### 1. [Test Name]
159
+ expected: [observable behavior]
160
+ result: [pending]
161
+
162
+ ### 2. [Test Name]
163
+ expected: [observable behavior]
164
+ result: [pending]
165
+
166
+ ...
167
+
168
+ ## Summary
169
+
170
+ total: [N]
171
+ passed: 0
172
+ issues: 0
173
+ pending: [N]
174
+ skipped: 0
175
+
176
+ ## Gaps
177
+
178
+ [none yet]
179
+ ```
180
+
181
+ Write to `.planning/phases/XX-name/{phase}-UAT.md`
182
+
183
+ Proceed to `present_test`.
184
+ </step>
185
+
186
+ <step name="present_test">
187
+ **Present current test to user:**
188
+
189
+ Read Current Test section from UAT file.
190
+
191
+ Display using checkpoint box format:
192
+
193
+ ```
194
+ ╔══════════════════════════════════════════════════════════════╗
195
+ ║ CHECKPOINT: Verification Required ║
196
+ ╚══════════════════════════════════════════════════════════════╝
197
+
198
+ **Test {number}: {name}**
199
+
200
+ {expected}
201
+
202
+ ──────────────────────────────────────────────────────────────
203
+ → Type "pass" or describe what's wrong
204
+ ──────────────────────────────────────────────────────────────
205
+ ```
206
+
207
+ Wait for user response (plain text, no AskUserQuestion).
208
+ </step>
209
+
210
+ <step name="process_response">
211
+ **Process user response and update file:**
212
+
213
+ **If response indicates pass:**
214
+ - Empty response, "yes", "y", "ok", "pass", "next", "approved", "✓"
215
+
216
+ Update Tests section:
217
+ ```
218
+ ### {N}. {name}
219
+ expected: {expected}
220
+ result: pass
221
+ ```
222
+
223
+ **If response indicates skip:**
224
+ - "skip", "can't test", "n/a"
225
+
226
+ Update Tests section:
227
+ ```
228
+ ### {N}. {name}
229
+ expected: {expected}
230
+ result: skipped
231
+ reason: [user's reason if provided]
232
+ ```
233
+
234
+ **If response is anything else:**
235
+ - Treat as issue description
236
+
237
+ Infer severity from description:
238
+ - Contains: crash, error, exception, fails, broken, unusable → blocker
239
+ - Contains: doesn't work, wrong, missing, can't → major
240
+ - Contains: slow, weird, off, minor, small → minor
241
+ - Contains: color, font, spacing, alignment, visual → cosmetic
242
+ - Default if unclear: major
243
+
244
+ Update Tests section:
245
+ ```
246
+ ### {N}. {name}
247
+ expected: {expected}
248
+ result: issue
249
+ reported: "{verbatim user response}"
250
+ severity: {inferred}
251
+ ```
252
+
253
+ Append to Gaps section (structured YAML for plan-phase --gaps):
254
+ ```yaml
255
+ - truth: "{expected behavior from test}"
256
+ status: failed
257
+ reason: "User reported: {verbatim user response}"
258
+ severity: {inferred}
259
+ test: {N}
260
+ artifacts: [] # Filled by diagnosis
261
+ missing: [] # Filled by diagnosis
262
+ ```
263
+
264
+ **After any response:**
265
+
266
+ Update Summary counts.
267
+ Update frontmatter.updated timestamp.
268
+
269
+ If more tests remain → Update Current Test, go to `present_test`
270
+ If no more tests → Go to `complete_session`
271
+ </step>
272
+
273
+ <step name="resume_from_file">
274
+ **Resume testing from UAT file:**
275
+
276
+ Read the full UAT file.
277
+
278
+ Find first test with `result: [pending]`.
279
+
280
+ Announce:
281
+ ```
282
+ Resuming: Phase {phase} UAT
283
+ Progress: {passed + issues + skipped}/{total}
284
+ Issues found so far: {issues count}
285
+
286
+ Continuing from Test {N}...
287
+ ```
288
+
289
+ Update Current Test section with the pending test.
290
+ Proceed to `present_test`.
291
+ </step>
292
+
293
+ <step name="complete_session">
294
+ **Complete testing and commit:**
295
+
296
+ Update frontmatter:
297
+ - status: complete
298
+ - updated: [now]
299
+
300
+ Clear Current Test section:
301
+ ```
302
+ ## Current Test
303
+
304
+ [testing complete]
305
+ ```
306
+
307
+ **Check planning config:**
308
+
309
+ ```bash
310
+ COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
311
+ git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
312
+ ```
313
+
314
+ **If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
315
+
316
+ **If `COMMIT_PLANNING_DOCS=true` (default):**
317
+
318
+ Commit the UAT file:
319
+ ```bash
320
+ git add ".planning/phases/XX-name/{phase}-UAT.md"
321
+ git commit -m "test({phase}): complete UAT - {passed} passed, {issues} issues"
322
+ ```
323
+
324
+ Present summary:
325
+ ```
326
+ ## UAT Complete: Phase {phase}
327
+
328
+ | Result | Count |
329
+ |--------|-------|
330
+ | Passed | {N} |
331
+ | Issues | {N} |
332
+ | Skipped| {N} |
333
+
334
+ [If issues > 0:]
335
+ ### Issues Found
336
+
337
+ [List from Issues section]
338
+ ```
339
+
340
+ **If issues > 0:** Proceed to `diagnose_issues`
341
+
342
+ **If issues == 0:**
343
+ ```
344
+ All tests passed. Ready to continue.
345
+
346
+ - `/grd:plan-phase {next}` — Plan next phase
347
+ - `/grd:execute-phase {next}` — Execute next phase
348
+ ```
349
+ </step>
350
+
351
+ <step name="diagnose_issues">
352
+ **Diagnose root causes before planning fixes:**
353
+
354
+ ```
355
+ ---
356
+
357
+ {N} issues found. Diagnosing root causes...
358
+
359
+ Spawning parallel debug agents to investigate each issue.
360
+ ```
361
+
362
+ - Load diagnose-issues workflow
363
+ - Follow @~/.claude/get-research-done/workflows/diagnose-issues.md
364
+ - Spawn parallel debug agents for each issue
365
+ - Collect root causes
366
+ - Update UAT.md with root causes
367
+ - Proceed to `plan_gap_closure`
368
+
369
+ Diagnosis runs automatically - no user prompt. Parallel agents investigate simultaneously, so overhead is minimal and fixes are more accurate.
370
+ </step>
371
+
372
+ <step name="plan_gap_closure">
373
+ **Auto-plan fixes from diagnosed gaps:**
374
+
375
+ Display:
376
+ ```
377
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
378
+ GRD ► PLANNING FIXES
379
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
380
+
381
+ ◆ Spawning planner for gap closure...
382
+ ```
383
+
384
+ Spawn grd-planner in --gaps mode:
385
+
386
+ ```
387
+ Task(
388
+ prompt="""
389
+ <planning_context>
390
+
391
+ **Phase:** {phase_number}
392
+ **Mode:** gap_closure
393
+
394
+ **UAT with diagnoses:**
395
+ @.planning/phases/{phase_dir}/{phase}-UAT.md
396
+
397
+ **Project State:**
398
+ @.planning/STATE.md
399
+
400
+ **Roadmap:**
401
+ @.planning/ROADMAP.md
402
+
403
+ </planning_context>
404
+
405
+ <downstream_consumer>
406
+ Output consumed by /grd:execute-phase
407
+ Plans must be executable prompts.
408
+ </downstream_consumer>
409
+ """,
410
+ subagent_type="grd-planner",
411
+ model="{planner_model}",
412
+ description="Plan gap fixes for Phase {phase}"
413
+ )
414
+ ```
415
+
416
+ On return:
417
+ - **PLANNING COMPLETE:** Proceed to `verify_gap_plans`
418
+ - **PLANNING INCONCLUSIVE:** Report and offer manual intervention
419
+ </step>
420
+
421
+ <step name="verify_gap_plans">
422
+ **Verify fix plans with checker:**
423
+
424
+ Display:
425
+ ```
426
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
427
+ GRD ► VERIFYING FIX PLANS
428
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
429
+
430
+ ◆ Spawning plan checker...
431
+ ```
432
+
433
+ Initialize: `iteration_count = 1`
434
+
435
+ Spawn grd-plan-checker:
436
+
437
+ ```
438
+ Task(
439
+ prompt="""
440
+ <verification_context>
441
+
442
+ **Phase:** {phase_number}
443
+ **Phase Goal:** Close diagnosed gaps from UAT
444
+
445
+ **Plans to verify:**
446
+ @.planning/phases/{phase_dir}/*-PLAN.md
447
+
448
+ </verification_context>
449
+
450
+ <expected_output>
451
+ Return one of:
452
+ - ## VERIFICATION PASSED — all checks pass
453
+ - ## ISSUES FOUND — structured issue list
454
+ </expected_output>
455
+ """,
456
+ subagent_type="grd-plan-checker",
457
+ model="{checker_model}",
458
+ description="Verify Phase {phase} fix plans"
459
+ )
460
+ ```
461
+
462
+ On return:
463
+ - **VERIFICATION PASSED:** Proceed to `present_ready`
464
+ - **ISSUES FOUND:** Proceed to `revision_loop`
465
+ </step>
466
+
467
+ <step name="revision_loop">
468
+ **Iterate planner ↔ checker until plans pass (max 3):**
469
+
470
+ **If iteration_count < 3:**
471
+
472
+ Display: `Sending back to planner for revision... (iteration {N}/3)`
473
+
474
+ Spawn grd-planner with revision context:
475
+
476
+ ```
477
+ Task(
478
+ prompt="""
479
+ <revision_context>
480
+
481
+ **Phase:** {phase_number}
482
+ **Mode:** revision
483
+
484
+ **Existing plans:**
485
+ @.planning/phases/{phase_dir}/*-PLAN.md
486
+
487
+ **Checker issues:**
488
+ {structured_issues_from_checker}
489
+
490
+ </revision_context>
491
+
492
+ <instructions>
493
+ Read existing PLAN.md files. Make targeted updates to address checker issues.
494
+ Do NOT replan from scratch unless issues are fundamental.
495
+ </instructions>
496
+ """,
497
+ subagent_type="grd-planner",
498
+ model="{planner_model}",
499
+ description="Revise Phase {phase} plans"
500
+ )
501
+ ```
502
+
503
+ After planner returns → spawn checker again (verify_gap_plans logic)
504
+ Increment iteration_count
505
+
506
+ **If iteration_count >= 3:**
507
+
508
+ Display: `Max iterations reached. {N} issues remain.`
509
+
510
+ Offer options:
511
+ 1. Force proceed (execute despite issues)
512
+ 2. Provide guidance (user gives direction, retry)
513
+ 3. Abandon (exit, user runs /grd:plan-phase manually)
514
+
515
+ Wait for user response.
516
+ </step>
517
+
518
+ <step name="present_ready">
519
+ **Present completion and next steps:**
520
+
521
+ ```
522
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
523
+ GRD ► FIXES READY ✓
524
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
525
+
526
+ **Phase {X}: {Name}** — {N} gap(s) diagnosed, {M} fix plan(s) created
527
+
528
+ | Gap | Root Cause | Fix Plan |
529
+ |-----|------------|----------|
530
+ | {truth 1} | {root_cause} | {phase}-04 |
531
+ | {truth 2} | {root_cause} | {phase}-04 |
532
+
533
+ Plans verified and ready for execution.
534
+
535
+ ───────────────────────────────────────────────────────────────
536
+
537
+ ## ▶ Next Up
538
+
539
+ **Execute fixes** — run fix plans
540
+
541
+ `/clear` then `/grd:execute-phase {phase} --gaps-only`
542
+
543
+ ───────────────────────────────────────────────────────────────
544
+ ```
545
+ </step>
546
+
547
+ </process>
548
+
549
+ <update_rules>
550
+ **Batched writes for efficiency:**
551
+
552
+ Keep results in memory. Write to file only when:
553
+ 1. **Issue found** — Preserve the problem immediately
554
+ 2. **Session complete** — Final write before commit
555
+ 3. **Checkpoint** — Every 5 passed tests (safety net)
556
+
557
+ | Section | Rule | When Written |
558
+ |---------|------|--------------|
559
+ | Frontmatter.status | OVERWRITE | Start, complete |
560
+ | Frontmatter.updated | OVERWRITE | On any file write |
561
+ | Current Test | OVERWRITE | On any file write |
562
+ | Tests.{N}.result | OVERWRITE | On any file write |
563
+ | Summary | OVERWRITE | On any file write |
564
+ | Gaps | APPEND | When issue found |
565
+
566
+ On context reset: File shows last checkpoint. Resume from there.
567
+ </update_rules>
568
+
569
+ <severity_inference>
570
+ **Infer severity from user's natural language:**
571
+
572
+ | User says | Infer |
573
+ |-----------|-------|
574
+ | "crashes", "error", "exception", "fails completely" | blocker |
575
+ | "doesn't work", "nothing happens", "wrong behavior" | major |
576
+ | "works but...", "slow", "weird", "minor issue" | minor |
577
+ | "color", "spacing", "alignment", "looks off" | cosmetic |
578
+
579
+ Default to **major** if unclear. User can correct if needed.
580
+
581
+ **Never ask "how severe is this?"** - just infer and move on.
582
+ </severity_inference>
583
+
584
+ <success_criteria>
585
+ - [ ] UAT file created with all tests from SUMMARY.md
586
+ - [ ] Tests presented one at a time with expected behavior
587
+ - [ ] User responses processed as pass/issue/skip
588
+ - [ ] Severity inferred from description (never asked)
589
+ - [ ] Batched writes: on issue, every 5 passes, or completion
590
+ - [ ] Committed on completion
591
+ - [ ] If issues: parallel debug agents diagnose root causes
592
+ - [ ] If issues: grd-planner creates fix plans (gap_closure mode)
593
+ - [ ] If issues: grd-plan-checker verifies fix plans
594
+ - [ ] If issues: revision loop until plans pass (max 3 iterations)
595
+ - [ ] Ready for `/grd:execute-phase --gaps-only` when complete
596
+ </success_criteria>
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ // Check for GRD updates in background, write result to cache
3
+ // Called by SessionStart hook - runs once per session
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+ const { spawn } = require('child_process');
9
+
10
+ const homeDir = os.homedir();
11
+ const cwd = process.cwd();
12
+ const cacheDir = path.join(homeDir, '.claude', 'cache');
13
+ const cacheFile = path.join(cacheDir, 'grd-update-check.json');
14
+
15
+ // VERSION file locations (check project first, then global)
16
+ const projectVersionFile = path.join(cwd, '.claude', 'get-research-done', 'VERSION');
17
+ const globalVersionFile = path.join(homeDir, '.claude', 'get-research-done', 'VERSION');
18
+
19
+ // Ensure cache directory exists
20
+ if (!fs.existsSync(cacheDir)) {
21
+ fs.mkdirSync(cacheDir, { recursive: true });
22
+ }
23
+
24
+ // Run check in background (spawn background process, windowsHide prevents console flash)
25
+ const child = spawn(process.execPath, ['-e', `
26
+ const fs = require('fs');
27
+ const { execSync } = require('child_process');
28
+
29
+ const cacheFile = ${JSON.stringify(cacheFile)};
30
+ const projectVersionFile = ${JSON.stringify(projectVersionFile)};
31
+ const globalVersionFile = ${JSON.stringify(globalVersionFile)};
32
+
33
+ // Check project directory first (local install), then global
34
+ let installed = '0.0.0';
35
+ try {
36
+ if (fs.existsSync(projectVersionFile)) {
37
+ installed = fs.readFileSync(projectVersionFile, 'utf8').trim();
38
+ } else if (fs.existsSync(globalVersionFile)) {
39
+ installed = fs.readFileSync(globalVersionFile, 'utf8').trim();
40
+ }
41
+ } catch (e) {}
42
+
43
+ let latest = null;
44
+ try {
45
+ latest = execSync('npm view get-research-done version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim();
46
+ } catch (e) {}
47
+
48
+ const result = {
49
+ update_available: latest && installed !== latest,
50
+ installed,
51
+ latest: latest || 'unknown',
52
+ checked: Math.floor(Date.now() / 1000)
53
+ };
54
+
55
+ fs.writeFileSync(cacheFile, JSON.stringify(result));
56
+ `], {
57
+ stdio: 'ignore',
58
+ windowsHide: true
59
+ });
60
+
61
+ child.unref();