一键导入
rpi-research
Use when starting the RPI flow and you want to deeply understand a question, system, or feature by reading the codebase before planning.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when starting the RPI flow and you want to deeply understand a question, system, or feature by reading the codebase before planning.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when starting the RPI flow and you want to deeply understand a question, system, or feature by reading the codebase before planning.
Use when starting a new deep-work task. Decomposes a task description into objective research questions that avoid premature solutioning. Phase 1 of the deep-work pipeline.
Use when you have research questions from deep-work Phase 1. Objectively investigates the codebase to answer pasted questions without access to the original task description.
Use when deep-work Phase 2 research is complete. Combines research findings with the original task to explore design options, evaluate tradeoffs, and make decisions interactively.
Use when deep-work Phase 3 design decisions are complete. Maps chosen decisions to concrete file changes organized into implementable phases.
Use when deep-work Phase 4 structure outline is complete. Expands the outline into a detailed implementation plan with exact file paths, code patterns, tests, and validation commands.
| name | rpi-research |
| description | Use when starting the RPI flow and you want to deeply understand a question, system, or feature by reading the codebase before planning. |
Conduct comprehensive read-only research on a question or feature by dispatching parallel sub-agents and synthesizing findings into a single durable research document.
RPI principle: Research documents what is. Plan decides what should change. Implement performs the change and verifies it.
Announce at start: "Starting /rpi-research."
You and all dispatched sub-agents are documenting what exists, not what should exist.
Don't confuse "don't recommend fixes" (correct) with "don't question whether code runs" (harmful). Determining that something is dead, unused, or unreachable is documenting what exists — it belongs in the artifact. Only the prescription ("so remove it") is out of scope.
This stance is what makes the artifact reusable by /rpi-plan (and future readers) without baked-in bias.
"$SKILL_BASE_DIR/setup.sh" "<slug>" (extract <slug> from $ARGUMENTS; everything after the slug is the research query). Parse stdout for REPO, TOPIC_SLUG, ARTIFACT_DIR. $SKILL_BASE_DIR is the "Base directory for this skill" path shown at the top of this prompt.
MISSING_SLUG), use AskUserQuestion to ask for a slug, then re-run.<ARTIFACT_DIR>/research.md already exists, ask the user how to proceed:
$ARGUMENTS after the slug is empty, use ask for the research query inline.$ARGUMENTS after the slug is the research query. If the query mentions specific files (tickets, docs, JSON, source files), read them fully (no offset/limit) before dispatching any sub-agents. The main context needs full grounding before decomposition.
If the query is solution-shaped ("how should we implement X", "replace A with B"), normalize it into neutral codebase questions before decomposition: what exists, where it is used, how it works, and what patterns already exist. Preserve the original query in the artifact, but dispatch research on the neutralized questions.
A query that asks you to validate, confirm, or check an existing doc, plan, decision, or proposed solution is solution-shaped even when phrased as a fact-check ("are these citations right?"). It is the most dangerous shape because it reads as documentary but pulls you toward confirming what you were handed. Re-frame to investigate the underlying problem independently — what exists, what is actually used, what the simplest explanation is — and actively seek evidence the existing solution is unnecessary or wrong. Confirming citations is not research.
Break the query into 3-6 composable research areas. Examples:
rpi:codebase-locatorrpi:codebase-analyzerrpi:codebase-pattern-findergit log / git blame + mcp__glean_default__searchweb-search-researcher (only if external context genuinely helps)Skip categories that don't apply. Don't pad with research areas that won't change the artifact.
Always include one altitude-raising area the query did not name — e.g. "how is this subsystem driven in production today, and what did it replace / what is now legacy?" The query usually arrives at the altitude of the proposed change; the answer that reframes the problem often lives one level up. For any "is X used / can we remove X / is this path live" question, this area is mandatory, not optional.
In a single message, dispatch one Agent call per research area. Prefix every sub-agent prompt with the documentarian directive:
"You are documenting what exists. Do NOT critique, suggest improvements, or perform root-cause analysis. Return file:line references for every claim."
Codebase routing:
rpi:codebase-locator — find files/components by name or purposerpi:codebase-analyzer — explain how a specific path worksrpi:codebase-pattern-finder — find similar implementations to model afterExternal routing:
web-search-researcher — only when external docs/articles are genuinely needed; instruct it to return linksmcp__glean_default__search, mcp__glean_default__read_document) — for internal docs, tickets, prior decisionsWait for all sub-agents to complete before synthesizing.
file.ext:LINE which then writes to Z").Write to <ARTIFACT_DIR>/research.md using exactly this structure:
---
phase: research
date: <today, YYYY-MM-DD>
researcher: <git config user.name fallback to "unknown">
git_commit: <git rev-parse --short HEAD>
branch: <git branch --show-current>
repo: <REPO from dw-setup.sh>
topic: <TOPIC_SLUG>
status: complete
last_updated: <today, YYYY-MM-DD>
last_updated_note: initial research
---
# Research: <topic title>
## Research Question
<original query, normalized>
## Summary
<3-8 sentence high-level documentation of what exists, answering the question. No "we should" — only "X is", "Y does Z".>
## Detailed Findings
### <Component or Area 1>
- <Description of what exists> (`path/to/file.ext:LINE`)
- <How it connects to other components> (`path:LINE`)
- <Current implementation detail, without evaluation>
### <Component or Area 2>
...
## Code References
- `path/to/file.ext:LINE` — <what is there>
- `another/file.ext:LINE-LINE` — <description of the block>
## Historical Context
<Relevant prior decisions, ticket history, or doc references — cite source. Omit section if none.>
## Open Questions
<Things that require human judgment or that the codebase alone can't answer. Phrased as questions, not critique.>
- <question 1>
- <question 2>
_If no open questions, write: "None — research is complete for the stated question."_
If the user has follow-up questions in the same session:
last_updated, append last_updated_note: "<brief description>".## Follow-up Research <YYYY-MM-DD HH:MM> with its own Summary / Detailed Findings / Code References / Open Questions sub-sections.If the follow-up arrives in a fresh conversation, re-run /rpi-research <slug> <new query> and choose Follow-up append at the pre-flight gate.
<path>/research.md. When ready, run /rpi-plan <slug> to turn this into an implementation plan."Stop and reconsider if: