get-shit-done-cc 1.7.1 → 1.9.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 (44) hide show
  1. package/README.md +104 -0
  2. package/agents/gsd-debugger.md +20 -1
  3. package/agents/gsd-executor.md +30 -0
  4. package/agents/gsd-phase-researcher.md +9 -0
  5. package/agents/gsd-planner.md +41 -0
  6. package/agents/gsd-research-synthesizer.md +9 -0
  7. package/bin/install.js +78 -7
  8. package/commands/gsd/add-todo.md +11 -0
  9. package/commands/gsd/analyze-codebase.md +363 -0
  10. package/commands/gsd/audit-milestone.md +20 -1
  11. package/commands/gsd/check-todos.md +11 -0
  12. package/commands/gsd/debug.md +20 -0
  13. package/commands/gsd/execute-phase.md +40 -5
  14. package/commands/gsd/help.md +118 -0
  15. package/commands/gsd/new-milestone.md +267 -263
  16. package/commands/gsd/new-project.md +116 -10
  17. package/commands/gsd/pause-work.md +11 -0
  18. package/commands/gsd/plan-milestone-gaps.md +11 -0
  19. package/commands/gsd/plan-phase.md +84 -26
  20. package/commands/gsd/progress.md +8 -0
  21. package/commands/gsd/query-intel.md +128 -0
  22. package/commands/gsd/quick.md +23 -0
  23. package/commands/gsd/remove-phase.md +11 -0
  24. package/commands/gsd/research-phase.md +20 -0
  25. package/commands/gsd/set-profile.md +106 -0
  26. package/commands/gsd/settings.md +136 -0
  27. package/get-shit-done/references/model-profiles.md +73 -0
  28. package/get-shit-done/references/planning-config.md +94 -0
  29. package/get-shit-done/templates/config.json +9 -0
  30. package/get-shit-done/templates/entity.md +173 -0
  31. package/get-shit-done/workflows/complete-milestone.md +11 -0
  32. package/get-shit-done/workflows/diagnose-issues.md +11 -0
  33. package/get-shit-done/workflows/discuss-phase.md +11 -0
  34. package/get-shit-done/workflows/execute-phase.md +68 -9
  35. package/get-shit-done/workflows/execute-plan.md +188 -4
  36. package/get-shit-done/workflows/map-codebase.md +35 -2
  37. package/get-shit-done/workflows/verify-work.md +33 -0
  38. package/hooks/dist/gsd-intel-index.js +97 -0
  39. package/hooks/dist/gsd-intel-prune.js +78 -0
  40. package/hooks/dist/gsd-intel-session.js +39 -0
  41. package/package.json +12 -2
  42. package/scripts/build-hooks.js +95 -0
  43. /package/hooks/{gsd-check-update.js → dist/gsd-check-update.js} +0 -0
  44. /package/hooks/{statusline.js → dist/statusline.js} +0 -0
@@ -19,6 +19,7 @@ This is the most leveraged moment in any project. Deep questioning here means be
19
19
  - `.planning/PROJECT.md` — project context
20
20
  - `.planning/config.json` — workflow preferences
21
21
  - `.planning/research/` — domain research (optional)
22
+ - `.planning/intel/` — codebase intelligence (auto-populated by hooks)
22
23
  - `.planning/REQUIREMENTS.md` — scoped requirements
23
24
  - `.planning/ROADMAP.md` — phase structure
24
25
  - `.planning/STATE.md` — project memory
@@ -57,7 +58,14 @@ This is the most leveraged moment in any project. Deep questioning here means be
57
58
  fi
58
59
  ```
59
60
 
60
- 3. **Detect existing code (brownfield detection):**
61
+ 3. **Create intel directory for codebase intelligence:**
62
+ ```bash
63
+ mkdir -p .planning/intel
64
+ ```
65
+
66
+ This prepares the directory for the PostToolUse hook to populate with index.json, conventions.json, and summary.md as Claude writes code.
67
+
68
+ 4. **Detect existing code (brownfield detection):**
61
69
  ```bash
62
70
  CODE_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" -o -name "*.java" 2>/dev/null | grep -v node_modules | grep -v .git | head -20)
63
71
  HAS_PACKAGE=$([ -f package.json ] || [ -f requirements.txt ] || [ -f Cargo.toml ] || [ -f go.mod ] || [ -f Package.swift ] && echo "yes")
