analyzing-codebases
Detects project languages and monorepo state, runs language-appropriate static analysis (dependency graph, complexity, duplication, semantic patterns), and…
Fans out work across multiple agents — same prompt to many for Best-of-N, different prompts for parallel exploration, or a scout before committing. Use when user says "parallel agents", "fan out", "best of N", "scout", "race", "vote", "spawn workers".
$ npx -y skills add wayne930242/Reflexive-Claude-Code --skill dispatching-parallel-agents --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dispatching-parallel-agentsContext preview
The summary Claude sees to decide when to auto-load this skill.
Fans out work across multiple agents — same prompt to many for Best-of-N, different prompts for parallel exploration, or a scout before committing. Use when user says "parallel agents", "fan out", "best of N", "scout", "race", "vote", "spawn workers".
name: dispatching-parallel-agents description: Fans out work across multiple agents — same prompt to many for Best-of-N, different prompts for parallel exploration, or a scout before committing. Use when user says "parallel agents", "fan out", "best of N", "scout", "race", "vote", "spawn workers".
**Dispatching parallel agents IS trading compute for confidence or throughput.**
A single Agent call is one bet. N Agent calls in one message is N bets — they execute concurrently and you pick or merge. The runtime fans out automatically when multiple Agent tool uses appear in a single response; serializing by mistake (one Agent call per response) wastes the entire benefit.
**Core principle:** Parallelism is a property of the dispatch (one message, N tool uses), not of the agents themselves.
Follow [task initialization protocol](../../references/task-initialization.md).
**Tasks:** 0. Classify the dispatch pattern 1. Choose agents and inputs 2. Fan out in a single message 3. Merge results 4. Report to user
Announce: "Created 5 tasks (0–4). Starting execution..."
**Goal:** Pick exactly one pattern. Mixing patterns = confused merge step.
| Pattern | When | Inputs | Merge strategy | |---------|------|--------|----------------| | **P-Thread** (parallel, divergent) | Independent subtasks, each agent owns a slice | N **different** prompts | Concatenate — each result stands alone | | **F-Thread** (Best-of-N, fusion) | One hard question, want confidence or cherry-pick | N **identical** prompts | Vote / diff / cherry-pick | | **Scout** (throw-away recon) | Unfamiliar territory, want to learn before committing | One scout prompt, **discard the code** | Read scout's findings → write better main prompt | | **B-Thread** (nested orchestrator) | One sub-agent dispatches further sub-agents | Single Agent call to an orchestrator agent | Orchestrator handles its own merge |
**Anti-patterns:**
**Verification:** Can name the pattern in one word and justify it in one sentence.
**Goal:** Pick the agent type per call and the prompts.
**Agent selection:**
| Need | Use | |------|-----| | Read-only research | `Explore` (Haiku, fast, no Write/Edit) | | Planning | `Plan` | | Code review (F-Thread voting) | Project reviewer agents (e.g. `rcc:skill-reviewer`) | | General multi-step | `general-purpose` |
**Prompt design for fanout:**
**Tool set:** Pass minimal tools. Fanout amplifies any tool the agent has — five Edits in parallel = five chances to corrupt the same file.
**Verification:** Each prompt readable cold, no implicit context, tool set scoped.
**Goal:** Issue all N Agent calls in **one assistant turn**.
**Why this matters:** the runtime parallelizes tool uses within a single message. Splitting across turns serializes them and you pay round-trip latency × N.
**Correct shape:**
[one assistant message] Agent(prompt=A, ...) Agent(prompt=B, ...) Agent(prompt=C, ...)
**Wrong shape (serial):**
[message 1] Agent(A) → wait → [message 2] Agent(B) → wait → ...
**Background flag:** for long-running fans (>2 min each), set `run_in_background: true` so the main turn doesn't block. The runtime notifies on completion.
**Verification:** All Agent calls visible in a single assistant message.
**Goal:** Collapse N outputs into one decision or report.
**Merge strategies by pattern:**
| Pattern | Strategy | |---------|----------| | **P-Thread** | Concatenate sections. Each agent owned a slice; the slices compose. | | **F-Thread (vote)** | Count agreement. ≥ ⌈N/2⌉+1 agree → that answer wins. Disagreement → escalate to user. | | **F-Thread (diff)** | Show user the N outputs side-by-side. User picks or cherry-picks. | | **F-Thread (cherry-pick)** | Take the strongest part of each — only when outputs are structured (e.g. YAML lists you can union). | | **Scout** | Discard scout's code. Extract the **lessons** (files touched, blockers found) into the next prompt. |
**Reviewer F-Thread special case:**
When voting reviewer agents (e.g. 3× `rcc:skill-reviewer`), if YAML outputs disagree on `pass`, the safe default is **fail** — any reviewer flagging an issue counts.
**Verification:** A single artifact (decision, file, report) emerges from N inputs.
**Goal:** Make the parallel dispatch legible.
**Report shape:**
**Verification:** User can audit which agent said what without re-running.
These thoughts mean you're rationalizing. STOP and reconsider:
A Claude Code plugin marketplace for skills-driven Agentic Context Engineering (ACE) — build, analyze, and maintain agent systems with structured workflows.
Repo: wayne930242/Reflexive-Claude-Code
Detects project languages and monorepo state, runs language-appropriate static analysis (dependency graph, complexity, duplication, semantic patterns), and…
Executes a refactor plan phase-by-phase on a dedicated branch with per-phase commits and mandatory reviewer checkpoints. Use when characterization-tests…
Writes AGENTS.md per subproject, archives run artifacts, and suggests rcc handoff conditionally. Use when verifying-refactors passes (PASS or…
Converts a refactor map into a phased plan using parallel-change, branch-by-abstraction, or strangler fig patterns. Use when user has approved the refactor map…
Adds golden/snapshot tests to untested hotspot modules before refactoring. Use when refactor plan marks any phase with…
Validates hard structural rules (no cycles, file/fn line caps, cognitive/cyclomatic complexity) and runs mutation testing on touched modules. Use when…