How it works:
- Analyze the phase to identify gray areas (UI, UX, behavior, etc.)
- Present gray areas — user selects which to discuss
- Deep-dive each selected area until satisfied
- Create CONTEXT.md with decisions that guide research and planning
Output: {phase}-CONTEXT.md — decisions clear enough that downstream agents can act without asking the user again
Load project state:
@.planning/STATE.md
Load roadmap:
@.planning/ROADMAP.md
- Check if phase argument provided
- Parse phase number (handle both integer and decimal: "5", "5.1")
- Load ROADMAP.md
- Search for phase in roadmap phases list
- If not found: display error with available phases, exit
- Extract phase goal and description
- Find phase directory: .planning/phases/{phase}-*/
- Look for {phase}-*-CONTEXT.md files
- If exists:
- Display current content
- Offer: "Update / View only / Skip"
- If Update: proceed with discussion
- If View: display full file and exit
- If Skip: exit
- If doesn't exist: proceed to analysis
Domain-aware analysis:
Gray areas depend on what's being built. Based on phase goal, identify:
- Something users SEE → layout, density, interactions, states, visual hierarchy
- Something users CALL → responses, errors, auth, versioning, rate limiting
- Something users RUN → output format, flags, modes, error handling
- Something users READ → structure, tone, depth, flow
- Something being ORGANIZED → criteria, grouping, naming, exceptions
Generate 3-4 phase-specific gray areas, not generic categories.
Examples:
- Phase: "Build task dashboard" → Gray areas: "Task grouping", "Urgency indicators", "Empty states", "Interaction feedback"
- Phase: "Add authentication" → Gray areas: "Session duration", "Password requirements", "2FA approach", "Error messaging"
- Phase: "Create reports" → Gray areas: "Report formatting", "Date range defaults", "Export formats", "Performance data depth"
Critical: Scope guardrail
- Phase boundary from ROADMAP.md is FIXED
- Discussion clarifies HOW to implement, not WHETHER to add more
- If user suggests new capabilities: "That's its own phase. I'll note it for later."
- Capture deferred ideas in separate section — don't lose them, don't act on them
- List all generated gray areas (3-4)
- For each: brief description of what decisions need to be made
- Ask: "Which areas do you want to discuss? (select 1 or more)"
- NO skip/none option — at least one area must be discussed
- User can select multiple or all
- Record selected areas for deep-dive
Probing approach:
- Start with 4 context-specific questions for the area
- Listen to responses, ask follow-up based on answers
- After 4 questions: "More questions about [area], or move to next?"
- If more: ask 4 more, check again
- If next: move to next selected area
- After all areas: "Ready to create context?"
Question quality:
- Ask about SPECIFIC implementation choices, not general preferences
- Focus on user-observable behavior, not technical internals
- Avoid "how should we..." — instead "what do you expect when..."
- Dig into edge cases: "What if X happens? What should user see?"
Do NOT ask about (Claude handles these):
- Technical implementation details
- Architecture choices (libraries, patterns)
- Performance optimization strategies
- Testing approaches
- Scope expansion beyond phase boundary
Use template from templates/context.md as base structure.
Sections to populate:
Essential Features
- Must-have features user specified
- Core functionality that defines phase completion
- User-observable outcomes that MUST exist
Technical Boundaries
- Locked decisions: libraries, patterns, architecture
- Constraints from discussion (e.g., "must use JWT", "no external APIs")
- Technology choices user specified
Scope Limits
- Explicitly out of scope items
- Features deferred to future phases
- Boundaries user confirmed
Open Questions
- Things to investigate during research
- Unclear areas that need research findings
- Technical unknowns that research should answer
Synthesis rules:
- Write in clear, actionable language
- Use bullet points, not paragraphs
- Be specific: "Use JWT with 1-hour expiration" not "Handle authentication"
- Capture decisions, not discussion history
- Each item should guide downstream agents without additional user input
Frontmatter:
---
phase: {phase}
discussed: {ISO timestamp}
areas: [{list of discussed areas}]
decisions_count: {number of decisions captured}
---
Body: Use synthesized sections from previous step
File naming:
- Find next available number: {phase}-{NN}-CONTEXT.md
- Typically: {phase}-01-CONTEXT.md (first artifact in phase)
- If multiple discussions: increment number
Example path:
.planning/phases/05-authentication/05-01-CONTEXT.md
git add .planning/phases/{phase}-*/{phase}-*-CONTEXT.md
git commit -m "docs(${phase}): capture context from discussion
Areas discussed: {list areas}
Decisions captured: {count}
"
If phase has no RESEARCH.md:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CONTEXT CAPTURED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Discussed: {areas}
Decisions: {count} captured in CONTEXT.md
───────────────────────────────────────────────────────────────
## ▶ Next Up
**Research phase** — investigate open questions and validate approach
/gsd-research-phase {phase}
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
**Also available:**
- /gsd-plan-phase {phase} — skip research, plan directly (if confident)
───────────────────────────────────────────────────────────────
If phase already has RESEARCH.md:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CONTEXT UPDATED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Updated decisions based on discussion.
Research may need refresh if decisions changed significantly.
───────────────────────────────────────────────────────────────
## ▶ Next Up
**Plan phase** — create execution plans with updated context
/gsd-plan-phase {phase}
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
**Also available:**
- /gsd-research-phase {phase} --refresh — re-research with new context
- cat .planning/phases/{phase_dir}/*-CONTEXT.md — review decisions
───────────────────────────────────────────────────────────────
1---2name: gsd-discuss-phase3description: Gather phase context through adaptive questioning before planning4---5
6
7<objective>
8Extract implementation decisions that downstream agents need — researcher and planner will use CONTEXT.md to know what to investigate and what choices are locked.
9
10**How it works:**
111. Analyze the phase to identify gray areas (UI, UX, behavior, etc.)
122. Present gray areas — user selects which to discuss
133. Deep-dive each selected area until satisfied
144. Create CONTEXT.md with decisions that guide research and planning
15
16**Output:** `{phase}-CONTEXT.md` — decisions clear enough that downstream agents can act without asking the user again
17</objective>
18
19<execution_context>
20@.github/get-shit-done/workflows/discuss-phase.md
21@.github/get-shit-done/templates/context.md
22</execution_context>
23
24<context>
25Phase number: $ARGUMENTS (required)
26
27**Load project state:**
28@.planning/STATE.md
29
30**Load roadmap:**
31@.planning/ROADMAP.md
32</context>
33
34<process>
35<step name="validate_phase">
36Validate phase number (error if missing or not in roadmap).
37
381. Check if phase argument provided
392. Parse phase number (handle both integer and decimal: "5", "5.1")
403. Load ROADMAP.md
414. Search for phase in roadmap phases list
425. If not found: display error with available phases, exit
436. Extract phase goal and description
44</step>
45
46<step name="check_existing_context">
47Check if CONTEXT.md already exists for this phase.
48
491. Find phase directory: .planning/phases/{phase}-*/
502. Look for {phase}-*-CONTEXT.md files
513. If exists:
52 - Display current content
53 - Offer: "Update / View only / Skip"
54 - If Update: proceed with discussion
55 - If View: display full file and exit
56 - If Skip: exit
574. If doesn't exist: proceed to analysis
58</step>
59
60<step name="analyze_phase">
61Analyze phase goal to identify domain-specific gray areas.
62
63**Domain-aware analysis:**
64Gray areas depend on what's being built. Based on phase goal, identify:
65
66- Something users SEE → layout, density, interactions, states, visual hierarchy
67- Something users CALL → responses, errors, auth, versioning, rate limiting
68- Something users RUN → output format, flags, modes, error handling
69- Something users READ → structure, tone, depth, flow
70- Something being ORGANIZED → criteria, grouping, naming, exceptions
71
72Generate 3-4 **phase-specific** gray areas, not generic categories.
73
74**Examples:**
75- Phase: "Build task dashboard" → Gray areas: "Task grouping", "Urgency indicators", "Empty states", "Interaction feedback"
76- Phase: "Add authentication" → Gray areas: "Session duration", "Password requirements", "2FA approach", "Error messaging"
77- Phase: "Create reports" → Gray areas: "Report formatting", "Date range defaults", "Export formats", "Performance data depth"
78
79**Critical: Scope guardrail**
80- Phase boundary from ROADMAP.md is FIXED
81- Discussion clarifies HOW to implement, not WHETHER to add more
82- If user suggests new capabilities: "That's its own phase. I'll note it for later."
83- Capture deferred ideas in separate section — don't lose them, don't act on them
84</step>
85
86<step name="present_gray_areas">
87Present identified gray areas to user for selection.
88
891. List all generated gray areas (3-4)
902. For each: brief description of what decisions need to be made
913. Ask: "Which areas do you want to discuss? (select 1 or more)"
924. NO skip/none option — at least one area must be discussed
935. User can select multiple or all
946. Record selected areas for deep-dive
95</step>
96
97<step name="deep_dive_areas">
98For each selected area, conduct adaptive questioning.
99
100**Probing approach:**
1011. Start with 4 context-specific questions for the area
1022. Listen to responses, ask follow-up based on answers
1033. After 4 questions: "More questions about [area], or move to next?"
1044. If more: ask 4 more, check again
1055. If next: move to next selected area
1066. After all areas: "Ready to create context?"
107
108**Question quality:**
109- Ask about SPECIFIC implementation choices, not general preferences
110- Focus on user-observable behavior, not technical internals
111- Avoid "how should we..." — instead "what do you expect when..."
112- Dig into edge cases: "What if X happens? What should user see?"
113
114**Do NOT ask about (Claude handles these):**
115- Technical implementation details
116- Architecture choices (libraries, patterns)
117- Performance optimization strategies
118- Testing approaches
119- Scope expansion beyond phase boundary
120</step>
121
122<step name="synthesize_context">
123Synthesize discussion into CONTEXT.md structure.
124
125Use template from templates/context.md as base structure.
126
127**Sections to populate:**
128
1291. **Essential Features**
130 - Must-have features user specified
131 - Core functionality that defines phase completion
132 - User-observable outcomes that MUST exist
133
1342. **Technical Boundaries**
135 - Locked decisions: libraries, patterns, architecture
136 - Constraints from discussion (e.g., "must use JWT", "no external APIs")
137 - Technology choices user specified
138
1393. **Scope Limits**
140 - Explicitly out of scope items
141 - Features deferred to future phases
142 - Boundaries user confirmed
143
1444. **Open Questions**
145 - Things to investigate during research
146 - Unclear areas that need research findings
147 - Technical unknowns that research should answer
148
149**Synthesis rules:**
150- Write in clear, actionable language
151- Use bullet points, not paragraphs
152- Be specific: "Use JWT with 1-hour expiration" not "Handle authentication"
153- Capture decisions, not discussion history
154- Each item should guide downstream agents without additional user input
155</step>
156
157<step name="write_context_file">
158Create .planning/phases/{phase}-*/{phase}-*-CONTEXT.md
159
160**Frontmatter:**
161```yaml
162---
163phase: {phase}
164discussed: {ISO timestamp}
165areas: [{list of discussed areas}]
166decisions_count: {number of decisions captured}
167---
168```
169
170**Body:** Use synthesized sections from previous step
171
172**File naming:**
173- Find next available number: {phase}-{NN}-CONTEXT.md
174- Typically: {phase}-01-CONTEXT.md (first artifact in phase)
175- If multiple discussions: increment number
176
177**Example path:**
178`.planning/phases/05-authentication/05-01-CONTEXT.md`
179</step>
180
181<step name="commit">
182Commit the CONTEXT.md file.
183
184```bash
185git add .planning/phases/{phase}-*/{phase}-*-CONTEXT.md
186git commit -m "docs(${phase}): capture context from discussion
187
188Areas discussed: {list areas}
189Decisions captured: {count}
190"
191```
192</step>
193
194<step name="offer_next">
195Present next steps based on phase state.
196
197**If phase has no RESEARCH.md:**
198```
199━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
200 CONTEXT CAPTURED
201━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
202
203Discussed: {areas}
204Decisions: {count} captured in CONTEXT.md
205
206───────────────────────────────────────────────────────────────
207
208## ▶ Next Up
209
210**Research phase** — investigate open questions and validate approach
211
212/gsd-research-phase {phase}
213
214<sub>/clear first → fresh context window</sub>
215
216───────────────────────────────────────────────────────────────
217
218**Also available:**
219- /gsd-plan-phase {phase} — skip research, plan directly (if confident)
220
221───────────────────────────────────────────────────────────────
222```
223
224**If phase already has RESEARCH.md:**
225```
226━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
227 CONTEXT UPDATED
228━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
229
230Updated decisions based on discussion.
231Research may need refresh if decisions changed significantly.
232
233───────────────────────────────────────────────────────────────
234
235## ▶ Next Up
236
237**Plan phase** — create execution plans with updated context
238
239/gsd-plan-phase {phase}
240
241<sub>/clear first → fresh context window</sub>
242
243───────────────────────────────────────────────────────────────
244
245**Also available:**
246- /gsd-research-phase {phase} --refresh — re-research with new context
247- cat .planning/phases/{phase_dir}/*-CONTEXT.md — review decisions
248
249───────────────────────────────────────────────────────────────
250```
251</step>
252</process>
253
254<anti_patterns>
255- Don't ask about technical implementation (Claude decides)
256- Don't let scope creep — phase boundary is fixed
257- Don't ask generic questions — phase-specific gray areas
258- Don't accept "whatever you think" — push for concrete decisions
259- Don't write vague context — be specific and actionable
260</anti_patterns>
261
262<success_criteria>
263- [ ] Phase validated and exists in roadmap
264- [ ] Existing CONTEXT.md handling (update/view/skip)
265- [ ] Gray areas identified through intelligent analysis
266- [ ] User chose which areas to discuss (at least one)
267- [ ] Each selected area explored until satisfied
268- [ ] Scope creep redirected to deferred ideas
269- [ ] CONTEXT.md created with specific, actionable decisions
270- [ ] File committed to git
271- [ ] User knows next steps (research or plan)
272</success_criteria>