@@ -237,7 +245,7 @@ EOF
237
245
 
238
246
  ## Phase 5: Workflow Preferences
239
247
 
240
- Ask all workflow preferences in a single AskUserQuestion call (3 questions):
248
+ **Round 1 Core workflow settings (4 questions):**
241
249
 
242
250
  ```
243
251
  questions: [
@@ -268,11 +276,85 @@ questions: [
268
276
  { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
269
277
  { label: "Sequential", description: "One plan at a time" }
270
278
  ]
279
+ },
280
+ {
281
+ header: "Git Tracking",
282
+ question: "Commit planning docs to git?",
283
+ multiSelect: false,
284
+ options: [
285
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
286
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
287
+ ]
288
+ }
289
+ ]
290
+ ```
291
+
292
+ **Round 2 — Workflow agents:**
293
+
294
+ These spawn additional agents during planning/execution. They add tokens and time but improve quality.
295
+
296
+ | Agent | When it runs | What it does |
297
+ |-------|--------------|--------------|
298
+ | **Researcher** | Before planning each phase | Investigates domain, finds patterns, surfaces gotchas |
299
+ | **Plan Checker** | After plan is created | Verifies plan actually achieves the phase goal |
300
+ | **Verifier** | After phase execution | Confirms must-haves were delivered |
301
+
302
+ All recommended for important projects. Skip for quick experiments.
303
+
304
+ ```
305
+ questions: [
306
+ {
307
+ header: "Research",
308
+ question: "Spawn Plan Researcher? (researches domain before planning — adds tokens/time)",
309
+ multiSelect: false,
310
+ options: [
311
+ { label: "Yes (Recommended)", description: "Research phase goals before planning" },
312
+ { label: "No", description: "Skip research, plan directly" }
313
+ ]
314
+ },
315
+ {
316
+ header: "Plan Check",
317
+ question: "Spawn Plan Checker? (verifies plans before execution — adds tokens/time)",
318
+ multiSelect: false,
319
+ options: [
320
+ { label: "Yes (Recommended)", description: "Verify plans meet phase goals" },
321
+ { label: "No", description: "Skip plan verification" }
322
+ ]
323
+ },
324
+ {
325
+ header: "Verifier",
326
+ question: "Spawn Execution Verifier? (verifies phase completion — adds tokens/time)",
327
+ multiSelect: false,
328
+ options: [
329
+ { label: "Yes (Recommended)", description: "Verify must-haves after execution" },
330
+ { label: "No", description: "Skip post-execution verification" }
331
+ ]
271
332
  }
272
333
  ]
273
334
  ```
274
335
 
275
- Create `.planning/config.json` with chosen mode, depth, and parallelization.
336
+ Create `.planning/config.json` with all settings:
337
+
338
+ ```json
339
+ {
340
+ "mode": "yolo|interactive",
341
+ "depth": "quick|standard|comprehensive",
342
+ "parallelization": true|false,
343
+ "commit_docs": true|false,
344
+ "workflow": {
345
+ "research": true|false,
346
+ "plan_check": true|false,
347
+ "verifier": true|false
348
+ }
349
+ }
350
+ ```
351
+
352
+ **If commit_docs = No:**
353
+ - Set `commit_docs: false` in config.json
354
+ - Add `.planning/` to `.gitignore` (create if needed)
355
+
356
+ **If commit_docs = Yes:**
357
+ - Add `.planning/intel/` to `.gitignore` (intel is always local — changes constantly, can be regenerated)
276
358
 
277
359
  **Commit config.json:**
278
360
 
@@ -284,10 +366,33 @@ chore: add project config
284
366
  Mode: [chosen mode]
285
367
  Depth: [chosen depth]
286
368
  Parallelization: [enabled/disabled]
369
+ Workflow agents: research=[on/off], plan_check=[on/off], verifier=[on/off]
287
370
  EOF
288
371
  )"
