diff --git a/agents/gsd-researcher.md b/agents/gsd-researcher.md index 49bcac568..cd02480ad 100644 --- a/agents/gsd-researcher.md +++ b/agents/gsd-researcher.md @@ -24,47 +24,14 @@ Your job: Answer research questions with verified, actionable findings. Produce -## Why You Research +## Research Feeds Planning -Your research output directly feeds into `/gsd:plan-phase`. The planning workflow loads your RESEARCH.md and uses specific sections to create better plans. +Your output is consumed by downstream GSD workflows. The orchestrator's prompt tells you: +- `` — Phase research vs project research +- `` — What workflow uses your output and how +- `` — Checklist before declaring complete -**The contract:** - -| Your Section | How plan-phase Uses It | -|--------------|------------------------| -| `## Standard Stack` | Plans use these libraries, not alternatives | -| `## Architecture Patterns` | Task structure follows these patterns | -| `## Don't Hand-Roll` | Tasks NEVER build custom solutions for listed problems | -| `## Common Pitfalls` | Verification steps check for these | -| `## Code Examples` | Task actions reference these patterns | - -**What this means for your output:** - -1. **Section names matter** — plan-phase greps for these exact headings -2. **Be prescriptive, not exploratory** — "Use X" not "Consider X or Y" -3. **Actionable over comprehensive** — A focused stack beats a survey of options -4. **Examples are instructions** — Code snippets become task templates - -**Bad research (for GSD):** -```markdown -## Options for State Management -There are several approaches: Redux, Zustand, Jotai, or React Context... -``` - -**Good research (for GSD):** -```markdown -## Standard Stack -| Library | Version | Purpose | -|---------|---------|---------| -| Zustand | 4.5 | State management | - -## Don't Hand-Roll -| Problem | Use Instead | -|---------|-------------| -| Global state | Zustand (not React Context) | -``` - -The second version tells the planner exactly what to put in tasks. +**Universal principle:** Be prescriptive, not exploratory. "Use X" beats "Consider X or Y." Your research becomes instructions. diff --git a/commands/gsd/research-phase.md b/commands/gsd/research-phase.md index e22dbe7a4..41e408609 100644 --- a/commands/gsd/research-phase.md +++ b/commands/gsd/research-phase.md @@ -61,6 +61,23 @@ Present summary with phase description, requirements, prior decisions. Research modes: ecosystem (default), feasibility, implementation, comparison. ```markdown + +Phase Research — investigating HOW to implement a specific phase well. + + + +The question is NOT "which library should I use?" + +The question is: "What do I not know that I don't know?" + +For this phase, discover: +- What's the established architecture pattern? +- What libraries form the standard stack? +- What problems do people commonly hit? +- What's SOTA vs what Claude's training thinks is SOTA? +- What should NOT be hand-rolled? + + Research implementation approach for Phase {phase_number}: {phase_name} Mode: ecosystem @@ -73,6 +90,26 @@ Mode: ecosystem **Phase context:** {context_md_content} + +Your RESEARCH.md will be loaded by `/gsd:plan-phase` which uses specific sections: +- `## Standard Stack` → Plans use these libraries +- `## Architecture Patterns` → Task structure follows these +- `## Don't Hand-Roll` → Tasks NEVER build custom solutions for listed problems +- `## Common Pitfalls` → Verification steps check for these +- `## Code Examples` → Task actions reference these patterns + +Be prescriptive, not exploratory. "Use X" not "Consider X or Y." + + + +Before declaring complete, verify: +- [ ] All domains investigated (not just some) +- [ ] Negative claims verified with official docs +- [ ] Multiple sources for critical claims +- [ ] Confidence levels assigned honestly +- [ ] Section names match what plan-phase expects + + Write to: .planning/phases/{phase}-{slug}/{phase}-RESEARCH.md diff --git a/commands/gsd/research-project.md b/commands/gsd/research-project.md index 9ca26b519..2766f7101 100644 --- a/commands/gsd/research-project.md +++ b/commands/gsd/research-project.md @@ -64,24 +64,168 @@ Present for approval. mkdir -p .planning/research ``` -Spawn all 4 in parallel: +**Determine milestone context:** +- If no "Validated" requirements in REQUIREMENTS.md → Greenfield (v1.0) +- If "Validated" requirements exist → Subsequent milestone (v1.1+) + +Spawn all 4 in parallel with rich context: ``` -Task(prompt="Research stack for [domain]. Question: [question]. Context: [PROJECT.md summary]. -Write to: .planning/research/STACK.md. Use template from ~/.claude/get-shit-done/templates/research-project/STACK.md", -subagent_type="gsd-researcher", description="Stack research") +Task(prompt=" + +Project Research — Stack dimension for [domain]. + -Task(prompt="Research features for [domain]. Question: [question]. Context: [PROJECT.md summary]. -Write to: .planning/research/FEATURES.md. Use template from ~/.claude/get-shit-done/templates/research-project/FEATURES.md", -subagent_type="gsd-researcher", description="Features research") + +{greenfield OR subsequent} -Task(prompt="Research architecture for [domain]. Question: [question]. Context: [PROJECT.md summary]. -Write to: .planning/research/ARCHITECTURE.md. Use template from ~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md", -subagent_type="gsd-researcher", description="Architecture research") +Greenfield: Research the standard stack for building [domain] from scratch. +Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system. + -Task(prompt="Research pitfalls for [domain]. Question: [question]. Context: [PROJECT.md summary]. -Write to: .planning/research/PITFALLS.md. Use template from ~/.claude/get-shit-done/templates/research-project/PITFALLS.md", -subagent_type="gsd-researcher", description="Pitfalls research") + +[stack question from step 4] + + + +[PROJECT.md summary] + + + +Your STACK.md feeds into /gsd:create-roadmap. Be prescriptive: +- Specific libraries with versions +- Clear rationale for each choice +- What NOT to use and why + + + +- [ ] Versions are current (not Claude's training data) +- [ ] Rationale explains WHY, not just WHAT +- [ ] Confidence levels assigned + + + +Write to: .planning/research/STACK.md +Use template: ~/.claude/get-shit-done/templates/research-project/STACK.md + +", subagent_type="gsd-researcher", description="Stack research") + +Task(prompt=" + +Project Research — Features dimension for [domain]. + + + +{greenfield OR subsequent} + +Greenfield: What features do [domain] products have? What's table stakes vs differentiating? +Subsequent: How do [target features] typically work? What's expected behavior? + + + +[features question from step 4] + + + +[PROJECT.md summary] + + + +Your FEATURES.md feeds into /gsd:define-requirements. Categorize clearly: +- Table stakes (must have or users leave) +- Differentiators (competitive advantage) +- Anti-features (things to deliberately NOT build) + + + +- [ ] Categories are clear +- [ ] Complexity noted for each +- [ ] Dependencies between features identified + + + +Write to: .planning/research/FEATURES.md +Use template: ~/.claude/get-shit-done/templates/research-project/FEATURES.md + +", subagent_type="gsd-researcher", description="Features research") + +Task(prompt=" + +Project Research — Architecture dimension for [domain]. + + + +{greenfield OR subsequent} + +Greenfield: How are [domain] systems typically structured? What are major components? +Subsequent: How do [target features] integrate with existing [domain] architecture? + + + +[architecture question from step 4] + + + +[PROJECT.md summary] + + + +Your ARCHITECTURE.md informs phase structure in roadmap. Include: +- Component boundaries (what talks to what) +- Data flow (how information moves) +- Suggested build order (dependencies between components) + + + +- [ ] Components clearly defined +- [ ] Boundaries explicit +- [ ] Build order implications noted + + + +Write to: .planning/research/ARCHITECTURE.md +Use template: ~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md + +", subagent_type="gsd-researcher", description="Architecture research") + +Task(prompt=" + +Project Research — Pitfalls dimension for [domain]. + + + +{greenfield OR subsequent} + +Greenfield: What do [domain] projects commonly get wrong? Critical mistakes? +Subsequent: What are common mistakes when adding [target features] to [domain]? + + + +[pitfalls question from step 4] + + + +[PROJECT.md summary] + + + +Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall: +- Warning signs (how to detect early) +- Prevention strategy (how to avoid) +- Which phase should address it + + + +- [ ] Pitfalls are specific, not generic +- [ ] Prevention is actionable +- [ ] Phase mapping included + + + +Write to: .planning/research/PITFALLS.md +Use template: ~/.claude/get-shit-done/templates/research-project/PITFALLS.md + +", subagent_type="gsd-researcher", description="Pitfalls research") ``` **Announce:** "Spawning 4 research agents... may take 2-3 minutes." @@ -91,9 +235,35 @@ subagent_type="gsd-researcher", description="Pitfalls research") After all agents complete, read their outputs and write `.planning/research/SUMMARY.md`: - Read template: `~/.claude/get-shit-done/templates/research-project/SUMMARY.md` - Synthesize executive summary from all 4 files -- Include "Implications for Roadmap" with suggested phase structure - Add confidence assessment +**Critical: Include "Implications for Roadmap" section:** + +```markdown +## Implications for Roadmap + +Based on research, suggested phase structure: + +1. **[Phase name]** — [rationale from research] + - Addresses: [features from FEATURES.md] + - Avoids: [pitfall from PITFALLS.md] + - Uses: [stack element from STACK.md] + +2. **[Phase name]** — [rationale from research] + - Implements: [architecture component from ARCHITECTURE.md] + ... + +**Phase ordering rationale:** +- [Why this order based on dependencies discovered in ARCHITECTURE.md] +- [Why this grouping based on PITFALLS.md prevention strategies] + +**Research flags for phases:** +- Phase [X]: Likely needs deeper research (reason) +- Phase [Y]: Standard patterns, unlikely to need research +``` + +This section directly feeds into `/gsd:create-roadmap`. + ## 7. Commit Research ```bash