ed3dai/ed3d-plugins/doing-a-simple-two-stage-fanout
Claude Code and agent skill by ed3dai/ed3d-plugins
- community
Checking that the SKILL.md file is still in the repository.
Use when analyzing a large corpus of text, code, or data that exceeds a single agent's effective context - orchestrates parallel Worker subagents, Critic review subagents, and a final Summarizer subagent with task tracking and failure recovery
Install
npx vskill@latest install ed3dai/ed3d-plugins/doing-a-simple-two-stage-fanoutSKILL.md
Two-Stage Fan-Out Analysis
Divide a corpus across Worker subagents, review with Critic subagents, synthesize with a Summarizer. Every stage writes to files; every subagent gets its own task.
Do not use nested subagents. This workflow may dispatch first-level Worker, Critic, and Summarizer subagents. Those subagents must read their assigned inputs, write their outputs, and return directly to the caller. They must not dispatch additional subagents.
Overview
Workers each analyze a slice of the corpus. Critics each review all Worker reports for a subset of segments, checking for gaps and inconsistencies. A single Summarizer reads all Critic reports and produces the final output.
Step 0: Gather Inputs
If the user's intent is not already clear, ask two questions using AskUserQuestion:
Question 1: What to analyze. Ask what corpus to analyze and what the analysis goal is. Skip if obvious from context.
Question 2: Effort level. Present these options in this order (do not reorder to put recommended first):
| Level | SEGMENTS_PER | REVIEWS_PER | When to use | |
|---|---|---|---|---|
| Some effort | 3 | 2 | Default for most analyses | |
| A lot of effort | 3 | 3 | When thoroughness matters more than speed | |
| Herculean effort | 2 | 3 | When you cannot afford to miss anything |
Recommend one if you have enough context, by appending "(Recommended)" to that option's label. But keep the options in the order shown above regardless.
Definitions:
SEGMENTS_PER— how many corpus segments each Worker processesREVIEWS_PER— how many independent Critic reviews each segment receives
Step 1: Compute the Layout
You need to determine how many segments, workers, and critics the analysis requires. This depends on corpus size and agent context capacity.
Estimating Corpus Size
If you have file paths, estimate tokens:
- Prose: 1 token per 4 characters
- Source code: 1 token per 3 characters
- By word count: 1 word is roughly 1.33 tokens
Use the Bash tool to count characters: wc -c file1 file2 ... or find /path -type f -exec cat {} + | wc -c.
For more precise estimates, run the compute_layout.py script bundled with this skill:
Computing Manually
If you cannot run the script, compute by hand. Use the Bash tool with `python3 -c "..."` for all arithmetic — do not compute in your head.
Agent capacity:
Segment count:
If CORPUS_TOKENS <= SEGMENT_BUDGET, then SEGMENT_COUNT = 1 (no fan-out needed).
Agent counts:
What These Numbers Mean
- Each Worker reads
SEGMENTS_PERconsecutive segments of raw corpus and writes an analysis report. - Each Critic reads all Worker reports that cover a subset of segments and writes a review.
- Each segment gets reviewed by
REVIEWS_PERdifferent Critics (redundancy for thoroughness).
Assigning Critics to Segments
The critic count tells you how many critics to create, but you also need to decide which segments each critic reviews. Use round-robin assignment to distribute REVIEWS_PER critic passes evenly across segments:
In practice, use python3 -c "..." to generate the assignment table. Example for 6 segments, 4 critics, REVIEWS_PER=2:
Each segment appears in exactly 2 critics' lists. Each critic reads the Worker reports that cover its assigned segments. Include this assignment table in the orchestration plan so the mapping is explicit and verifiable.
Step 2: Set Up the Temp Directory
If the user specified a working directory, use it. Otherwise, create one:
All paths in prompts and file references are absolute paths. Subagents cannot resolve relative paths reliably.
Step 3: Enter Plan Mode and Write the Orchestration Plan
Enter plan mode. Write a plan document that includes:
- Layout summary: corpus size, segment count, worker count, critic count, effort level
- Fan-out diagram: a Mermaid diagram showing the pipeline (see diagram-templates.md for syntax). For large layouts (>10 workers), collapse worker ranges (e.g.,
W01-W10) into summary nodes. If the user requests Graphviz instead, use the DOT template from the same file. - Worker assignment table: which segments each Worker handles (e.g.,
W01: S01-S03) - Critic assignment table: which segments each Critic reviews, generated using the round-robin method from Step 1. Verify that each segment appears exactly
REVIEWS_PERtimes across all critics. - Stage descriptions: for each stage (Workers, Critics, Summarizer), describe what agents will do, their input/output paths, and which agents run in parallel
- File layout: show the directory tree that will be produced
Do not include time estimates in the plan. Agent execution time is unpredictable and estimates are misleading.
Exit plan mode. Do not proceed until the user approves the plan.
Diagram Guidelines
Worker nodes should show their segment assignments: W01<br/>S01-S03. Critic nodes show their review scope. Cap visible nodes at ~15; collapse ranges for larger layouts. See diagram-templates.md for full Mermaid and Graphviz templates with styling.
Step 4: Create All Tasks
Before launching any subagents, create ALL tasks upfront using TaskCreate:
- One task per Worker (
W01,W02, ...) - One task per Critic (
C01,C02, ...) - One task for the Summarizer
Then set up dependencies with TaskUpdate addBlockedBy:
- Each Critic task is blocked by the Worker tasks whose segments it reviews
- The Summarizer task is blocked by all Critic tasks
This creates the full dependency graph before any work starts.
Step 5: Launch Workers
Mark Worker tasks as in_progress, then launch all Workers in parallel (one Task tool call per worker, all in the same message).
Worker Prompt Template
Each Worker gets a prompt structured like this:
Adapt the analysis goal and output format to match what the user asked for. The template above is a starting point — be specific about what constitutes a "finding" for this particular analysis.
After Workers Complete
Verify each worker wrote its output file:
Mark completed Worker tasks as completed. If any Worker failed or did not produce output, see Failure Recovery below.
Step 6: Launch Critics
Mark Critic tasks as in_progress, then launch all Critics in parallel.
Critic Prompt Template
After Critics Complete
Verify output files and mark tasks completed. Handle failures per Failure Recovery.
Step 7: Launch Summarizer
Mark the Summarizer task as in_progress. Launch a single Summarizer subagent.
Summarizer Prompt Template
The Summarizer should return a brief (2-3 sentence) summary of findings to you, and defer the full explanation to the written file. Return the file path to the user.
Failure Recovery
Context Limit Failures
If a subagent fails because it hit its context limit:
- Split its work in half.
- For Workers: create two new workers with half the segments each. Name them by appending a letter:
W03a,W03b. - For Critics: create two new critics with half the review scope. Name them
C01a,C01b. - Create new tasks for the split agents, with the same dependencies as the original.
- Mark the original task as
completed(it was replaced, not failed). - Launch the new agents.
Missing Output Files
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/ed3d-basic-agents/skills/doing-a-simple-two-stage-fanout/SKILL.md
Popularity
- Repository stars
- 158
- Repository forks
- 18
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ed3dai/ed3d-plugins/doing-a-simple-two-stage-fanout)