بنقرة واحدة
rp-orchestrate-cli
Plan, decompose, and delegate complex tasks across multiple agents using rpce-cli
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Plan, decompose, and delegate complex tasks across multiple agents using rpce-cli
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Normalize a consequential or ambiguous request when missing context, boundaries, or proof could materially change the work. Explicit invocation previews the improved prompt.
Explore requirements and approaches through collaborative dialogue, then write a right-sized requirements document. Use when the user says "let's brainstorm", "what should we build", or "help me think through X", presents a vague or ambitious feature request, or seems unsure about scope or direction -- even without explicitly asking to brainstorm.
Find root causes and fix bugs. Use for errors, failing tests, issue repros, stack traces, "debug this", or "why is this failing".
Create structured plans for multi-step tasks once the goal is clear enough to plan. Use after ce-brainstorm or ce-grill, or directly for clear planning requests. If the request has branchy product/scope ambiguity, run ce-grill first. After markdown plans, document-review runs before handoff.
Review recent code changes for bugs, regressions, product fit, conventions, performance, security, and blast radius.
Execute implementation work with a compact product-contract loop. Use when the user asks to build, fix, implement, polish, or finish a scoped task. Favor reasoning, prior art, smallest correct changes, focused tests, and real-surface proof. Do not run autonomous PR, CI, ticket, or residual-work pipelines.
| name | rp-orchestrate-cli |
| description | Plan, decompose, and delegate complex tasks across multiple agents using rpce-cli |
| repoprompt_managed | true |
| repoprompt_skills_version | 61 |
| repoprompt_variant | cli |
Raw request: $ARGUMENTS
This workflow uses rpce-cli (RepoPrompt CLI) instead of MCP tool calls. Run commands via:
rpce-cli -e '<command>'
Quick reference:
| MCP Tool | CLI Command |
|---|---|
get_file_tree | rpce-cli -e 'tree' |
file_search | rpce-cli -e 'search "pattern"' |
get_code_structure | rpce-cli -e 'structure path/' |
read_file | rpce-cli -e 'read path/file.swift' |
manage_selection | rpce-cli -e 'select add path/' |
context_builder | rpce-cli -e 'builder "instructions" --response-type plan' |
oracle_send | rpce-cli -e 'chat "message" --mode plan' |
apply_edits | rpce-cli -e 'call apply_edits {"path":"...","search":"...","replace":"..."}' |
file_actions | rpce-cli -e 'call file_actions {"action":"create","path":"..."}' |
Chain commands with &&:
rpce-cli -e 'select set src/ && context'
Use rpce-cli -e 'describe <tool>' for help on a specific tool, rpce-cli --tools-schema for machine-readable JSON schemas, or rpce-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 rpce-cli, set your command timeout to at least 2700 seconds (45 minutes) to avoid premature termination.
You are an orchestrator: plan, decompose, delegate. Implementation and deep context-gathering happen in sub-agents. Keep your own context lean for coordination.
Before any planning, bind to the target codebase using its working directory:
# First, list available windows to find the right one
rpce-cli -e 'windows'
# Then check roots in a specific window (REQUIRED - CLI cannot auto-bind)
rpce-cli -w <window_id> -e 'tree --type roots'
Check the output:
CLI Window Routing:
-w <window_id> to target the correct windowrpce-cli -e 'windows' to list all open windows and their workspaces-w <window_id> in ALL subsequent commandsTranslate the user's prompt into the codebase's actual nouns — concrete modules, filenames, patterns — so builder can focus immediately instead of disambiguating. 1-2 navigation calls (tree or search) is usually enough.
Example:
NetworkService (HTTP wrapper) — see APIClient for the existing auth retry pattern."Shortcuts:
Keep this light — builder handles the deep reading.
rpce-cli -w <window_id> -e 'tree'
rpce-cli -w <window_id> -e 'search "<key term>"'
rpce-cli -w <window_id> -e 'builder "<contextualized task>" --response-type plan --export'
If you can't disambiguate from a quick scan, dispatch a narrow explore agent first:
rpce-cli -w <window_id> -e 'agent_run op=start model_id=explore session_name="Explore: <area>" message="Check <specific thing>"'
Explore agents are cheap — spawn multiple in parallel for different areas, but keep each prompt narrow. They tend to overthink broad instructions.
Once you have a plan — whether generated via builder or provided by the user — you'll want sub-agents to see it. Use export_response:true to write any generated plan to a shareable file. This works on:
context_builder (with response_type: "plan", "question", or "review") — exports the generated responseoracle_send — exports any oracle response, including follow-ups to a context_builder chatFor user-provided plan files, you already have a path — just reference it in dispatch briefs.
The tool returns oracle_export_path and oracle_export_instruction. Include oracle_export_path inside the message you send on your next agent_run start call. The oracle_export_instruction field is a ready-made sentence ("Read the Oracle export at <path> with read_file …") you can emit verbatim at the head of that message. The child agent opens the file with read_file. Do not ask child agents to continue your Oracle chat — they are in different tabs.
The export is a shared document. Sub-agents treat it as read-only context. As the orchestrator, you own this file — use it as a living checklist by updating it (via apply_edits) to mark items complete, note deferred work, or track progress across phases.
# Generate and export the plan, then reference the returned path in agent_run message.
rpce-cli -w <window_id> -e 'builder "<task description>" --response-type plan --export'
rpce-cli -w <window_id> -e 'agent_run op=start model_id=pair session_name="Orchestrate: <goal>" message="Read the plan at <plan path> with read_file first. Implement <work item>."'
Take the plan (from builder or a user-provided plan file) and break it into up to 5 discrete work items.
For each item, note:
Most tasks decompose into 2-3 items — that's the sweet spot. If you're reaching for 4-5, consider whether some items can be combined. If you're beyond 5, you're decomposing too finely — raise the abstraction level.
If the task naturally decomposes into 1 item, skip the orchestration overhead — just dispatch it directly. Don't create ceremony for simple work.
For multi-item work, dispatch a fresh agent per item. The plan file provides continuity — each agent reads it first, sees what's already done, and reasons with a clean context budget.
The pattern is a verify-then-dispatch-fresh loop:
file_search or read_file on key deliverables catches drift before it compounds.Do not fire-and-forget the full list. Catching drift early — before the next agent builds on a flawed foundation — is your value as the orchestrator.
# 1. Dispatch item 1 as a fresh agent
rpce-cli -w <window_id> -e 'agent_run op=start model_id=pair session_name="Orchestrate 1/N: <goal>" message="Read the plan at <plan path> with read_file first. Your job is item 1: <brief>."'
# 2. Verify output, spot-check key files
rpce-cli -w <window_id> -e 'read "<key file from item 1>"'
# 3. Update plan file to record progress
rpce-cli -w <window_id> -e 'call apply_edits {"path":"<plan path>","search":"- [ ] Item 1:","replace":"- [x] Item 1:"}'
# 4. Dispatch item 2 as a new fresh agent
rpce-cli -w <window_id> -e 'agent_run op=start model_id=pair session_name="Orchestrate 2/N: <goal>" message="Read the plan at <plan path> with read_file first. Item 1 is complete. Your job is item 2: <brief>."'
Sometimes it's better to keep a single agent alive and steer it through work. Consider steering when:
To check which model is powering a role:
rpce-cli -w <window_id> -e 'agent_manage op=list_agents roles_only=true'
A role whose display name starts with Codex CLI (or an explicit model_id with a codexExec:* prefix) signals the role is well-suited to extended steering.
When steering, the loop is the same but step 5 becomes agent_run op=steer on the existing session_id instead of a fresh dispatch:
rpce-cli -w <window_id> -e 'agent_run op=steer session_id="<session_id>" message="Item 1 looks good. Moving on to item 2: <brief>" wait=true'
pair — The default for complex work. Architectural decisions, multi-file changes, deep reasoning.engineer — Well-scoped items where the goal and approach are already clear from the plan.design — UI, layout, visual polish, copy/text editing, anything user-facing.explore — Short reconnaissance only (already used in Phase 1 escalation path).Stick to these role labels. The specific model behind a role isn't your concern unless the user names one.
When in doubt, use pair. The tasks reaching this workflow are complex by nature. Use engineer when the plan already makes the path obvious and the item just needs execution.
When questions arise during coordination, reason through them yourself. If you're uncertain, negotiate with the agent already working on the relevant task — it has the deepest context. Steer it with your thinking and work toward consensus rather than dictating a direction.
The agents you dispatch are fully capable — they have tools, they'll read AGENTS.md and project instructions, they can explore and reason. Your job is to orient them, not direct them.
Scope is your most important job. When you pass a plan export, the sub-agent can see the full plan — but it doesn't know which part is its responsibility unless you say so. Always be explicit about what it should do now and what it should leave alone. A few patterns:
message and tell the agent which part to focus on (e.g. "Read the plan at with read_file first. Your job is item 2 in the plan. Items 1 and 3 are handled separately.").You can always steer additional work later, or spin up a separate agent for the next item.
Include: The goal, relevant file paths/modules, and discoveries from planning that the agent wouldn't find on its own. If a separate user plan file exists, point to the relevant section. For small tasks, tell the agent to skip oracle review.
Don't include: Project conventions already in CLAUDE.md, step-by-step instructions, or code snippets the agent can read itself.
Pass forward discoveries, not instructions.
Two conversations, kept separate. You hold one conversation with the user (preferences, course corrections, meta-instructions about how you should behave) and a separate one with each peer agent (purely the technical task). When the user steers you, translate the actionable parts into the next brief — never forward their words verbatim, and never narrate what the user told you about your own conduct. If a brief you already dispatched carried that kind of commentary, cancel it and re-send clean.
If dispatching independent items as fresh agents concurrently, each agent's brief must mention the sibling:
"Another agent is concurrently working on in . Avoid modifying files in that area. If you find yourself blocked by or conflicting with that work, stop and report back rather than pushing through."
Use detach: true when dispatching concurrent items — otherwise the orchestrator blocks on the first agent and can't start the second.
Then pass session_ids (array) to agent_run op=wait to block until the first session finishes or needs input. The response tells you which session won and which are still pending.
# Dispatch both concurrently
rpce-cli -w <window_id> -e 'agent_run op=start model_id=pair session_name="1/N: <goal A>" message="<brief A>" detach=true'
rpce-cli -w <window_id> -e 'agent_run op=start model_id=pair session_name="2/N: <goal B>" message="<brief B>" detach=true'
# Then wait for the first session that needs attention
rpce-cli -w <window_id> -e 'agent_run op=wait session_ids=["<uuid1>","<uuid2>"] timeout=60'
# Or poll all current snapshots without blocking
rpce-cli -w <window_id> -e 'agent_run op=poll session_ids=["<uuid1>","<uuid2>"]'
Handle the finished agent, then wait again on the remaining pending_session_ids. While waiting, summarize completed work or prepare the next brief — be a pipeline, not a sequential loop.
Sessions persist after agents finish — useful when you might revisit output, but they pile up over a multi-agent workflow. Once you've recorded what an agent produced, you can dismiss its session:
rpce-cli -w <window_id> -e 'agent_manage op=cleanup_sessions session_ids=["<session_id>"]'
Explore-agent sessions are good to dismiss right away — narrow reconnaissance, no follow-up value. Keep heavier agent sessions if you might revisit them.
Plan and review exports generated during orchestration (via export_response:true on builder or chat) accumulate under prompt-exports/ as files like oracle-plan-<date>-<slug>.md or oracle-review-<date>-<slug>.md. Once an export has been superseded by a newer plan, consumed by the sub-agent it was meant for, or otherwise made irrelevant by completed work, delete it so the folder reflects only live, in-progress plans. file_actions.delete requires a true absolute filesystem path, not the relative display path shown under prompt-exports/; use get_file_tree with type:"roots" if you need the loaded root's absolute path. When unsure, leave it.
rpce-cli -w <window_id> -e 'call file_actions {"action":"delete","path":"/absolute/path/to/repo/prompt-exports/<stale-export>.md"}'
You own the plan. It's your job to ensure each phase respected it.
As each agent completes:
read_file or file_search on key deliverables costs little and catches drift before it compounds. If the plan said "add error handling to all three endpoints" and the agent only touched two, that's your catch. Mark the item as done (or note gaps) in the export file so you have a running record.rpce-cli -w <window_id> -e 'agent_run op=steer session_id="<session_id>" message="The goal was X but Y appears missing." wait=true'
After all items complete, give the user a final rollup:
| Operation | Tool call |
|---|---|
| Start a fresh agent | agent_run op=start model_id=<role> session_name="..." message="..." detach=true/false |
| Steer an existing agent | agent_run op=steer session_id="..." message="..." wait=true |
| Wait for an agent | agent_run op=wait session_id="..." |
| Wait for first of multiple agents | agent_run op=wait session_ids=["...", "..."] timeout=60 |
| Poll without blocking | agent_run op=poll session_id="..." |
| Poll multiple agents | agent_run op=poll session_ids=["...", "..."] |
| Dismiss a completed session | agent_manage op=cleanup_sessions session_ids=["..."] |
| Read plan/context | read_file, get_file_tree, file_search |
| Reason with oracle | oracle_send — requires file selection from builder |