agentleFS
danielvm-gitdanielvm-git/bigpowers/.cursor/rules/dispatch-agents.mdc

bigpowers / rules

Cursor rule252 starsChanged 3 months agoMITView on GitHub

Dispatch multiple subagents in parallel on independent tasks. No waiting between them — all run concurrently. Use when tasks are truly decoupled and speed matters. Distinct from delegate-task (concurrent here, no inter-task review gate).

The file

We split this dispatch-agents.mdc into the rules it gives an agent

12 rules. About 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run multiple subagents in parallel on independent tasks.

    line 17
  2. Distinctive:

    Before dispatching, verify each task pair is truly independent:

    line 37
  3. Distinctive:

    No shared files being written

    line 38
  4. Distinctive:

    No shared state (DB migrations, config files)

    line 39
  5. Distinctive:

    No ordering dependency between outcomes

    line 40
  6. Very specific:

    If any two tasks conflict, sequence them with delegate-task or execute-plan instead.

    line 42
  7. Very specific:

    Before writing briefs, read specs/state.yaml if it exists — each agent gets only the decisions relevant to its task, nothing else.

    line 58
  8. Distinctive:

    Every inter-agent message uses a typed envelope — no freeform prose between waves:

    line 60
  9. Distinctive:

    Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.

    line 83
  10. Distinctive:

    After each wave completes:

    line 89
  11. Very specific:

    Stop when gaps empty, circuit opens, or cycle 3 reached — escalate to user.

    line 94
  12. Distinctive:

    When all agents return: review each result, run verify commands, check diffs for scope violations.

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
dispatch-agents.mdc
---
description: "Dispatch multiple subagents in parallel on independent tasks. No waiting between them — all run concurrently. Use when tasks are truly decoupled and speed matters. Distinct from delegate-task (concurrent here, no inter-task review gate)."
alwaysApply: false
---

# story: e09s04
# story: e45s38
<!-- story: e45s11 -->


# story: e45s30

# Dispatch Agents
> **HARD GATE** — **HARD GATE** — Agent work must be parallelizable and have explicit synchronization points. Do NOT dispatch work that has hidden dependencies between agents.


Run multiple subagents in parallel on independent tasks. Use when tasks are genuinely decoupled — no agent needs the output of another to start.

**Distinct from `delegate-task`:** This skill maximizes throughput via concurrency. There is no sequential review gate between tasks. Use `delegate-task` instead when a single task needs careful two-stage oversight before proceeding.

## When to use

- Tasks that can run simultaneously without shared state
- Large plans that can be broken into parallel workstreams
- Exploration: gather information from multiple parts of the codebase at once

## When NOT to use

- Task B depends on Task A's output
- You need to review Task A before Task B can start safely
- The tasks share a file and concurrent edits would conflict

## Process

### 1. Confirm independence

Before dispatching, verify each task pair is truly independent:
- No shared files being written
- No shared state (DB migrations, config files)
- No ordering dependency between outcomes

If any two tasks conflict, sequence them with `delegate-task` or `execute-plan` instead.

## Subagent depth tiers (e45s30)

Map `effort:` frontmatter and story `risk:` to prompt depth — do not send `minimal_decisive` agents a `full_maturity` brief.

| Tier | When | Brief shape | Token budget |
|------|------|-------------|----------------|
| `full_maturity` | `effort: heavy`, `risk: P0`, security-sensitive diffs | Full `task_brief` + CONVENTIONS excerpts + threat model if present | Full envelope |
| `standard` | `effort: standard`, `risk: P1`–`P2` | Standard `task_brief` fields below | Default |
| `minimal_decisive` | `effort: light`, `risk: P3`, read-only exploration | `goal` + `verify` + `in_scope` only | ≤15 lines |

Record `depth: <tier>` in the Agent tool description when dispatching.

### 2. Write typed task briefs (Orca message protocol)

Before writing briefs, read `specs/state.yaml` if it exists — each agent gets only the decisions relevant to its task, nothing else.

Every inter-agent message uses a **typed envelope** — no freeform prose between waves:

| `type` | When | Required fields |
|--------|------|-----------------|
| `task_brief` | Dispatch | `task_id`, `goal`, `in_scope`, `out_of_bounds`, `verify`, `prior_decisions` |
| `checkpoint` | Mid-wave progress | `task_id`, `status` (`running`\|`blocked`), `comment` (one line) |
| `result` | Agent return | `task_id`, `exit` (`pass`\|`fail`), `summary`, `verify_output` |
| `circuit_open` | 3 consecutive failures | `task_id`, `failures` (3), `escalate_to` (`user`) |

Example `task_brief` (each agent starts cold — brief size directly controls token cost and hallucination risk):

```yaml
type: task_brief
task_id: agent-1
goal: [one sentence — what success looks like]
in_scope: [explicit file or module list]
out_of_bounds: [what NOT to touch]
verify: [runnable command]
prior_decisions: [relevant entries from specs/state.yaml — omit if none]
```

Emit **`checkpoint`** comments when an agent is slow or blocked — one line, no stack traces. Parent reads checkpoints before spawning follow-ups.

Do not include the full conversation, full file contents, or decisions unrelated to this agent's task.

### 3. Circuit breaker + iterative retrieval (max 3 cycles)

Track **consecutive failures per `task_id`**. On the **3rd consecutive `result.exit: fail`** for the same task, emit `type: circuit_open` and **stop dispatching** that task — escalate to user with the three failure summaries. Reset counter on any `pass`.

After each wave completes:
1. **Dispatch** — run parallel agents with typed `task_brief` envelopes.
2. **Evaluate** — read `result` messages; list gaps vs goal; honor open circuits.
3. **Refine** — tighten briefs or spawn follow-up agents (max **3 cycles** total).

Stop when gaps empty, circuit opens, or cycle 3 reached — escalate to user. If agents go silent without returning, invoke `diagnose-stall` before spawning another wave.

### 4. Dispatch in parallel

Spawn all agents in a single message using multiple Agent tool calls. Each agent gets its own complete brief.

```
Agent 1: brief for task A
Agent 2: brief for task B
Agent 3: brief for task C
```

### 5. Collect and review results

When all agents return: review each result, run verify commands, check diffs for scope violations.

### 6. Integrate

Merge accepted results. Resolve conflicts manually; note in summary.

Report: which tasks succeeded, which need revision, overall verify status.

## Verify
→ verify: `test -f skills/dispatch-agents/SKILL.md && test -f scripts/lib/completeness-critic.sh`

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.