declare-cc 0.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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +326 -0
  3. package/agents/gsd-codebase-mapper.md +761 -0
  4. package/agents/gsd-debugger.md +1198 -0
  5. package/agents/gsd-executor.md +451 -0
  6. package/agents/gsd-integration-checker.md +440 -0
  7. package/agents/gsd-phase-researcher.md +484 -0
  8. package/agents/gsd-plan-checker.md +625 -0
  9. package/agents/gsd-planner.md +1164 -0
  10. package/agents/gsd-project-researcher.md +618 -0
  11. package/agents/gsd-research-synthesizer.md +236 -0
  12. package/agents/gsd-roadmapper.md +639 -0
  13. package/agents/gsd-verifier.md +555 -0
  14. package/bin/install.js +1815 -0
  15. package/commands/declare/actions.md +78 -0
  16. package/commands/declare/future.md +52 -0
  17. package/commands/declare/milestones.md +81 -0
  18. package/commands/declare/status.md +62 -0
  19. package/commands/gsd/add-phase.md +39 -0
  20. package/commands/gsd/add-todo.md +42 -0
  21. package/commands/gsd/audit-milestone.md +42 -0
  22. package/commands/gsd/check-todos.md +41 -0
  23. package/commands/gsd/cleanup.md +18 -0
  24. package/commands/gsd/complete-milestone.md +136 -0
  25. package/commands/gsd/debug.md +162 -0
  26. package/commands/gsd/discuss-phase.md +87 -0
  27. package/commands/gsd/execute-phase.md +42 -0
  28. package/commands/gsd/health.md +22 -0
  29. package/commands/gsd/help.md +22 -0
  30. package/commands/gsd/insert-phase.md +33 -0
  31. package/commands/gsd/join-discord.md +18 -0
  32. package/commands/gsd/list-phase-assumptions.md +50 -0
  33. package/commands/gsd/map-codebase.md +71 -0
  34. package/commands/gsd/new-milestone.md +51 -0
  35. package/commands/gsd/new-project.md +42 -0
  36. package/commands/gsd/new-project.md.bak +1041 -0
  37. package/commands/gsd/pause-work.md +35 -0
  38. package/commands/gsd/plan-milestone-gaps.md +40 -0
  39. package/commands/gsd/plan-phase.md +44 -0
  40. package/commands/gsd/progress.md +24 -0
  41. package/commands/gsd/quick.md +40 -0
  42. package/commands/gsd/reapply-patches.md +110 -0
  43. package/commands/gsd/remove-phase.md +32 -0
  44. package/commands/gsd/research-phase.md +187 -0
  45. package/commands/gsd/resume-work.md +40 -0
  46. package/commands/gsd/set-profile.md +34 -0
  47. package/commands/gsd/settings.md +36 -0
  48. package/commands/gsd/update.md +37 -0
  49. package/commands/gsd/verify-work.md +39 -0
  50. package/dist/declare-tools.cjs +2962 -0
  51. package/package.json +45 -0
  52. package/scripts/build-hooks.js +42 -0
