Skip to content

Commit 57cef21

Browse files
Add multi-agent orchestration docs, update integrations, install, best practices, and workflows (#3)
* Add multi-agent orchestration docs, update integrations, install, best practices, and workflows - Task 1: Create plans/workflows/multi-agent.mdx with full orchestration docs - Task 2: Rewrite integrations overview with cloud vs launcher agent distinction - Task 3: Add agent orchestration tools and GitHub tools to MCP install page - Task 4: Update best practices with new Manual topics and MCP install guidance - Task 5: Add Agent Orchestration workflow section to workflows overview Co-Authored-By: Matt Dailey <matt@ref.tools> * Fix indentation in docs.json Workflows group Co-Authored-By: Matt Dailey <matt@ref.tools> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Matt Dailey <matt@ref.tools>
1 parent 02d3660 commit 57cef21

6 files changed

Lines changed: 214 additions & 13 deletions

File tree

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"group": "Workflows",
128128
"pages": [
129129
"plans/workflows/overview",
130+
"plans/workflows/multi-agent",
130131
"plans/workflows/claude-code-hook"
131132
]
132133
},

plans/getting-started/best-practices.mdx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,32 @@ Plans are collaborative documents. Use comments in the chat panel to:
4646

4747
## Using Manual tool topics
4848

49-
Ref's agent has built-in knowledge about plan structure. You can use these topics in the chat panel:
49+
Ref's agent has built-in knowledge about plan structure and workflows. You can use these topics in the chat panel via the `Manual` tool:
5050

5151
- **`structure-a-plan`** — Ask the agent to organize your rough notes into a well-structured plan
5252
- **`update-a-plan`** — Ask the agent to revise the plan based on new information or progress
53+
- **`read-code-or-docs`** — Guidance on researching code and documentation using Ref tools before writing or updating plans
54+
55+
### Role-based topics
56+
57+
These topics are primarily used by the system during [multi-agent orchestration](/plans/workflows/multi-agent), but you can reference them directly too:
58+
59+
- **`role-orchestrator`** — Workflow guidance for orchestrator agents managing teams of implementation and review agents. Covers how to launch agents, coordinate via messaging, and update the plan after merges.
60+
- **`role-implementer`** — Workflow guidance for coding agents creating PRs. Covers rules for implementation agents: focus on code, message parent with PR URL when done, don't update the plan.
61+
- **`role-reviewer`** — Workflow guidance for agents reviewing PRs. Covers how to use GitHub tools (`ReadPR`, `ReviewPR`, `MergePR`) to review diffs, approve, and report results to the orchestrator.
62+
63+
## Install the MCP server in all your agents
64+
65+
For the best results, install the Ref Plans MCP server in every coding agent you use — Cursor, Claude Code, Devin, and any others. This ensures:
66+
67+
- **Full plan context** — Agents can read the plan directly instead of relying on a pasted prompt snippet
68+
- **Progress updates** — Agents can update the plan with progress and mark tasks complete as they work
69+
- **Built-in guidance** — Agents can use the `Manual` tool for workflow guidance
70+
- **Orchestration support** — Agents can communicate with the orchestrator via `SendMessage` during multi-agent workflows
71+
72+
Without the MCP server, agents only see the initial prompt you send them. With it, they have access to the full plan, can report back, and can coordinate with other agents.
73+
74+
See the [installation guide](/plans/install/index) for setup instructions for each agent.
5375

5476
<Columns cols={2}>
5577
<Card icon="arrow-right" title="Workflows" href="/plans/workflows/overview">

plans/install/index.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,46 @@ https://api.plan.ref.tools/mcp?teamId=<TEAM_ID>
5656
- `List` — List your plans
5757
- `Create` — Create a new plan
5858