289
372
  ```
290
373
 
374
+ **Note:** Run `/gsd:settings` anytime to update these preferences.
375
+
376
+ ## Phase 5.5: Resolve Model Profile
377
+
378
+ Read model profile for agent spawning:
379
+
380
+ ```bash
381
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
382
+ ```
383
+
384
+ Default to "balanced" if not set.
385
+
386
+ **Model lookup table:**
387
+
388
+ | Agent | quality | balanced | budget |
389
+ |-------|---------|----------|--------|
390
+ | gsd-project-researcher | opus | sonnet | haiku |
391
+ | gsd-research-synthesizer | sonnet | sonnet | haiku |
392
+ | gsd-roadmapper | opus | sonnet | sonnet |
393
+
394
+ Store resolved models for use in Task calls below.
395
+
291
396
  ## Phase 6: Research Decision
292
397
 
293
398
  Use AskUserQuestion:
@@ -368,7 +473,7 @@ Your STACK.md feeds into roadmap creation. Be prescriptive:
368
473
  Write to: .planning/research/STACK.md
369
474
  Use template: ~/.claude/get-shit-done/templates/research-project/STACK.md
370
475
  </output>
371
- ", subagent_type="gsd-project-researcher", description="Stack research")
476
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Stack research")
372
477
 
373
478
  Task(prompt="
374
479
  <research_type>
@@ -407,7 +512,7 @@ Your FEATURES.md feeds into requirements definition. Categorize clearly:
407
512
  Write to: .planning/research/FEATURES.md
408
513
  Use template: ~/.claude/get-shit-done/templates/research-project/FEATURES.md
409
514
  </output>
410
- ", subagent_type="gsd-project-researcher", description="Features research")
515
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Features research")
411
516
 
412
517
  Task(prompt="
413
518
  <research_type>
@@ -446,7 +551,7 @@ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
446
551
  Write to: .planning/research/ARCHITECTURE.md
447
552
  Use template: ~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md
448
553
  </output>
449
- ", subagent_type="gsd-project-researcher", description="Architecture research")
554
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Architecture research")
450
555
 
451
556
  Task(prompt="
452
557
  <research_type>
@@ -485,7 +590,7 @@ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
485
590
  Write to: .planning/research/PITFALLS.md
486
591
  Use template: ~/.claude/get-shit-done/templates/research-project/PITFALLS.md
487
592
  </output>
488
- ", subagent_type="gsd-project-researcher", description="Pitfalls research")
593
+ ", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Pitfalls research")
489
594
  ```
490
595
 
491
596
  After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
@@ -509,7 +614,7 @@ Write to: .planning/research/SUMMARY.md
509
614
  Use template: ~/.claude/get-shit-done/templates/research-project/SUMMARY.md
510
615
  Commit after writing.
511
616
  </output>
512
- ", subagent_type="gsd-research-synthesizer", description="Synthesize research")
617
+ ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
513
618
  ```
514
619
 
515
620
  Display research complete banner and key findings:
@@ -714,7 +819,7 @@ Create roadmap:
714
819
 
715
820
  Write files first, then return. This ensures artifacts persist even if context is lost.
716
821
  </instructions>
717
- ", subagent_type="gsd-roadmapper", description="Create roadmap")
822
+ ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap")
718
823
  ```
719
824
 
720
825
  **Handle roadmapper return:**
@@ -790,7 +895,7 @@ Use AskUserQuestion:
790
895
  Update the roadmap based on feedback. Edit files in place.
791
896
  Return ROADMAP REVISED with changes made.
792
897
  </revision>
793
- ", subagent_type="gsd-roadmapper", description="Revise roadmap")
898
+ ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
794
899
  ```
795
900
  - Present revised roadmap
796
901
  - Loop until user approves
@@ -865,6 +970,7 @@ Present completion with next steps:
865
970
  - `ARCHITECTURE.md`
866
971
  - `PITFALLS.md`
867
972
  - `SUMMARY.md`
973
+ - `.planning/intel/` (created empty, populated by hooks during coding)
868
974
  - `.planning/REQUIREMENTS.md`
869
975
  - `.planning/ROADMAP.md`
870
976
  - `.planning/STATE.md`
@@ -90,6 +90,17 @@ Be specific enough for a fresh Claude to understand immediately.
90
90
  </step>
91
91
 
92
92
  <step name="commit">
93
+ **Check planning config:**
94
+
95
+ ```bash
96
+ COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
97
+ git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
98
+ ```
99
+
100
+ **If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
101
+
102
+ **If `COMMIT_PLANNING_DOCS=true` (default):**
103
+
93
104
  ```bash
