refactor(14-03): convert research-project to thin orchestrator

- Command spawns 4 parallel gsd-researcher agents
- Stack, Features, Architecture, Pitfalls each get dedicated agent
- Orchestrator handles project analysis and synthesis
- Reduced from 138 + 427 workflow lines to 137 lines
This commit is contained in:
Lex Christopherson
2026-01-15 17:03:38 -06:00
parent 3ca6b1fef4
commit 982faf16f8

View File

@@ -5,38 +5,18 @@ allowed-tools:
- Read - Read
- Write - Write
- Bash - Bash
- Glob
- Grep
- Task - Task
- WebFetch - AskUserQuestion
- WebSearch
- mcp__context7__*
--- ---
<objective> <objective>
Comprehensive domain research before roadmap creation. Research domain ecosystem. Spawns 4 parallel gsd-researcher agents for comprehensive coverage.
Answers the questions that inform quality roadmaps: **Orchestrator role:** Analyze project, generate research questions, spawn 4 parallel agents, synthesize SUMMARY.md.
- What's the standard stack for this type of product?
- What features do users expect?
- How are these systems typically structured?
- What do projects in this domain commonly get wrong?
Run after `/gsd:new-project`, before `/gsd:define-requirements`. **Why subagents:** Research burns context fast. Fresh 200k context per domain. Main context stays lean.
Output: `.planning/research/` folder with ecosystem knowledge.
</objective> </objective>
<execution_context>
@~/.claude/get-shit-done/references/principles.md
@~/.claude/get-shit-done/workflows/research-project.md
@~/.claude/get-shit-done/templates/research-project/SUMMARY.md
@~/.claude/get-shit-done/templates/research-project/STACK.md
@~/.claude/get-shit-done/templates/research-project/FEATURES.md
@~/.claude/get-shit-done/templates/research-project/ARCHITECTURE.md
@~/.claude/get-shit-done/templates/research-project/PITFALLS.md
</execution_context>
<context> <context>
@.planning/PROJECT.md @.planning/PROJECT.md
@.planning/config.json (if exists) @.planning/config.json (if exists)
@@ -44,94 +24,114 @@ Output: `.planning/research/` folder with ecosystem knowledge.
<process> <process>
<step name="validate"> ## 1. Validate Prerequisites
```bash ```bash
# Verify project exists [ -f .planning/PROJECT.md ] || { echo "ERROR: No PROJECT.md. Run /gsd:new-project first."; exit 1; }
[ -f .planning/PROJECT.md ] || { echo "ERROR: No PROJECT.md found. Run /gsd:new-project first."; exit 1; } [ -f .planning/ROADMAP.md ] && echo "WARNING: ROADMAP.md exists. Research is typically done before roadmap."
# Check if roadmap already exists
[ -f .planning/ROADMAP.md ] && echo "WARNING: ROADMAP.md already exists. Research is typically done before roadmap creation."
# Check if research already exists
[ -d .planning/research ] && echo "RESEARCH_EXISTS" || echo "NO_RESEARCH" [ -d .planning/research ] && echo "RESEARCH_EXISTS" || echo "NO_RESEARCH"
``` ```
</step>
<step name="check_existing"> ## 2. Handle Existing Research
**If RESEARCH_EXISTS:**
Use AskUserQuestion: **If RESEARCH_EXISTS:** Use AskUserQuestion (View existing / Replace / Cancel)
- header: "Research exists"
- question: "Research folder already exists. What would you like to do?"
- options:
- "View existing" — Show current research summary
- "Replace" — Run fresh research (will overwrite)
- "Cancel" — Keep existing research
If "View existing": Read and display `.planning/research/SUMMARY.md`, then exit ## 3. Analyze Project
If "Cancel": Exit
If "Replace": Continue with workflow
</step>
<step name="execute_research"> Read PROJECT.md, extract domain/stack/core value/constraints. Present for approval:
Follow the research-project.md workflow: ```
- Analyze PROJECT.md to determine domain Domain analysis:
- Identify research questions based on domain - Type: [domain]
- Spawn parallel research agents - Stack: [stated or TBD]
- Aggregate results into `.planning/research/` - Core: [core value]
- Create SUMMARY.md with roadmap implications Does this look right? (yes / adjust)
</step> ```
## 4. Generate Research Questions
| Dimension | Question |
|-----------|----------|
| Stack | "What's the standard 2025 stack for [domain]?" |
| Features | "What features do [domain] products have?" |
| Architecture | "How are [domain] systems structured?" |
| Pitfalls | "What do [domain] projects get wrong?" |
Present for approval.
## 5. Spawn Research Agents
```bash
mkdir -p .planning/research
```
Spawn all 4 in parallel:
```
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="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")
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")
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")
```
**Announce:** "Spawning 4 research agents... may take 2-3 minutes."
## 6. Synthesize Results
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
## 7. Commit Research
```bash
git add .planning/research/
git commit -m "docs: research [domain] ecosystem
Key findings:
- Stack: [one-liner]
- Architecture: [one-liner]
- Critical pitfall: [one-liner]"
```
## 8. Present Results
<step name="done">
``` ```
Research complete: Research complete:
- Summary: .planning/research/SUMMARY.md Files: SUMMARY.md, STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md
- Stack: .planning/research/STACK.md
- Features: .planning/research/FEATURES.md Key findings:
- Architecture: .planning/research/ARCHITECTURE.md - Stack: [one-liner]
- Pitfalls: .planning/research/PITFALLS.md - Architecture: [one-liner]
- Critical pitfall: [one-liner]
--- ---
## > Next Up
## ▶ Next Up **Define requirements** - `/gsd:define-requirements`
<sub>`/clear` first</sub>
**Define requirements** — scope your v1 from research findings
`/gsd:define-requirements`
<sub>`/clear` first → fresh context window</sub>
**Flow:** research-project → **define-requirements** → create-roadmap
--- ---
``` ```
</step>
</process> </process>
<when_to_use>
**Use research-project for:**
- Greenfield projects in established domains (community, e-commerce, SaaS)
- When "what features should exist" is partially unknown
- Complex integrations requiring ecosystem knowledge
- Domains where best practices matter (auth, payments, real-time)
- Any project where you'd Google "how to build a [X]" before starting
**Skip research-project for:**
- Well-defined specs ("build exactly this API")
- Simple tools/utilities with clear scope
- Adding features to existing codebases (use research-phase instead)
- Domains you've built in many times before
</when_to_use>
<success_criteria> <success_criteria>
- [ ] PROJECT.md validated - [ ] PROJECT.md validated
- [ ] Domain identified from project description - [ ] Domain identified and approved
- [ ] Research questions determined and approved - [ ] 4 gsd-researcher agents spawned in parallel
- [ ] Parallel research agents spawned - [ ] All research files created
- [ ] All research documents created in .planning/research/ - [ ] SUMMARY.md synthesized with roadmap implications
- [ ] SUMMARY.md includes roadmap implications - [ ] Research committed
- [ ] Research committed to git
- [ ] User knows next step (define-requirements)
</success_criteria> </success_criteria>