원클릭으로
rp-investigate-cli
Deep investigation with rp-cli commands: tools gather evidence, follow-up reasoning synthesizes selected context
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Deep investigation with rp-cli commands: tools gather evidence, follow-up reasoning synthesizes selected context
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Test GitHub Actions workflow YAML changes end-to-end with static validation, local shell simulation, and PR CI checks. Use when verifying CI/workflow changes such as secret handling in run blocks.
Test the ctrld-sync Python CLI end-to-end. Use when validating CLI dry-run behavior, folder URL validation, SSRF safety checks, or sync planning changes.
Build with rp-cli context builder plan → implement
Build with RepoPrompt MCP tools context builder plan → implement
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
| name | rp-investigate-cli |
| description | Deep investigation with rp-cli commands: tools gather evidence, follow-up reasoning synthesizes selected context |
| repoprompt_managed | true |
| repoprompt_skills_version | 30 |
| repoprompt_variant | cli |
Investigate: $ARGUMENTS
You are now in deep investigation mode for the issue described above. Follow this protocol rigorously.
This workflow uses rp-cli (RepoPrompt CLI) instead of MCP tool calls. Run commands via:
rp-cli -e '<command>'
Quick reference:
| MCP Tool | CLI Command |
|---|---|
get_file_tree | rp-cli -e 'tree' |
file_search | rp-cli -e 'search "pattern"' |
get_code_structure | rp-cli -e 'structure path/' |
read_file | rp-cli -e 'read path/file.swift' |
manage_selection | rp-cli -e 'select add path/' |
context_builder | rp-cli -e 'builder "instructions" --response-type plan' |
chat_send | rp-cli -e 'chat "message" --mode plan' |
apply_edits | rp-cli -e 'call apply_edits {"path":"...","search":"...","replace":"..."}' |
file_actions | rp-cli -e 'call file_actions {"action":"create","path":"..."}' |
Chain commands with &&:
rp-cli -e 'select set src/ && context'
Use rp-cli -e 'describe <tool>' for help on a specific tool, rp-cli --tools-schema for machine-readable JSON schemas, or rp-cli --help for CLI usage.
JSON args (-j) accept inline JSON, file paths (.json auto-detected), @file, or @- (stdin). Raw newlines in strings are auto-repaired.
⚠️ TIMEOUT WARNING: The builder and chat commands can take several minutes to complete. When invoking rp-cli, set your command timeout to at least 2700 seconds (45 minutes) to avoid premature termination.
This workflow leverages three complementary capabilities:
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:
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:
# First, list available windows to find the right one
rp-cli -e 'windows'
# Then check roots in a specific window (REQUIRED - CLI cannot auto-bind)
rp-cli -w <window_id> -e 'tree --type roots'
Check the output:
CLI Window Routing (CRITICAL):
-w <window_id> to target the correct windowrp-cli -e 'windows' to list all open windows and their workspaces-w <window_id> in ALL subsequent commandsKeep this short — save deep exploration for after builder.
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 builder with detailed instructions describing what to investigate and why:
rp-cli -w <window_id> -e 'builder "<task>Investigate: specific issue</task>
<context>
Symptoms observed:
- <symptom 1>
- <symptom 2>
Hypotheses to test:
- <theory 1>
- <theory 2>
Areas likely involved:
- <files/patterns/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
rp-cli -w <window_id> -e 'select add <additional files>'
# Or add a slice of a large file
rp-cli -w <window_id> -e 'select add Root/large/file.swift:100-250'
# Ask focused question with your evidence — chat sees updated selection
rp-cli -w <window_id> -t '<tab_id>' -e 'chat "Based on my investigation:
- <evidence 1 with file:line>
- <evidence 2 with file:line>
Given this evidence, <specific question>" --mode chat'
Pass
-t <tab_id>to continue the same chat conversation.
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]
builder and attempting to investigate by reading files manually — you'll miss critical contextbuilder — 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 builder's carefully curated selection; use op:"add" and op:"remove" to build on it-w <window_id> — CLI invocations are stateless and require explicit window targetingNow begin the investigation. First run rp-cli -e 'windows' to find the correct window, then Read any provided context, form initial hypotheses, then immediately use builder to gather broad context. After that, alternate between your own evidence gathering and refocused chat deep dives.