59+
### Agent orchestration tools
60+
61+
When agent orchestration is enabled in Factory Settings, these additional tools become available in both plan-specific and general mode:
62+
63+
- `LaunchAgent` — Launch a sub-agent on Cursor, Devin, or ref-thread to work in parallel. Specify the harness type, a prompt with full context, and the plan IDs to associate the agent with.
64+
- `SendMessage` — Send messages to child agents or back to a parent agent. Used for coordination — child agents report completion (with PR URLs), and parents send follow-up instructions.
65+
66+
These tools require:
67+
1. **Factory Settings enabled** — Go to **Settings > Factory MCP** at [plan.ref.tools](https://plan.ref.tools) and toggle on the master switch
68+
2. **Per-harness toggles** — Enable the specific harnesses you want to use (Cursor, Devin)
69+
3. **API keys configured** — Set up Cursor and/or Devin API keys in **Settings > Agent Settings**
70+
71+
The Factory Settings page also provides a ready-to-paste MCP config snippet for connecting your orchestrating agent.
72+
73+
See the [multi-agent orchestration guide](/plans/workflows/multi-agent) for full details on using these tools.
74+
75+
### GitHub tools
76+
77+
A separate set of MCP tools for working with GitHub issues and pull requests is available at:
78+
79+
```
80+
https://api.plan.ref.tools/github-mcp
81+
```
82+
83+
These tools are available when GitHub is connected and repos are indexed:
84+
85+
- `GetIssue` — Get issue details and comments from an indexed repository
86+
- `CommentOnIssue` — Post a comment on a GitHub issue
87+
- `SearchIssues` — Search issues in an indexed repository
88+
- `ReadPR` — Read PR details, list changed files, and read diffs for specific files
89+
- `ReviewPR` — Submit a review (approve, request changes, comment) on a PR
90+
- `MergePR` — Merge a PR or mark a draft PR as ready for review
91+
- `SearchPRs` — Search pull requests in an indexed repository
92+
93+
These tools require:
94+
1. **GitHub account connected** at [ref.tools/resources](https://ref.tools/resources)
95+
2. **Repos added** — Add the repositories you want to use with GitHub tools
96+
97+
`ReviewPR` and `MergePR` availability depends on your GitHub permissions settings. See the [GitHub integration page](/plans/integrations/github) for setup details.
98+
5999
---
60100

61101
## Installation Guides

plans/integrations/overview.mdx

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,37 @@ description: "Connect Ref Plans to coding agents and external services."
55

66
Ref Plans integrates with coding agents (where you send tasks for implementation) and context sources (where you pull planning context from).
77

8-
## Agent destinations
8+
## Cloud agents (API-based)
99

10-
When a task is ready, you can send it to one of these agents to implement the code:
10+
Cloud agents connect directly through API keys. Ref launches the agent and tracks its progress automatically — no manual intervention required. These agents can also be launched programmatically by an orchestrator agent via the [`LaunchAgent`](/plans/workflows/multi-agent) MCP tool as part of [multi-agent orchestration](/plans/workflows/multi-agent).
1111

12-
| Agent | Type | Description |
13-
| --- | --- | --- |
14-
| [Cursor Background Agents](/plans/integrations/cursor) | API | Launches a Cursor background agent via API key |
15-
| [Devin](/plans/integrations/devin) | API | Launches a Devin session via API key |
16-
| [Claude Code Web](/plans/integrations/claude-code-web) | Webhook | Sends task to Claude Code in the cloud |
17-
| [Codex](/plans/integrations/codex) | Webhook | Sends task to OpenAI Codex |
18-
| Cursor Local | Webhook | Sends task to your local Cursor instance |
19-
| Copy & Paste | Webhook | Copies the task prompt for manual use in any agent |
12+
| Agent | Description |
13+
| --- | --- |
14+
| [Cursor Background Agents](/plans/integrations/cursor) | Launches a Cursor background agent via API key. Writes code, creates branches, and opens PRs. |
15+
| [Devin](/plans/integrations/devin) | Launches a Devin session via API key. Writes code, creates branches, and opens PRs. |
16+
17+
Cloud agents provide:
18+
- **Automatic launch** — Ref starts the agent session for you
19+
- **Status tracking** — Progress updates flow back to Ref automatically
20+
- **Orchestration support** — Can be launched by an orchestrator agent via `LaunchAgent` with `harness: "cursor"` or `harness: "devin"`
21+
22+
Configure API keys in **Settings > Agent Settings** at [plan.ref.tools](https://plan.ref.tools).
2023

21-
**API-based agents** connect directly through API keys. Ref launches the agent and tracks its progress automatically.
24+
## Launcher agents (webhook-based)
25+
26+
Launcher agents work by appending progress-reporting instructions (curl commands) to the task prompt. You initiate the agent session yourself, and the agent reports back to Ref by executing the webhook commands included in the prompt.
27+
28+
| Agent | Description |
29+
| --- | --- |
30+
| [Claude Code Web](/plans/integrations/claude-code-web) | Sends task to Claude Code in the cloud |
31+
| [Codex](/plans/integrations/codex) | Sends task to OpenAI Codex |
32+
| Cursor Local | Sends task to your local Cursor instance |
33+
| Copy & Paste | Copies the task prompt for manual use in any agent |
2234

23-
**Webhook-based agents** work by appending progress-reporting instructions to the task prompt. The agent reports back to Ref via curl commands included in the prompt.
35+
Launcher agents require you to:
36+
1. Click **Launch Agent** in the plan UI to generate the prompt
37+
2. Start the agent session yourself (or paste the prompt)
38+
3. The agent executes the embedded webhook commands to report progress back to Ref
2439

2540
## Context sources
2641

plans/workflows/multi-agent.mdx

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: "Multi-Agent Orchestration"
3+
description: "Launch and coordinate multiple coding agents working in parallel from a single plan."
4+
---
5+
6+
import GetHelp from '/snippets/get-help.mdx';
7+
8+
Multi-agent orchestration lets a Ref agent (the orchestrator) spawn sub-agents on Cursor, Devin, or internal ref-threads, send them messages, and receive updates back — all via MCP tools. This is the most automated way to use Ref Plans.
9+
10+
## How it works
11+
12+
An orchestrator agent reads your plan, then launches child agents to implement and review tasks in parallel. The agents communicate through a parent/child messaging system — no polling required.
13+
14+
```mermaid
15+
graph TD
16+
A[Orchestrator Agent] -->|LaunchAgent: cursor| B[Cursor Agent - Task 1]
17+
A -->|LaunchAgent: devin| C[Devin Agent - Task 2]
18+
B -->|SendMessage: PR URL| A
19+
C -->|SendMessage: PR URL| A
20+
A -->|LaunchAgent: ref-thread| D[Reviewer Agent]
21+
D -->|SendMessage: Review results| A
22+
```
23+
24+
## The tools
25+
26+
Two MCP tools power orchestration:
27+
28+
### LaunchAgent
29+
30+
Launches a sub-agent to work in parallel. Available harness types:
31+
32+
| Harness | Use for | What it does |
33+
| --- | --- | --- |
34+
| `cursor` | Implementation tasks | Launches a Cursor background agent that writes code and creates PRs |
35+
| `devin` | Implementation tasks | Launches a Devin session that writes code and creates PRs |
36+
| `ref-thread` | Review and lightweight tasks | Launches an internal Ref agent that can read PRs, review diffs, approve, and merge |
37+
38+
Key parameters:
39+
- **`planIds`** — Plan IDs the agent should be associated with
40+
- **`prompt`** — The complete task request with all context, requirements, and instructions
41+
- **`harness`** — Where to run the agent: `cursor`, `devin`, or `ref-thread`
42+
- **`taskShortDescription`** — Brief label for the agent (~10 words)
43+
- **`repo`** / **`branch`** / **`model`** — Optional overrides (Cursor only)
44+
45+
### SendMessage
46+
47+
Sends a message between parent and child agents. This is how agents communicate:
48+
49+
- **Child agents** MUST message their parent when work is complete (including the PR URL) or when stuck
50+
- **Parent agents** use this to send follow-up instructions or course corrections
51+
52+
Parameters:
53+
- **`agentId`** — The agent to send the message to
54+
- **`message`** — The message content
55+
56+
## Typical workflow
57+
58+
<Steps>
59+
<Step title="Plan">
60+
Research and iterate on your plan in the web client or via MCP. Break work into tasks that can be implemented independently.
61+
</Step>
62+
<Step title="Orchestrate">
63+
An orchestrator agent reads the plan and launches implementation agents (Cursor, Devin) in parallel via `LaunchAgent`. Each agent gets a self-contained prompt with all the context it needs.
64+
</Step>
65+
<Step title="Review">
66+
As implementation agents finish and report back with PR URLs, the orchestrator launches `ref-thread` agents to review each PR. Reviewers have access to GitHub tools (`ReadPR`, `ReviewPR`, `MergePR`) to inspect diffs and approve.
67+
</Step>
68+
<Step title="Merge and update">
69+
Once reviewers approve, they merge the PRs (if permitted). The orchestrator updates the plan to mark tasks complete. Repeat until the plan is done.
70+
</Step>
71+
</Steps>
72+
73+
## Example session
74+
75+
Here's what a typical orchestration session looks like:
76+
77+
1. The orchestrator reads the plan and identifies three independent tasks
78+
2. It launches two Cursor agents for Task 1 and Task 2 in parallel, and a Devin agent for Task 3
79+
3. Task 1's agent finishes first and messages back: *"Task complete. PR: https://github.com/org/repo/pull/42"*
80+
4. The orchestrator launches a ref-thread reviewer to review PR #42
81+
5. Task 2's agent finishes and messages back with its PR URL
82+
6. The reviewer approves and merges PR #42, then messages the orchestrator with results
83+
7. The orchestrator updates the plan, marking Task 1 complete
84+
8. The process continues until all tasks are implemented, reviewed, and merged
85+
86+
## Harness selection guide
87+
88+
**Use `cursor` or `devin` for implementation** — these agents write code, create branches, and open PRs. Choose based on which service you have configured and prefer.
89+
90+
**Use `ref-thread` for reviews** — ref-thread agents have access to GitHub PR tools (`ReadPR`, `ReviewPR`, `MergePR`, `SearchPRs`) that Cursor and Devin agents do not. Always use ref-thread for PR review tasks.
91+
92+
## Requirements
93+
94+
To use multi-agent orchestration, you need:
95+
96+
1. **Ref Plans MCP server installed** in your orchestrating agent — see the [install guide](/plans/install/index)
97+
2. **Agent orchestration enabled** in [Factory Settings](https://plan.ref.tools/settings) — toggle on the master switch and enable the harnesses you want to use
98+
3. **API keys configured** for Cursor and/or Devin in [Agent Settings](https://plan.ref.tools/settings) — required for `cursor` and `devin` harnesses
99+
4. **GitHub connected** at [ref.tools/resources](https://ref.tools/resources) — required for ref-thread reviewers to access PR tools
100+
101+
## Parent/child messaging rules
102+
103+
- Child agents **must** message their parent when done (include the PR URL if one was created) or when stuck
104+
- Parents can send follow-up instructions or corrections to any child via `SendMessage`
105+
- Agents can only message their direct parent or their own children — no cross-communication
106+
- The workflow is message-driven: after launching agents, wait for messages rather than polling
107+
108+
<GetHelp/>

plans/workflows/overview.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ Use Ref as your main driver and orchestrator. This is a two-phase workflow:
2222
allowFullScreen
2323
></iframe>
2424

25+
## Agent Orchestration
26+
27+
For fully automated multi-agent workflows. An orchestrator agent manages the entire cycle — launching implementation agents, coordinating reviews, and merging PRs — with minimal human intervention.
28+
29+
1. **Plan** — Research and iterate on the plan in the web client or via MCP.
30+
2. **Orchestrate** — An orchestrator agent launches implementation agents (Cursor, Devin) in parallel via `LaunchAgent`. Each agent gets a self-contained prompt with all context.
31+
3. **Review** — The orchestrator launches `ref-thread` agents to review PRs. Reviewers read diffs, approve, and report back.
32+
4. **Merge** — Ref agents merge approved PRs. The orchestrator updates the plan and repeats until done.
33+
34+
This builds on "Plan and Polish" by automating the launch, review, and merge phases. It requires the MCP server installed, agent API keys configured, and Factory Settings enabled.
35+
36+
<Card icon="robot" title="Multi-Agent Orchestration Guide" href="/plans/workflows/multi-agent">
37+
Full guide to launching and coordinating multiple agents from a plan.
38+
</Card>
39+
2540
## Linear / GitHub-driven planning
2641

2742
Pull context from your project management tools directly into your plans.

0 commit comments

Comments
 (0)