gsd-research-phase
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Research how to implement a phase. Spawns gsd-phase-researcher agent with phase context.
Note: This is a standalone research command. For most workflows, use which integrates research automatically.
{{COMMAND_PREFIX}}plan-phaseUse this command when:
- You want to research without planning yet
- You want to re-research after planning is complete
- You need to investigate before deciding if a phase is feasible
Orchestrator role: Parse phase, validate against roadmap, check existing research, gather context, spawn researcher agent, present results.
Why subagent: Research burns context fast (WebSearch, Context7 queries, source verification). Fresh 200k context for investigation. Main context stays lean for user interaction.
</objective>
<context>
Phase number: $ARGUMENTS (required)
Normalize phase input in step 1 before any directory lookups.
</context>
<process><objective>
研究如何实现一个阶段。基于阶段上下文启动gsd-phase-researcher agent。
注意: 这是一个独立的研究命令。对于大多数工作流,请使用,它会自动集成研究功能。
{{COMMAND_PREFIX}}plan-phase使用此命令的场景:
- 你希望先进行研究,暂不做规划
- 规划完成后,你需要重新开展研究
- 在决定某个阶段是否可行之前,你需要先进行调研
编排器角色: 解析阶段信息,对照路线图验证,检查已有研究,收集上下文,启动研究agent,呈现结果。
为何使用子agent: 研究过程会快速消耗上下文(WebSearch、Context7查询、来源验证)。全新的200k上下文可用于调研,主上下文保持精简以用于用户交互。
</objective>
<context>
阶段编号:$ARGUMENTS(必填)
在进行任何目录查找前,第一步先标准化阶段输入。
</context>
<process>0. Initialize Context
0. 初始化上下文
bash
INIT=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs init phase-op "$ARGUMENTS")Extract from init JSON: , , , , , , , , , .
phase_dirphase_numberphase_namephase_foundcommit_docshas_researchstate_pathrequirements_pathcontext_pathresearch_pathResolve researcher model:
bash
RESEARCHER_MODEL=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs resolve-model gsd-phase-researcher --raw)bash
INIT=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs init phase-op "$ARGUMENTS")从初始化JSON中提取:, , , , , , , , , 。
phase_dirphase_numberphase_namephase_foundcommit_docshas_researchstate_pathrequirements_pathcontext_pathresearch_path解析研究模型:
bash
RESEARCHER_MODEL=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs resolve-model gsd-phase-researcher --raw)1. Validate Phase
1. 验证阶段
bash
PHASE_INFO=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}")If is false: Error and exit. If is true: Extract , , from JSON.
foundfoundphase_numberphase_namegoalbash
PHASE_INFO=$(node {{PLATFORM_ROOT}}/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "${phase_number}")如果为false: 报错并退出。如果为true: 从JSON中提取, , 。
foundfoundphase_numberphase_namegoal2. Check Existing Research
2. 检查已有研究
bash
ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/nullIf exists: Offer: 1) Update research, 2) View existing, 3) Skip. Wait for response.
If doesn't exist: Continue.
bash
ls .planning/phases/${PHASE}-*/RESEARCH.md 2>/dev/null若已存在: 提供选项:1) 更新研究,2) 查看已有研究,3) 跳过。等待用户响应。
若不存在: 继续执行。
3. Gather Phase Context
3. 收集阶段上下文
Use paths from INIT (do not inline file contents in orchestrator context):
requirements_pathcontext_pathstate_path
Present summary with phase description and what files the researcher will load.
使用INIT中的路径(不要在编排器上下文中内联文件内容):
requirements_pathcontext_pathstate_path
呈现包含阶段描述以及研究agent将加载的文件的摘要。
4. Spawn gsd-phase-researcher Agent
4. 启动gsd-phase-researcher Agent
Research modes: ecosystem (default), feasibility, implementation, comparison.
markdown
<research_type>
Phase Research — investigating HOW to implement a specific phase well.
</research_type>
<key_insight>
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?
</key_insight>
<objective>
Research implementation approach for Phase {phase_number}: {phase_name}
Mode: ecosystem
</objective>
<files_to_read>
- {requirements_path} (Requirements)
- {context_path} (Phase context from discuss-phase, if exists)
- {state_path} (Prior project decisions and blockers)
</files_to_read>
<additional_context>
**Phase description:** {phase_description}
</additional_context>
<downstream_consumer>
Your RESEARCH.md will be loaded by `{{COMMAND_PREFIX}}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."
</downstream_consumer>
<quality_gate>
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
</quality_gate>
<output>
Write to: .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
</output>Task(
prompt="First, read {{PLATFORM_ROOT}}/agents/gsd-phase-researcher.md for your role and instructions.\n\n" + filled_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Research Phase {phase}"
)研究模式:生态系统(默认)、可行性、实现、对比。
markdown
<research_type>
阶段研究 — 调研如何出色地实现特定阶段。
</research_type>
<key_insight>
核心问题不是“我应该使用哪个库?”
而是:“有哪些我不知道自己不知道的事情?”
针对此阶段,需探索:
- 已确立的架构模式是什么?
- 构成标准技术栈的库有哪些?
- 人们通常会遇到哪些问题?
- 当前最优方案(SOTA)与Claude训练数据中的最优方案有何区别?
- 哪些内容不应手动开发?
</key_insight>
<objective>
研究第{phase_number}阶段:{phase_name}的实现方案
模式:生态系统
</objective>
<files_to_read>
- {requirements_path}(需求文档)
- {context_path}(若存在,来自discuss-phase的阶段上下文)
- {state_path}(过往项目决策与障碍)
</files_to_read>
<additional_context>
**阶段描述:** {phase_description}
</additional_context>
<downstream_consumer>
你的RESEARCH.md将被`{{COMMAND_PREFIX}}plan-phase`加载,它会使用以下特定章节:
- `## Standard Stack` → 规划将使用这些库
- `## Architecture Patterns` → 任务结构遵循这些模式
- `## Don't Hand-Roll` → 任务绝不会为列出的问题构建自定义解决方案
- `## Common Pitfalls` → 验证步骤会检查这些问题
- `## Code Examples` → 任务操作会参考这些模式
请给出明确的指令,而非探索性内容。使用“使用X”而非“考虑X或Y”。
</downstream_consumer>
<quality_gate>
在宣布完成前,请验证:
- [ ] 所有领域均已调研(而非仅部分)
- [ ] 负面声明已通过官方文档验证
- [ ] 关键声明有多个来源支撑
- [ ] 如实标注置信度
- [ ] 章节名称与plan-phase预期一致
</quality_gate>
<output>
写入至:.planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md
</output>Task(
prompt="First, read {{PLATFORM_ROOT}}/agents/gsd-phase-researcher.md for your role and instructions.\n\n" + filled_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Research Phase {phase}"
)5. Handle Agent Return
5. 处理Agent返回结果
## RESEARCH COMPLETE## CHECKPOINT REACHED## RESEARCH INCONCLUSIVE## RESEARCH COMPLETE## CHECKPOINT REACHED## RESEARCH INCONCLUSIVE6. Spawn Continuation Agent
6. 启动续期Agent
markdown
<objective>
Continue research for Phase {phase_number}: {phase_name}
</objective>
<prior_state>
<files_to_read>
- .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md (Existing research)
</files_to_read>
</prior_state>
<checkpoint_response>
**Type:** {checkpoint_type}
**Response:** {user_response}
</checkpoint_response>Task(
prompt="First, read {{PLATFORM_ROOT}}/agents/gsd-phase-researcher.md for your role and instructions.\n\n" + continuation_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Continue research Phase {phase}"
)<success_criteria>
- Phase validated against roadmap
- Existing research checked
- gsd-phase-researcher spawned with context
- Checkpoints handled correctly
- User knows next steps </success_criteria>
markdown
<objective>
继续研究第{phase_number}阶段:{phase_name}
</objective>
<prior_state>
<files_to_read>
- .planning/phases/${PHASE}-{slug}/${PHASE}-RESEARCH.md(已有研究)
</files_to_read>
</prior_state>
<checkpoint_response>
**类型:** {checkpoint_type}
**响应:** {user_response}
</checkpoint_response>Task(
prompt="First, read {{PLATFORM_ROOT}}/agents/gsd-phase-researcher.md for your role and instructions.\n\n" + continuation_prompt,
subagent_type="general-purpose",
model="{researcher_model}",
description="Continue research Phase {phase}"
)<success_criteria>
- 阶段已对照路线图验证
- 已检查已有研究
- 已加载上下文并启动gsd-phase-researcher
- 检查点已正确处理
- 用户了解后续步骤 </success_criteria>