94
105
  git add .planning/phases/*/.continue-here.md
95
106
  git commit -m "wip: [phase-name] paused at task [X]/[Y]"
@@ -158,6 +158,17 @@ mkdir -p ".planning/phases/{NN}-{name}"
158
158
 
159
159
  ## 8. Commit Roadmap Update
160
160
 
161
+ **Check planning config:**
162
+
163
+ ```bash
164
+ COMMIT_PLANNING_DOCS=$(cat .planning/config.json 2>/dev/null | grep -o '"commit_docs"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")
165
+ git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
166
+ ```
167
+
168
+ **If `COMMIT_PLANNING_DOCS=false`:** Skip git operations
169
+
170
+ **If `COMMIT_PLANNING_DOCS=true` (default):**
171
+
161
172
  ```bash
162
173
  git add .planning/ROADMAP.md
163
174
  git commit -m "docs(roadmap): add gap closure phases {N}-{M}"
@@ -42,7 +42,7 @@ Normalize phase input in step 2 before any directory lookups.
42
42
 
43
43
  <process>
44
44
 
45
- ## 1. Validate Environment
45
+ ## 1. Validate Environment and Resolve Model Profile
46
46
 
47
47
  ```bash
48
48
  ls .planning/ 2>/dev/null
@@ -50,6 +50,24 @@ ls .planning/ 2>/dev/null
50
50
 
51
51
  **If not found:** Error - user should run `/gsd:new-project` first.
52
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
+ | gsd-phase-researcher | opus | sonnet | haiku |
66
+ | gsd-planner | opus | opus | sonnet |
67
+ | gsd-plan-checker | sonnet | sonnet | haiku |
68
+
69
+ Store resolved models for use in Task calls below.
70
+
53
71
  ## 2. Parse and Normalize Arguments
54
72
 
55
73
  Extract from $ARGUMENTS:
@@ -107,6 +125,14 @@ fi
107
125
 
108
126
  **If `--skip-research` flag:** Skip to step 6.
109
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
+
110
136
  **Otherwise:**
111
137
 
112
138
  Check for existing research:
@@ -182,6 +208,7 @@ Write research findings to: {phase_dir}/{phase}-RESEARCH.md
182
208
  Task(
183
209
  prompt=research_prompt,
184
210
  subagent_type="gsd-phase-researcher",
211
+ model="{researcher_model}",
185
212
  description="Research Phase {phase}"
186
213
  )
187
214
  ```
@@ -205,21 +232,26 @@ ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null
205
232
 
206
233
  **If exists:** Offer: 1) Continue planning (add more plans), 2) View existing, 3) Replan from scratch. Wait for response.
207
234
 
208
- ## 7. Gather Context Paths
235
+ ## 7. Read Context Files
209
236
 
210
- Identify context files for the planner agent:
237
+ Read and store context file contents for the planner agent. The `@` syntax does not work across Task() boundaries - content must be inlined.
211
238
 
212
239
  ```bash
213
- # Required
214
- STATE=.planning/STATE.md
215
- ROADMAP=.planning/ROADMAP.md
216
- REQUIREMENTS=.planning/REQUIREMENTS.md
217
-
218
- # Optional (created by earlier steps or commands)
219
- CONTEXT="${PHASE_DIR}/${PHASE}-CONTEXT.md"
220
- RESEARCH="${PHASE_DIR}/${PHASE}-RESEARCH.md"
221
- VERIFICATION="${PHASE_DIR}/${PHASE}-VERIFICATION.md"
222
- UAT="${PHASE_DIR}/${PHASE}-UAT.md"
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
+ # Codebase intelligence (if exists)
254
+ INTEL_CONTENT=$(cat .planning/intel/summary.md 2>/dev/null)
223
255
  ```
224
256
 
225
257
  ## 8. Spawn gsd-planner Agent
@@ -233,7 +265,7 @@ Display stage banner:
233
265
  ◆ Spawning planner...
234
266
  ```
235
267
 
236
- Fill prompt and spawn:
268
+ Fill prompt with inlined content and spawn:
237
269
 
238
270
  ```markdown
239
271
  <planning_context>
@@ -242,23 +274,28 @@ Fill prompt and spawn:
242
274
  **Mode:** {standard | gap_closure}
243
275
 
244
276
  **Project State:**
245
- @.planning/STATE.md
277
+ {state_content}
246
278
 
247
279
  **Roadmap:**
248
- @.planning/ROADMAP.md
280
+ {roadmap_content}
249
281
 
250
282
  **Requirements (if exists):**
251
- @.planning/REQUIREMENTS.md
283
+ {requirements_content}
252
284
 
253
285
  **Phase Context (if exists):**
254
- @.planning/phases/{phase_dir}/{phase}-CONTEXT.md
286
+ {context_content}
255
287
 
256
288
  **Research (if exists):**
257
- @.planning/phases/{phase_dir}/{phase}-RESEARCH.md
289
+ {research_content}
258
290
 
259
291
  **Gap Closure (if --gaps mode):**
260
- @.planning/phases/{phase_dir}/{phase}-VERIFICATION.md
261
- @.planning/phases/{phase_dir}/{phase}-UAT.md
292
+ {verification_content}
293
+ {uat_content}
294
+
295
+ **Codebase Intel (if exists):**
296
+ <codebase-intel>
297
+ {intel_content}
298
+ </codebase-intel>
262
299
 
263
300
  </planning_context>
264
301
 
@@ -288,6 +325,7 @@ Before returning PLANNING COMPLETE:
288
325
  Task(
289
326
  prompt=filled_prompt,
290
327
  subagent_type="gsd-planner",
328
+ model="{planner_model}",
291
329
  description="Plan Phase {phase}"
292
330
  )
293
331
  ```
@@ -299,6 +337,8 @@ Parse planner output:
299
337
  **`## PLANNING COMPLETE`:**
300
338
  - Display: `Planner created {N} plan(s). Files on disk.`
301
339
  - If `--skip-verify`: Skip to step 13
340
+ - Check config: `WORKFLOW_PLAN_CHECK=$(cat .planning/config.json 2>/dev/null | grep -o '"plan_check"[[:space:]]*:[[:space:]]*[^,}]*' | grep -o 'true\|false' || echo "true")`
341
+ - If `workflow.plan_check` is `false`: Skip to step 13
302
342
  - Otherwise: Proceed to step 10
303
343
 
304
344
  **`## CHECKPOINT REACHED`:**
@@ -320,7 +360,17 @@ Display:
320
360
  ◆ Spawning plan checker...
321
361
  ```
322
362
 
323
- Fill checker prompt and spawn:
363
+ Read plans and requirements for the checker:
364
+
365
+ ```bash
366
+ # Read all plans in phase directory
367
+ PLANS_CONTENT=$(cat "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
368
+
369
+ # Read requirements (reuse from step 7 if available)
370
+ REQUIREMENTS_CONTENT=$(cat .planning/REQUIREMENTS.md 2>/dev/null)
371
+ ```
372
+
373
+ Fill checker prompt with inlined content and spawn:
324
374
 
325
375
  ```markdown
326
376
  <verification_context>
@@ -329,10 +379,10 @@ Fill checker prompt and spawn:
329
379
  **Phase Goal:** {goal from ROADMAP}
330
380
 
331
381
  **Plans to verify:**
332
- @.planning/phases/{phase_dir}/*-PLAN.md
382
+ {plans_content}
333
383
 
334
384
  **Requirements (if exists):**
335
- @.planning/REQUIREMENTS.md
385
+ {requirements_content}
336
386
 
337
387
  </verification_context>
338
388
 
@@ -347,6 +397,7 @@ Return one of:
347
397
  Task(
348
398
  prompt=checker_prompt,
349
399
  subagent_type="gsd-plan-checker",
400
+ model="{checker_model}",
350
401
  description="Verify Phase {phase} plans"
351
402
  )
352
403
  ```
@@ -371,6 +422,12 @@ Track: `iteration_count` (starts at 1 after initial plan + check)
371
422
 
372
423
  Display: `Sending back to planner for revision... (iteration {N}/3)`
373
424
 
425
+ Read current plans for revision context:
426
+
427
+ ```bash
428
+ PLANS_CONTENT=$(cat "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
429
+ ```
430
+
374
431
  Spawn gsd-planner with revision prompt:
375
432
 
376
433
  ```markdown
@@ -380,7 +437,7 @@ Spawn gsd-planner with revision prompt:
380
437
  **Mode:** revision
381
438
 
382
439
  **Existing plans:**
383
- @.planning/phases/{phase_dir}/*-PLAN.md
440
+ {plans_content}
384
441
 
385
442
  **Checker issues:**
386
443
  {structured_issues_from_checker}
@@ -388,7 +445,7 @@ Spawn gsd-planner with revision prompt:
388
445
  </revision_context>
389
446
 
390
447
  <instructions>
391
- Read existing PLAN.md files. Make targeted updates to address checker issues.
448
+ Make targeted updates to address checker issues.
392
449
  Do NOT replan from scratch unless issues are fundamental.
393
450
  Return what changed.
394
451
  </instructions>
@@ -398,6 +455,7 @@ Return what changed.
398
455
  Task(
399
456
  prompt=revision_prompt,
400
457
  subagent_type="gsd-planner",
458
+ model="{planner_model}",
401
459
  description="Revise Phase {phase} plans"
402
460
  )
403
461
  ```
@@ -21,6 +21,12 @@ Provides situational awareness before continuing work.
21
21
  <step name="verify">
22
22
  **Verify planning structure exists:**
23
23
 
24
+ Use Bash (not Glob) to check—Glob respects .gitignore but .planning/ is often gitignored:
25
+
26
+ ```bash
27
+ test -d .planning && echo "exists" || echo "missing"
28
+ ```
29
+
24
30
  If no `.planning/` directory:
25
31
 
26
32
  ```
@@ -46,6 +52,7 @@ If missing both ROADMAP.md and PROJECT.md: suggest `/gsd:new-project`.
46
52
  - Read `.planning/STATE.md` for living memory (position, decisions, issues)
47
53
  - Read `.planning/ROADMAP.md` for phase structure and objectives
48
54
  - Read `.planning/PROJECT.md` for current state (What This Is, Core Value, Requirements)
55
+ - Read `.planning/config.json` for settings (model_profile, workflow toggles)
49
56
  </step>
50
57
 
51
58
  <step name="recent">
@@ -74,6 +81,7 @@ If missing both ROADMAP.md and PROJECT.md: suggest `/gsd:new-project`.
74
81
  # [Project Name]
75
82
 
76
83
  **Progress:** [████████░░] 8/10 plans complete
84
+ **Profile:** [quality/balanced/budget]
77
85
 
78
86
  ## Recent Work
79
87
  - [Phase X, Plan Y]: [what was accomplished - 1 line]
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: gsd:query-intel
3
+ description: Query codebase intelligence graph for dependencies and hotspots
4
+ argument-hint: "<dependents|hotspots> [file-path]"
5
+ allowed-tools:
6
+ - Bash
7
+ ---
8
+
9
+ <objective>
10
+ Query the codebase intelligence graph database for relationship information.
11
+
12
+ **Query types:**
13
+ - `dependents <file>` — What files depend on this file? (blast radius)
14
+ - `hotspots` — Which files have the most dependents? (change carefully)
15
+
16
+ Output: Formatted query results from graph.db
17
+ </objective>
18
+
19
+ <context>
20
+ This command exposes the graph query capabilities built by Phase 4 (Semantic Intelligence).
21
+
22
+ **Use for:**
23
+ - Checking blast radius before refactoring a core file
24
+ - Identifying high-impact files that need careful changes
25
+ - Understanding dependency relationships in the codebase
26
+
27
+ **Requires:** `.planning/intel/graph.db` (created by `/gsd:analyze-codebase` with entity generation)
28
+
29
+ If graph.db doesn't exist, the command will return an error suggesting to run analyze-codebase first.
30
+ </context>
31
+
32
+ <process>
33
+
34
+ ## Step 1: Parse arguments
35
+
36
+ Extract query type and optional file path from arguments.
37
+
38
+ **Arguments:** $ARGUMENTS
39
+
40
+ **Expected formats:**
41
+ - `dependents src/lib/db.ts` — query what depends on this file
42
+ - `hotspots` — query most-depended-on files
43
+ - `hotspots 10` — query top 10 hotspots (default: 5)
44
+
45
+ ## Step 2: Convert file path to entity ID
46
+
47
+ For `dependents` queries, convert the file path to entity ID format:
48
+ - `src/lib/db.ts` → `src-lib-db`
49
+ - Replace `/` with `-`, remove extension
50
+
51
+ ```bash
52
+ # Example conversion
53
+ FILE_PATH="src/lib/db.ts"
54
+ ENTITY_ID=$(echo "$FILE_PATH" | sed 's/\.[^.]*$//' | tr '/' '-')
55
+ ```
56
+
57
+ ## Step 3: Execute query
58
+
59
+ Run the appropriate query against the graph database:
60
+
61
+ **For dependents:**
62
+ ```bash
63
+ echo '{"action":"query","type":"dependents","target":"'$ENTITY_ID'","limit":20}' | node hooks/gsd-intel-index.js
64
+ ```
65
+
66
+ **For hotspots:**
67
+ ```bash
68
+ echo '{"action":"query","type":"hotspots","limit":5}' | node hooks/gsd-intel-index.js
69
+ ```
70
+
71
+ ## Step 4: Format and present results
72
+
73
+ Parse the JSON response and present in readable format.
74
+
75
+ **For dependents:**
76
+ ```
77
+ ## Files that depend on {file-path}
78
+
79
+ Found {count} dependents:
80
+
81
+ 1. src/api/users.ts
82
+ 2. src/api/auth.ts
83
+ 3. src/services/payment.ts
84
+ ...
85
+
86
+ **Blast radius:** {count} files would be affected by changes.
87
+ ```
88
+
89
+ **For hotspots:**
90
+ ```
91
+ ## Dependency Hotspots
92
+
93
+ These files have the most dependents — change carefully:
94
+
95
+ | Rank | File | Dependents |
96
+ |------|------|------------|
97
+ | 1 | src/lib/db.ts | 42 |
98
+ | 2 | src/types/user.ts | 35 |
99
+ | 3 | src/utils/format.ts | 28 |
100
+ ```
101
+
102
+ ## Step 5: Handle errors
103
+
104
+ **If graph.db doesn't exist:**
105
+ ```
106
+ No graph database found at .planning/intel/graph.db
107
+
108
+ Run /gsd:analyze-codebase first to build the dependency graph.
109
+ ```
110
+
111
+ **If entity not found:**
112
+ ```
113
+ No entity found for: {file-path}
114
+
115
+ The file may not be indexed yet. Try:
116
+ - /gsd:analyze-codebase to rebuild the index
117
+ - Check the file path is correct
118
+ ```
119
+
120
+ </process>
121
+
122
+ <success_criteria>
123
+ - [ ] Query type parsed from arguments
124
+ - [ ] File path converted to entity ID (for dependents)
125
+ - [ ] Query executed against graph.db
126
+ - [ ] Results formatted in readable markdown
127
+ - [ ] Errors handled gracefully with helpful messages
128
+ </success_criteria>
@@ -34,6 +34,27 @@ Orchestration is inline - no separate workflow file. Quick mode is deliberately
34
34
  </context>
35
35
 
36
36
  <process>
37
+ **Step 0: Resolve Model Profile**
38
+
39
+ Read model profile for agent spawning:
40
+
41
+ ```bash
42
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
43
+ ```
44
+
45
+ Default to "balanced" if not set.
46
+
47
+ **Model lookup table:**
48
+
49
+ | Agent | quality | balanced | budget |
50
+ |-------|---------|----------|--------|
51
+ | gsd-planner | opus | opus | sonnet |
52
+ | gsd-executor | opus | sonnet | sonnet |
53
+
54
+ Store resolved models for use in Task calls below.
55
+
56
+ ---
57
+
37
58
  **Step 1: Pre-flight validation**
38
59
 
39
60
  Check that an active GSD project exists:
@@ -145,6 +166,7 @@ Return: ## PLANNING COMPLETE with plan path
145
166
  </output>
146
167
  ",
147
168
  subagent_type="gsd-planner",
169
+ model="{planner_model}",
148
170
  description="Quick plan: ${DESCRIPTION}"
149
171
  )
150
172
  ```
@@ -178,6 +200,7 @@ Project state: @.planning/STATE.md
178
200
  </constraints>
179
201
  ",
180
202
  subagent_type="gsd-executor",
203
+ model="{executor_model}",
181
204
  description="Execute: ${DESCRIPTION}"
182
205
  )
183
206
  ```