一键导入
rp-investigate
Deep investigation with RepoPrompt MCP tools: tools gather evidence, follow-up reasoning synthesizes selected context
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deep investigation with RepoPrompt MCP tools: tools gather evidence, follow-up reasoning synthesizes selected context
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build with rp-cli context builder plan → implement
Build with RepoPrompt MCP tools context builder plan → implement
Deep investigation with rp-cli commands: tools gather evidence, follow-up reasoning synthesizes selected context
Deep investigation with RepoPrompt MCP tools: tools gather evidence, follow-up reasoning synthesizes selected context
Export a ChatGPT-ready Question / Plan / Review prompt using rp-cli
Export a ChatGPT-ready Question / Plan / Review prompt using RepoPrompt MCP tools
| name | rp-investigate |
| description | Deep investigation with RepoPrompt MCP tools: tools gather evidence, follow-up reasoning synthesizes selected context |
| repoprompt_managed | true |
| repoprompt_skills_version | 29 |
| repoprompt_variant | mcp |
Investigate: $ARGUMENTS
You are now in deep investigation mode for the issue described above. Follow this protocol rigorously.
This workflow leverages three complementary capabilities:
context_builder): Explores the codebase and populates the file selection — choosing full files or slices of files relevant to the task. This is its primary output: a curated selection the chat can analyze.chat_send): Deep analytical reasoning over the current file selection. It sees selected files completely (full content, not summaries), but it only sees what's in the selection — nothing else. It excels at synthesizing patterns, spotting architectural issues, and forming hypotheses from the big picture. It is not a lookup tool: if a question can be answered by reading files, searching, or running git/tool calls, do that yourself first.The file selection is the shared context between you, the context builder, and the chat:
context_builder populates the selection with relevant files/slices it discoversmanage_selection to augment or refine what the chat seesImportant: The context builder operates with a large token budget and works hard to maximize useful context. Don't constrain it — build on its selection with targeted add/remove calls rather than replacing it.
Before any investigation, confirm the target codebase is loaded:
{ "tool": "list_windows", "args": {} }
Check the output:
select_windowBind to the correct window:
{"tool":"select_window","args":{"window_id":<window_id_with_your_root>}}
If the root isn't loaded, find and open the workspace:
{"tool":"manage_workspaces","args":{"action":"list"}}
{"tool":"manage_workspaces","args":{"action":"switch","workspace":"<workspace_name>","open_in_new_window":true}}
Keep this short — save deep exploration for after context_builder.
context_builder — REQUIRED)⚠️ Do NOT skip this step. The context builder discovers relevant files across the codebase that you'd miss with manual searching. It populates the file selection with full files or targeted slices.
Use context_builder with detailed instructions describing what to investigate and why:
mcp__RepoPrompt__context_builder:
instructions: |
<task>Describe the specific issue or question to investigate</task>
<context>
Symptoms observed:
- <concrete symptom 1>
- <concrete symptom 2>
Hypotheses to test:
- <theory 1>
- <theory 2>
Areas likely involved:
- <specific files, patterns, or subsystems>
</context>
response_type: question
Use response_type: question so the chat immediately analyzes the gathered context and returns its initial assessment.
The chat's response will contain hypotheses and analytical pointers. Your job is to verify them with precision:
Build a concrete evidence list: file paths, line numbers, git commits, actual code snippets.
If a factual gap can be closed with read_file, file_search, git, or another direct tool call, do that before going back to the chat.
Update the selection to focus the chat on what matters now, then ask targeted questions that require synthesis rather than direct lookup:
// Add files the chat hasn't seen yet
mcp__RepoPrompt__manage_selection:
op: add
paths: [<additional files relevant to the current hypothesis>]
// Or add a slice of a large file
mcp__RepoPrompt__manage_selection:
op: add
slices:
- path: "Root/large/file.swift"
ranges: [{start_line: 100, end_line: 250}]
// Then ask a focused question — the chat will see the updated selection
mcp__RepoPrompt__`chat_send`:
chat_id: <from context_builder>
message: |
Based on my investigation, here's what I found:
- <concrete evidence 1 with file:line>
- <concrete evidence 2 with file:line>
Given this evidence, <specific analytical question>
mode: chat
Repeat Phases 3–4 as needed, but be judicious. The chat is slow and resource-intensive — do substantial reasoning and evidence gathering on your own between calls. Don't invoke it just to ask a quick question you could answer yourself with read_file, file_search, git, or other direct tool calls. Reserve it for moments when you need deep analytical synthesis, competing explanations, or cross-file reasoning across the selected context.
You write the final report with precise references. The chat reasons about patterns but can't produce exact line numbers — that's your job.
Document:
| Capability | Agent (you) | Context Builder | Chat (chat_send) |
|---|---|---|---|
| Discover relevant files broadly | ❌ Limited | ✅ Primary | ❌ |
| Populate file selection | ❌ | ✅ Primary | ❌ |
| Read exact file contents & lines | ✅ Primary | ❌ | Sees full selected files |
| Run git blame/log/diff | ✅ | ❌ | ❌ |
| Search across codebase | ✅ | ✅ | ❌ |
| Synthesize patterns & architecture | ⚠️ OK | ❌ | ✅ Primary |
| Form & refine hypotheses | ⚠️ OK | ❌ | ✅ Primary |
| Produce line-number evidence | ✅ Primary | ❌ | ❌ |
| Mutate selection to refocus chat | ✅ | ❌ | ❌ |
Create a findings report as you investigate:
# Investigation: [Title]
## Summary
[1-2 sentence summary of findings]
## Symptoms
- [Observed symptom 1]
- [Observed symptom 2]
## Investigation Log
### [Phase] - [Area Investigated]
**Hypothesis:** [What you were testing]
**Findings:** [What you found]
**Evidence:** [Exact file paths, line numbers, code snippets, git commits]
**Conclusion:** [Confirmed/Eliminated/Needs more investigation]
## Root Cause
[Detailed explanation with precise evidence]
## Recommendations
1. [Fix 1 — specific file and location]
2. [Fix 2 — specific file and location]
## Preventive Measures
- [How to prevent this in future]
context_builder and attempting to investigate by reading files manually — you'll miss critical contextcontext_builder — initial assessment should be briefread_file, file_search, git, or other direct tool calls — reserve it for deep analytical synthesismanage_selection with op:"clear" or op:"set" — this undoes context_builder's carefully curated selection; use op:"add" and op:"remove" to build on itNow begin the investigation. Read any provided context, form initial hypotheses, then immediately use context_builder to gather broad context. After that, alternate between your own evidence gathering and refocused chat deep dives.