@@ -0,0 +1,1041 @@
1
+ ---
2
+ name: gsd:new-project
3
+ description: Initialize a new project with deep context gathering and PROJECT.md
4
+ allowed-tools:
5
+ - Read
6
+ - Bash
7
+ - Write
8
+ - Task
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ <objective>
13
+
14
+ Initialize a new project through unified flow: questioning → research (optional) → requirements → roadmap.
15
+
16
+ This is the most leveraged moment in any project. Deep questioning here means better plans, better execution, better outcomes. One command takes you from idea to ready-for-planning.
17
+
18
+ **Creates:**
19
+
20
+ - `.planning/PROJECT.md` — project context
21
+ - `.planning/config.json` — workflow preferences
22
+ - `.planning/research/` — domain research (optional)
23
+ - `.planning/REQUIREMENTS.md` — scoped requirements
24
+ - `.planning/ROADMAP.md` — phase structure
25
+ - `.planning/STATE.md` — project memory
26
+
27
+ **After this command:** Run `/gsd:plan-phase 1` to start execution.
28
+
29
+ </objective>
30
+
31
+ <execution_context>
32
+
33
+ @~/.claude/get-shit-done/references/questioning.md
34
+ @~/.claude/get-shit-done/references/ui-brand.md
35
+ @~/.claude/get-shit-done/templates/project.md
36
+ @~/.claude/get-shit-done/templates/requirements.md
37
+
38
+ </execution_context>
39
+
40
+ <process>
41
+
42
+ ## Phase 1: Setup
43
+
44
+ **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
45
+
46
+ 1. **Abort if project exists:**
47
+
48
+ ```bash
49
+ [ -f .planning/PROJECT.md ] && echo "ERROR: Project already initialized. Use /gsd:progress" && exit 1
50
+ ```
51
+
52
+ 2. **Initialize git repo in THIS directory** (required even if inside a parent repo):
53
+
54
+ ```bash
55
+ if [ -d .git ] || [ -f .git ]; then
56
+ echo "Git repo exists in current directory"
57
+ else
58
+ git init
59
+ echo "Initialized new git repo"
60
+ fi
61
+ ```
62
+
63
+ 3. **Detect existing code (brownfield detection):**
64
+
65
+ ```bash
66
+ 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)
67
+ HAS_PACKAGE=$([ -f package.json ] || [ -f requirements.txt ] || [ -f Cargo.toml ] || [ -f go.mod ] || [ -f Package.swift ] && echo "yes")
68
+ HAS_CODEBASE_MAP=$([ -d .planning/codebase ] && echo "yes")
69
+ ```
70
+
71
+ **You MUST run all bash commands above using the Bash tool before proceeding.**
72
+
73
+ ## Phase 2: Brownfield Offer
74
+
75
+ **If existing code detected and .planning/codebase/ doesn't exist:**
76
+
77
+ Check the results from setup step:
78
+
79
+ - If `CODE_FILES` is non-empty OR `HAS_PACKAGE` is "yes"
80
+ - AND `HAS_CODEBASE_MAP` is NOT "yes"
81
+
82
+ Use AskUserQuestion:
83
+
84
+ - header: "Existing Code"
85
+ - question: "I detected existing code in this directory. Would you like to map the codebase first?"
86
+ - options:
87
+ - "Map codebase first" — Run /gsd:map-codebase to understand existing architecture (Recommended)
88
+ - "Skip mapping" — Proceed with project initialization
89
+
90
+ **If "Map codebase first":**
91
+
92
+ ```
93
+ Run `/gsd:map-codebase` first, then return to `/gsd:new-project`
94
+ ```
95
+
96
+ Exit command.
97
+
98
+ **If "Skip mapping":** Continue to Phase 3.
99
+
100
+ **If no existing code detected OR codebase already mapped:** Continue to Phase 3.
101
+
102
+ ## Phase 3: Deep Questioning
103
+
104
+ **Display stage banner:**
105
+
106
+ ```
107
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
+ GSD ► QUESTIONING
109
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
110
+ ```
111
+
112
+ **Open the conversation:**
113
+
114
+ Ask inline (freeform, NOT AskUserQuestion):
115
+
116
+ "What do you want to build?"
117
+
118
+ Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
119
+
120
+ **Follow the thread:**
121
+
122
+ Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
123
+
124
+ Keep following threads. Each answer opens new threads to explore. Ask about:
125
+
126
+ - What excited them
127
+ - What problem sparked this
128
+ - What they mean by vague terms
129
+ - What it would actually look like
130
+ - What's already decided
131
+
132
+ Consult `questioning.md` for techniques:
133
+
134
+ - Challenge vagueness
135
+ - Make abstract concrete
136
+ - Surface assumptions
137
+ - Find edges
138
+ - Reveal motivation
139
+
140
+ **Check context (background, not out loud):**
141
+
142
+ As you go, mentally check the context checklist from `questioning.md`. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
143
+
144
+ **Decision gate:**
145
+
146
+ When you could write a clear PROJECT.md, use AskUserQuestion:
147
+
148
+ - header: "Ready?"
149
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
150
+ - options:
151
+ - "Create PROJECT.md" — Let's move forward
152
+ - "Keep exploring" — I want to share more / ask me more
153
+
154
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
155
+
156
+ Loop until "Create PROJECT.md" selected.
157
+
158
+ ## Phase 4: Write PROJECT.md
159
+
160
+ Synthesize all context into `.planning/PROJECT.md` using the template from `templates/project.md`.
161
+
162
+ **For greenfield projects:**
163
+
164
+ Initialize requirements as hypotheses:
165
+
166
+ ```markdown
167
+ ## Requirements
168
+
169
+ ### Validated
170
+
171
+ (None yet — ship to validate)
172
+
173
+ ### Active
174
+
175
+ - [ ] [Requirement 1]
176
+ - [ ] [Requirement 2]
177
+ - [ ] [Requirement 3]
178
+
179
+ ### Out of Scope
180
+
181
+ - [Exclusion 1] — [why]
182
+ - [Exclusion 2] — [why]
183
+ ```
184
+
185
+ All Active requirements are hypotheses until shipped and validated.
186
+
187
+ **For brownfield projects (codebase map exists):**
188
+
189
+ Infer Validated requirements from existing code:
190
+
191
+ 1. Read `.planning/codebase/ARCHITECTURE.md` and `STACK.md`
192
+ 2. Identify what the codebase already does
193
+ 3. These become the initial Validated set
194
+
195
+ ```markdown
196
+ ## Requirements
197
+
198
+ ### Validated
199
+
200
+ - ✓ [Existing capability 1] — existing
201
+ - ✓ [Existing capability 2] — existing
202
+ - ✓ [Existing capability 3] — existing
203
+
204
+ ### Active
205
+
206
+ - [ ] [New requirement 1]
207
+ - [ ] [New requirement 2]
208
+
209
+ ### Out of Scope
210
+
211
+ - [Exclusion 1] — [why]
212
+ ```
213
+
214
+ **Key Decisions:**
215
+
216
+ Initialize with any decisions made during questioning:
217
+
218
+ ```markdown
219
+ ## Key Decisions
220
+
221
+ | Decision | Rationale | Outcome |
222
+ | ------------------------- | --------- | --------- |
223
+ | [Choice from questioning] | [Why] | — Pending |
224
+ ```
225
+
226
+ **Last updated footer:**
227
+
228
+ ```markdown
229
+ ---
230
+
231
+ _Last updated: [date] after initialization_
232
+ ```
233
+
234
+ Do not compress. Capture everything gathered.
235
+
236
+ **Commit PROJECT.md:**
237
+
238
+ ```bash
239
+ mkdir -p .planning
240
+ git add .planning/PROJECT.md
241
+ git commit -m "$(cat <<'EOF'
242
+ docs: initialize project
243
+
244
+ [One-liner from PROJECT.md What This Is section]
245
+ EOF
246
+ )"
247
+ ```
248
+
249
+ ## Phase 5: Workflow Preferences
250
+
251
+ **Round 1 — Core workflow settings (4 questions):**
252
+
253
+ ```
254
+ questions: [
255
+ {
256
+ header: "Mode",
257
+ question: "How do you want to work?",
258
+ multiSelect: false,
259
+ options: [
260
+ { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
261
+ { label: "Interactive", description: "Confirm at each step" }
262
+ ]
263
+ },
264
+ {
265
+ header: "Depth",
266
+ question: "How thorough should planning be?",
267
+ multiSelect: false,
268
+ options: [
269
+ { label: "Quick", description: "Ship fast (3-5 phases, 1-3 plans each)" },
270
+ { label: "Standard", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
271
+ { label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
272
+ ]
273
+ },
274
+ {
275
+ header: "Execution",
276
+ question: "Run plans in parallel?",
277
+ multiSelect: false,
278
+ options: [
279
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
280
+ { label: "Sequential", description: "One plan at a time" }
281
+ ]
282
+ },
283
+ {
284
+ header: "Git Tracking",
285
+ question: "Commit planning docs to git?",
286
+ multiSelect: false,
287
+ options: [
288
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
289
+ { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
290
+ ]
291
+ }
292
+ ]
293
+ ```
294
+
295
+ **Round 2 — Workflow agents:**
296
+
297
+ These spawn additional agents during planning/execution. They add tokens and time but improve quality.
298
+
299
+ | Agent | When it runs | What it does |
300
+ | ---------------- | -------------------------- | ----------------------------------------------------- |
301
+ | **Researcher** | Before planning each phase | Investigates domain, finds patterns, surfaces gotchas |
302
+ | **Plan Checker** | After plan is created | Verifies plan actually achieves the phase goal |
303
+ | **Verifier** | After phase execution | Confirms must-haves were delivered |
304
+
305
+ All recommended for important projects. Skip for quick experiments.
306
+
307
+ ```
308
+ questions: [
309
+ {
310
+ header: "Research",
311
+ question: "Research before planning each phase? (adds tokens/time)",
312
+ multiSelect: false,
313
+ options: [
314
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
315
+ { label: "No", description: "Plan directly from requirements" }
316
+ ]
317
+ },
318
+ {
319
+ header: "Plan Check",
320
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
321
+ multiSelect: false,
322
+ options: [
323
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
324
+ { label: "No", description: "Execute plans without verification" }
325
+ ]
326
+ },
327
+ {
328
+ header: "Verifier",
329
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
330
+ multiSelect: false,
331
+ options: [
332
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
333
+ { label: "No", description: "Trust execution, skip verification" }
334
+ ]
335
+ },
336
+ {
337
+ header: "Model Profile",
338
+ question: "Which AI models for planning agents?",
339
+ multiSelect: false,
340
+ options: [
341
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
342
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
343
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
344
+ ]
345
+ }
346
+ ]
347
+ ```
348
+
349
+ Create `.planning/config.json` with all settings:
350
+
351
+ ```json
352
+ {
353
+ "mode": "yolo|interactive",
354
+ "depth": "quick|standard|comprehensive",
355
+ "parallelization": true|false,
356
+ "commit_docs": true|false,
357
+ "model_profile": "quality|balanced|budget",
358
+ "workflow": {
359
+ "research": true|false,
360
+ "plan_check": true|false,
361
+ "verifier": true|false
362
+ }
363
+ }
364
+ ```
365
+
366
+ **If commit_docs = No:**
367
+
368
+ - Set `commit_docs: false` in config.json
369
+ - Add `.planning/` to `.gitignore` (create if needed)
370
+
371
+ **If commit_docs = Yes:**
372
+
373
+ - No additional gitignore entries needed
374
+
375
+ **Commit config.json:**
376
+
377
+ ```bash
378
+ git add .planning/config.json
379
+ git commit -m "$(cat <<'EOF'
380
+ chore: add project config
381
+
382
+ Mode: [chosen mode]
383
+ Depth: [chosen depth]
384
+ Parallelization: [enabled/disabled]
385
+ Workflow agents: research=[on/off], plan_check=[on/off], verifier=[on/off]
386
+ EOF
387
+ )"
388
+ ```
389
+
390
+ **Note:** Run `/gsd:settings` anytime to update these preferences.
391
+
392
+ ## Phase 5.5: Resolve Model Profile
393
+
394
+ Read model profile for agent spawning:
395
+
396
+ ```bash
397
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
398
+ ```
399
+
400
+ Default to "balanced" if not set.
401
+
402
+ **Model lookup table:**
403
+
404
+ | Agent | quality | balanced | budget |
405
+ | ------------------------ | ------- | -------- | ------ |
406
+ | gsd-project-researcher | opus | sonnet | haiku |
407
+ | gsd-research-synthesizer | sonnet | sonnet | haiku |
408
+ | gsd-roadmapper | opus | sonnet | sonnet |
409
+
410
+ Store resolved models for use in Task calls below.
411
+
412
+ ## Phase 6: Research Decision
413
+
414
+ Use AskUserQuestion:
415
+
416
+ - header: "Research"
417
+ - question: "Research the domain ecosystem before defining requirements?"
418
+ - options:
419
+ - "Research first (Recommended)" — Discover standard stacks, expected features, architecture patterns
420
+ - "Skip research" — I know this domain well, go straight to requirements
421
+
422
+ **If "Research first":**
423
+
424
+ Display stage banner:
425
+
426
+ ```
427
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
428
+ GSD ► RESEARCHING
429
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
430
+
431
+ Researching [domain] ecosystem...
432
+ ```
433
+
434
+ Create research directory:
435
+
436
+ ```bash
437
+ mkdir -p .planning/research
438
+ ```
439
+
440
+ **Determine milestone context:**
441
+
442
+ Check if this is greenfield or subsequent milestone:
443
+
444
+ - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
445
+ - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
446
+
447
+ Display spawning indicator:
448
+
449
+ ```
450
+ ◆ Spawning 4 researchers in parallel...
451
+ → Stack research
452
+ → Features research
453
+ → Architecture research
454
+ → Pitfalls research
455
+ ```
456
+
457
+ Spawn 4 parallel gsd-project-researcher agents with rich context:
458
+
459
+ ```
460
+ Task(prompt="First, read ~/.claude/agents/gsd-project-researcher.md for your role and instructions.
461
+
462
+ <research_type>
463
+ Project Research — Stack dimension for [domain].
464
+ </research_type>
465
+
466
+ <milestone_context>
467
+ [greenfield OR subsequent]
468
+
469
+ Greenfield: Research the standard stack for building [domain] from scratch.
470
+ Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system.
471
+ </milestone_context>
472
+
473
+ <question>
474
+ What's the standard 2025 stack for [domain]?
475
+ </question>
476
+
477
+ <project_context>
478
+ [PROJECT.md summary - core value, constraints, what they're building]
479
+ </project_context>
480
+
481
+ <downstream_consumer>
482
+ Your STACK.md feeds into roadmap creation. Be prescriptive:
483
+ - Specific libraries with versions
484
+ - Clear rationale for each choice
485
+ - What NOT to use and why
486
+ </downstream_consumer>
487
+
488
+ <quality_gate>
489
+ - [ ] Versions are current (verify with Context7/official docs, not training data)
490
+ - [ ] Rationale explains WHY, not just WHAT
491
+ - [ ] Confidence levels assigned to each recommendation
492
+ </quality_gate>
493
+
494
+ <output>
495
+ Write to: .planning/research/STACK.md
496
+ Use template: ~/.claude/get-shit-done/templates/research-project/STACK.md
497
+ </output>
498
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Stack research")
499
+
500
+ Task(prompt="First, read ~/.claude/agents/gsd-project-researcher.md for your role and instructions.
501
+
502
+ <research_type>
503
+ Project Research — Features dimension for [domain].
504
+ </research_type>
505
+
506
+ <milestone_context>
507
+ [greenfield OR subsequent]
508
+
509
+ Greenfield: What features do [domain] products have? What's table stakes vs differentiating?
510
+ Subsequent: How do [target features] typically work? What's expected behavior?
511
+ </milestone_context>
512
+
513
+ <question>
514
+ What features do [domain] products have? What's table stakes vs differentiating?
515
+ </question>
516
+
517
+ <project_context>
518
+ [PROJECT.md summary]
519
+ </project_context>
520
+
521
+ <downstream_consumer>
522
+ Your FEATURES.md feeds into requirements definition. Categorize clearly:
523
+ - Table stakes (must have or users leave)
524
+ - Differentiators (competitive advantage)
525
+ - Anti-features (things to deliberately NOT build)
526
+ </downstream_consumer>
527
+
528
+ <quality_gate>
529
+ - [ ] Categories are clear (table stakes vs differentiators vs anti-features)
530
+ - [ ] Complexity noted for each feature
531
+ - [ ] Dependencies between features identified
532
+ </quality_gate>
533
+
534
+ <output>
535
+ Write to: .planning/research/FEATURES.md
536
+ Use template: ~/.claude/get-shit-done/templates/research-project/FEATURES.md
537
+ </output>
538
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Features research")
539
+
540
+ Task(prompt="First, read ~/.claude/agents/gsd-project-researcher.md for your role and instructions.
541
+
542
+ <research_type>
543
+ Project Research — Architecture dimension for [domain].
544
+ </research_type>
545
+
546
+ <milestone_context>
547
+ [greenfield OR subsequent]
548
+
549
+ Greenfield: How are [domain] systems typically structured? What are major components?
550
+ Subsequent: How do [target features] integrate with existing [domain] architecture?
551
+ </milestone_context>
552
+
553
+ <question>
554
+ How are [domain] systems typically structured? What are major components?
555
+ </question>
556
+
557
+ <project_context>
558
+ [PROJECT.md summary]
559
+ </project_context>
560
+
561
+ <downstream_consumer>
562
+ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
563
+ - Component boundaries (what talks to what)
564
+ - Data flow (how information moves)
565
+ - Suggested build order (dependencies between components)
566
+ </downstream_consumer>
567
+
568
+ <quality_gate>
569
+ - [ ] Components clearly defined with boundaries
570
+ - [ ] Data flow direction explicit
571
+ - [ ] Build order implications noted
572
+ </quality_gate>
573
+
574
+ <output>
575
+ Write to: .planning/research/ARCHITECTURE.md
576
+ Use template: ~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md
577
+ </output>
578
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Architecture research")
579
+
580
+ Task(prompt="First, read ~/.claude/agents/gsd-project-researcher.md for your role and instructions.
581
+
582
+ <research_type>
583
+ Project Research — Pitfalls dimension for [domain].
584
+ </research_type>
585
+
586
+ <milestone_context>
587
+ [greenfield OR subsequent]
588
+
589
+ Greenfield: What do [domain] projects commonly get wrong? Critical mistakes?
590
+ Subsequent: What are common mistakes when adding [target features] to [domain]?
591
+ </milestone_context>
592
+
593
+ <question>
594
+ What do [domain] projects commonly get wrong? Critical mistakes?
595
+ </question>
596
+
597
+ <project_context>
598
+ [PROJECT.md summary]
599
+ </project_context>
600
+
601
+ <downstream_consumer>
602
+ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
603
+ - Warning signs (how to detect early)
604
+ - Prevention strategy (how to avoid)
605
+ - Which phase should address it
606
+ </downstream_consumer>
607
+
608
+ <quality_gate>
609
+ - [ ] Pitfalls are specific to this domain (not generic advice)
610
+ - [ ] Prevention strategies are actionable
611
+ - [ ] Phase mapping included where relevant
612
+ </quality_gate>
613
+
614
+ <output>
615
+ Write to: .planning/research/PITFALLS.md
616
+ Use template: ~/.claude/get-shit-done/templates/research-project/PITFALLS.md
617
+ </output>
618
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Pitfalls research")
619
+ ```
620
+
621
+ After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
622
+
623
+ ```
624
+ Task(prompt="
625
+ <task>
626
+ Synthesize research outputs into SUMMARY.md.
627
+ </task>
628
+
629
+ <research_files>
630
+ Read these files:
631
+ - .planning/research/STACK.md
632
+ - .planning/research/FEATURES.md
633
+ - .planning/research/ARCHITECTURE.md
634
+ - .planning/research/PITFALLS.md
635
+ </research_files>
636
+
637
+ <output>
638
+ Write to: .planning/research/SUMMARY.md
639
+ Use template: ~/.claude/get-shit-done/templates/research-project/SUMMARY.md
640
+ Commit after writing.
641
+ </output>
642
+ ", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
643
+ ```
644
+
645
+ Display research complete banner and key findings:
646
+
647
+ ```
648
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
649
+ GSD ► RESEARCH COMPLETE ✓
650
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
651
+
652
+ ## Key Findings
653
+
654
+ **Stack:** [from SUMMARY.md]
655
+ **Table Stakes:** [from SUMMARY.md]
656
+ **Watch Out For:** [from SUMMARY.md]
657
+
658
+ Files: `.planning/research/`
659
+ ```
660
+
661
+ **If "Skip research":** Continue to Phase 7.
662
+
663
+ ## Phase 7: Define Requirements
664
+
665
+ Display stage banner:
666
+
667
+ ```
668
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
669
+ GSD ► DEFINING REQUIREMENTS
670
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
671
+ ```
672
+
673
+ **Load context:**
674
+
675
+ Read PROJECT.md and extract:
676
+
677
+ - Core value (the ONE thing that must work)
678
+ - Stated constraints (budget, timeline, tech limitations)
679
+ - Any explicit scope boundaries
680
+
681
+ **If research exists:** Read research/FEATURES.md and extract feature categories.
682
+
683
+ **Present features by category:**
684
+
685
+ ```
686
+ Here are the features for [domain]:
687
+
688
+ ## Authentication
689
+ **Table stakes:**
690
+ - Sign up with email/password
691
+ - Email verification
692
+ - Password reset
693
+ - Session management
694
+
695
+ **Differentiators:**
696
+ - Magic link login
697
+ - OAuth (Google, GitHub)
698
+ - 2FA
699
+
700
+ **Research notes:** [any relevant notes]
701
+
702
+ ---
703
+
704
+ ## [Next Category]
705
+ ...
706
+ ```
707
+
708
+ **If no research:** Gather requirements through conversation instead.
709
+
710
+ Ask: "What are the main things users need to be able to do?"
711
+
712
+ For each capability mentioned:
713
+
714
+ - Ask clarifying questions to make it specific
715
+ - Probe for related capabilities
716
+ - Group into categories
717
+
718
+ **Scope each category:**
719
+
720
+ For each category, use AskUserQuestion:
721
+
722
+ - header: "[Category name]"
723
+ - question: "Which [category] features are in v1?"
724
+ - multiSelect: true
725
+ - options:
726
+ - "[Feature 1]" — [brief description]
727
+ - "[Feature 2]" — [brief description]
728
+ - "[Feature 3]" — [brief description]
729
+ - "None for v1" — Defer entire category
730
+
731
+ Track responses:
732
+
733
+ - Selected features → v1 requirements
734
+ - Unselected table stakes → v2 (users expect these)
735
+ - Unselected differentiators → out of scope
736
+
737
+ **Identify gaps:**
738
+
739
+ Use AskUserQuestion:
740
+
741
+ - header: "Additions"
742
+ - question: "Any requirements research missed? (Features specific to your vision)"
743
+ - options:
744
+ - "No, research covered it" — Proceed
745
+ - "Yes, let me add some" — Capture additions
746
+
747
+ **Validate core value:**
748
+
749
+ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
750
+
751
+ **Generate REQUIREMENTS.md:**
752
+
753
+ Create `.planning/REQUIREMENTS.md` with:
754
+
755
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
756
+ - v2 Requirements (deferred)
757
+ - Out of Scope (explicit exclusions with reasoning)
758
+ - Traceability section (empty, filled by roadmap)
759
+
760
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
761
+
762
+ **Requirement quality criteria:**
763
+
764
+ Good requirements are:
765
+
766
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
767
+ - **User-centric:** "User can X" (not "System does Y")
768
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
769
+ - **Independent:** Minimal dependencies on other requirements
770
+
771
+ Reject vague requirements. Push for specificity:
772
+
773
+ - "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
774
+ - "Support sharing" → "User can share post via link that opens in recipient's browser"
775
+
776
+ **Present full requirements list:**
777
+
778
+ Show every requirement (not counts) for user confirmation:
779
+
780
+ ```
781
+ ## v1 Requirements
782
+
783
+ ### Authentication
784
+ - [ ] **AUTH-01**: User can create account with email/password
785
+ - [ ] **AUTH-02**: User can log in and stay logged in across sessions
786
+ - [ ] **AUTH-03**: User can log out from any page
787
+
788
+ ### Content
789
+ - [ ] **CONT-01**: User can create posts with text
790
+ - [ ] **CONT-02**: User can edit their own posts
791
+
792
+ [... full list ...]
793
+
794
+ ---
795
+
796
+ Does this capture what you're building? (yes / adjust)
797
+ ```
798
+
799
+ If "adjust": Return to scoping.
800
+
801
+ **Commit requirements:**
802
+
803
+ ```bash
804
+ git add .planning/REQUIREMENTS.md
805
+ git commit -m "$(cat <<'EOF'
806
+ docs: define v1 requirements
807
+
808
+ [X] requirements across [N] categories
809
+ [Y] requirements deferred to v2
810
+ EOF
811
+ )"
812
+ ```
813
+
814
+ ## Phase 8: Create Roadmap
815
+
816
+ Display stage banner:
817
+
818
+ ```
819
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
820
+ GSD ► CREATING ROADMAP
821
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
822
+
823
+ ◆ Spawning roadmapper...
824
+ ```
825
+
826
+ Spawn gsd-roadmapper agent with context:
827
+
828
+ ```
829
+ Task(prompt="
830
+ <planning_context>
831
+
832
+ **Project:**
833
+ @.planning/PROJECT.md
834
+
835
+ **Requirements:**
836
+ @.planning/REQUIREMENTS.md
837
+
838
+ **Research (if exists):**
839
+ @.planning/research/SUMMARY.md
840
+
841
+ **Config:**
842
+ @.planning/config.json
843
+
844
+ </planning_context>
845
+
846
+ <instructions>
847
+ Create roadmap:
848
+ 1. Derive phases from requirements (don't impose structure)
849
+ 2. Map every v1 requirement to exactly one phase
850
+ 3. Derive 2-5 success criteria per phase (observable user behaviors)
851
+ 4. Validate 100% coverage
852
+ 5. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
853
+ 6. Return ROADMAP CREATED with summary
854
+
855
+ Write files first, then return. This ensures artifacts persist even if context is lost.
856
+ </instructions>
857
+ ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap")
858
+ ```
859
+
860
+ **Handle roadmapper return:**
861
+
862
+ **If `## ROADMAP BLOCKED`:**
863
+
864
+ - Present blocker information
865
+ - Work with user to resolve
866
+ - Re-spawn when resolved
867
+
868
+ **If `## ROADMAP CREATED`:**
869
+
870
+ Read the created ROADMAP.md and present it nicely inline:
871
+
872
+ ```
873
+ ---
874
+
875
+ ## Proposed Roadmap
876
+
877
+ **[N] phases** | **[X] requirements mapped** | All v1 requirements covered ✓
878
+
879
+ | # | Phase | Goal | Requirements | Success Criteria |
880
+ |---|-------|------|--------------|------------------|
881
+ | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
882
+ | 2 | [Name] | [Goal] | [REQ-IDs] | [count] |
883
+ | 3 | [Name] | [Goal] | [REQ-IDs] | [count] |
884
+ ...
885
+
886
+ ### Phase Details
887
+
888
+ **Phase 1: [Name]**
889
+ Goal: [goal]
890
+ Requirements: [REQ-IDs]
891
+ Success criteria:
892
+ 1. [criterion]
893
+ 2. [criterion]
894
+ 3. [criterion]
895
+
896
+ **Phase 2: [Name]**
897
+ Goal: [goal]
898
+ Requirements: [REQ-IDs]
899
+ Success criteria:
900
+ 1. [criterion]
901
+ 2. [criterion]
902
+
903
+ [... continue for all phases ...]
904
+
905
+ ---
906
+ ```
907
+
908
+ **CRITICAL: Ask for approval before committing:**
909
+
910
+ Use AskUserQuestion:
911
+
912
+ - header: "Roadmap"
913
+ - question: "Does this roadmap structure work for you?"
914
+ - options:
915
+ - "Approve" — Commit and continue
916
+ - "Adjust phases" — Tell me what to change
917
+ - "Review full file" — Show raw ROADMAP.md
918
+
919
+ **If "Approve":** Continue to commit.
920
+
921
+ **If "Adjust phases":**
922
+
923
+ - Get user's adjustment notes
924
+ - Re-spawn roadmapper with revision context:
925
+
926
+ ```
927
+ Task(prompt="
928
+ <revision>
929
+ User feedback on roadmap:
930
+ [user's notes]
931
+
932
+ Current ROADMAP.md: @.planning/ROADMAP.md
933
+
934
+ Update the roadmap based on feedback. Edit files in place.
935
+ Return ROADMAP REVISED with changes made.
936
+ </revision>
937
+ ", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
938
+ ```
939
+
940
+ - Present revised roadmap
941
+ - Loop until user approves
942
+
943
+ **If "Review full file":** Display raw `cat .planning/ROADMAP.md`, then re-ask.
944
+
945
+ **Commit roadmap (after approval):**
946
+
947
+ ```bash
948
+ git add .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md
949
+ git commit -m "$(cat <<'EOF'
950
+ docs: create roadmap ([N] phases)
951
+
952
+ Phases:
953
+ 1. [phase-name]: [requirements covered]
954
+ 2. [phase-name]: [requirements covered]
955
+ ...
956
+
957
+ All v1 requirements mapped to phases.
958
+ EOF
959
+ )"
960
+ ```
961
+
962
+ ## Phase 10: Done
963
+
964
+ Present completion with next steps:
965
+
966
+ ```
967
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
968
+ GSD ► PROJECT INITIALIZED ✓
969
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
970
+
971
+ **[Project Name]**
972
+
973
+ | Artifact | Location |
974
+ |----------------|-----------------------------|
975
+ | Project | `.planning/PROJECT.md` |
976
+ | Config | `.planning/config.json` |
977
+ | Research | `.planning/research/` |
978
+ | Requirements | `.planning/REQUIREMENTS.md` |
979
+ | Roadmap | `.planning/ROADMAP.md` |
980
+
981
+ **[N] phases** | **[X] requirements** | Ready to build ✓
982
+
983
+ ───────────────────────────────────────────────────────────────
984
+
985
+ ## ▶ Next Up
986
+
987
+ **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
988
+
989
+ /gsd:discuss-phase 1 — gather context and clarify approach
990
+
991
+ <sub>/clear first → fresh context window</sub>
992
+
993
+ ---
994
+
995
+ **Also available:**
996
+ - /gsd:plan-phase 1 — skip discussion, plan directly
997
+
998
+ ───────────────────────────────────────────────────────────────
999
+ ```
1000
+
1001
+ </process>
1002
+
1003
+ <output>
1004
+
1005
+ - `.planning/PROJECT.md`
1006
+ - `.planning/config.json`
1007
+ - `.planning/research/` (if research selected)
1008
+ - `STACK.md`
1009
+ - `FEATURES.md`
1010
+ - `ARCHITECTURE.md`
1011
+ - `PITFALLS.md`
1012
+ - `SUMMARY.md`
1013
+ - `.planning/REQUIREMENTS.md`
1014
+ - `.planning/ROADMAP.md`
1015
+ - `.planning/STATE.md`
1016
+
1017
+ </output>
1018
+
1019
+ <success_criteria>
1020
+
1021
+ - [ ] .planning/ directory created
1022
+ - [ ] Git repo initialized
1023
+ - [ ] Brownfield detection completed
1024
+ - [ ] Deep questioning completed (threads followed, not rushed)
1025
+ - [ ] PROJECT.md captures full context → **committed**
1026
+ - [ ] config.json has workflow mode, depth, parallelization → **committed**
1027
+ - [ ] Research completed (if selected) — 4 parallel agents spawned → **committed**
1028
+ - [ ] Requirements gathered (from research or conversation)
1029
+ - [ ] User scoped each category (v1/v2/out of scope)
1030
+ - [ ] REQUIREMENTS.md created with REQ-IDs → **committed**
1031
+ - [ ] gsd-roadmapper spawned with context
1032
+ - [ ] Roadmap files written immediately (not draft)
1033
+ - [ ] User feedback incorporated (if any)
1034
+ - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
1035
+ - [ ] STATE.md initialized
1036
+ - [ ] REQUIREMENTS.md traceability updated
1037
+ - [ ] User knows next step is `/gsd:discuss-phase 1`
1038
+
1039
+ **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
1040
+
1041
+ </success_criteria>