Logo van Doing A Simple Two Stage Fanout

Doing A Simple Two Stage Fanout

Organisatie
ed3dai
doing-a-simple-two-stage-fanout

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

Overzicht

Uitgevered3dai
Repositoryed3d-plugins
Skillnaamdoing-a-simple-two-stage-fanout
Sterren
249
Forks
33
Meegeleverde bestanden
2
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 2

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door ed3dai op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Doing A Simple Two Stage Fanout in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/ed3dai/ed3d-plugins/tree/main/plugins/ed3d-basic-agents/skills/doing-a-simple-two-stage-fanout
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ed3dai/ed3d-plugins.git /tmp/ed3d-plugins
mkdir -p .claude/skills
cp -r /tmp/ed3d-plugins/plugins/ed3d-basic-agents/skills/doing-a-simple-two-stage-fanout .claude/skills/doing-a-simple-two-stage-fanout
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Doing A Simple Two Stage Fanout in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Doing A Simple Two Stage Fanout automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Doing A Simple Two Stage Fanout niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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

Corpus → [Workers] → [Critics] → Summarizer → Report

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):

LevelSEGMENTS_PERREVIEWS_PERWhen to use
Some effort32Default for most analyses
A lot of effort33When thoroughness matters more than speed
Herculean effort23When 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 processes
  • REVIEWS_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:

bash
python3 /path/to/compute_layout.py --corpus-chars 800000 --segments-per 3 --reviews-per 2
python3 /path/to/compute_layout.py --corpus-files file1.txt file2.txt --segments-per 3 --reviews-per 2
python3 /path/to/compute_layout.py --corpus-tokens 200000 --segments-per 3 --reviews-per 2 --json

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:

AGENT_CONTEXT  = 200,000 tokens
RESERVED       = 35%  (for prompt, reasoning, output)
AVAILABLE      = AGENT_CONTEXT * 0.65 = 130,000 tokens
SEGMENT_BUDGET = AVAILABLE / SEGMENTS_PER

Segment count:

OVERLAP  = 10% of SEGMENT_BUDGET
STRIDE   = SEGMENT_BUDGET - OVERLAP
SEGMENT_COUNT = ceil((CORPUS_TOKENS - SEGMENT_BUDGET) / STRIDE) + 1

If CORPUS_TOKENS <= SEGMENT_BUDGET, then SEGMENT_COUNT = 1 (no fan-out needed).

Agent counts:

WORKER_COUNT = ceil(SEGMENT_COUNT / SEGMENTS_PER)
TOTAL_CRITIC_ASSIGNMENTS = SEGMENT_COUNT * REVIEWS_PER
CRITIC_COUNT = ceil(TOTAL_CRITIC_ASSIGNMENTS / SEGMENTS_PER)

What These Numbers Mean

  • Each Worker reads SEGMENTS_PER consecutive 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_PER different 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:

For each segment S (1 to SEGMENT_COUNT):
    Assign REVIEWS_PER different critics to review S
    Rotate through critics: critic index = (S * review_pass + offset) % CRITIC_COUNT

In practice, use python3 -c "..." to generate the assignment table. Example for 6 segments, 4 critics, REVIEWS_PER=2:

C01 reviews: S01, S03, S05
C02 reviews: S02, S04, S06
C03 reviews: S01, S04, S06
C04 reviews: S02, S03, S05

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:

bash
WORK_DIR=$(mktemp -d -t fanout-XXXXXX)
mkdir -p "$WORK_DIR/segments" "$WORK_DIR/workers" "$WORK_DIR/critics"

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:

  1. Layout summary: corpus size, segment count, worker count, critic count, effort level
  2. 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.
  3. Worker assignment table: which segments each Worker handles (e.g., W01: S01-S03)
  4. Critic assignment table: which segments each Critic reviews, generated using the round-robin method from Step 1. Verify that each segment appears exactly REVIEWS_PER times across all critics.
  5. Stage descriptions: for each stage (Workers, Critics, Summarizer), describe what agents will do, their input/output paths, and which agents run in parallel
  6. 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:

You are {WORKER_NAME}, a corpus analysis worker.

## Your Assignment
Analyze segments {FIRST_SEG} through {LAST_SEG} of the corpus.

## Input
Read these files:
- {ABSOLUTE_PATH_TO_SEGMENT_FILE_1}
- {ABSOLUTE_PATH_TO_SEGMENT_FILE_2}
- ...

## Analysis Goal
{WHAT_THE_USER_WANTS_ANALYZED}

## Output Format
Write your report to: {ABSOLUTE_PATH_TO_WORK_DIR}/workers/{WORKER_NAME}.md

Structure your report as:

### Summary
2-3 sentence overview of findings for your segments.

### Detailed Findings
For each significant finding:
- **Finding**: one-line description
- **Location**: file/section where found
- **Evidence**: relevant quote or reference
- **Significance**: why this matters

### Segment Coverage
List each segment you analyzed and confirm you read it completely.
If any segment was too large to process fully, state which parts you skipped.

Do not dispatch or invoke any subagents.

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:

bash
ls -la "$WORK_DIR/workers/"

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

You are {CRITIC_NAME}, reviewing Worker analyses for segments {SEG_RANGE}.

## Input
Read these Worker reports:
- {ABSOLUTE_PATH_TO_WORK_DIR}/workers/{WORKER_1}.md
- {ABSOLUTE_PATH_TO_WORK_DIR}/workers/{WORKER_2}.md
- ...

## Your Task
1. Read all Worker reports listed above.
2. Evaluate completeness: did the Workers cover their segments thoroughly?
3. Identify cross-segment patterns the Workers may have missed individually.
4. Flag contradictions between Worker reports.
5. Note any gaps — segments or topics that were under-analyzed.

## Output Format
Write your review to: {ABSOLUTE_PATH_TO_WORK_DIR}/critics/{CRITIC_NAME}.md

Structure your review as:

### Cross-Segment Patterns
Themes or findings that span multiple Workers' segments.

### Quality Assessment
For each Worker report you reviewed:
- Coverage: complete / partial / insufficient
- Accuracy: any factual issues or misinterpretations

### Gaps and Contradictions
Anything missing or conflicting across reports.

### Consolidated Key Findings
The most important findings from the segments you reviewed, after accounting for quality.

Do not dispatch or invoke any subagents.

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

You are the Summarizer, producing the final analysis report.

## Input
Read all Critic reviews:
- {ABSOLUTE_PATH_TO_WORK_DIR}/critics/{CRITIC_1}.md
- {ABSOLUTE_PATH_TO_WORK_DIR}/critics/{CRITIC_2}.md
- ...

You may also reference Worker reports for detail:
- {ABSOLUTE_PATH_TO_WORK_DIR}/workers/*.md

## Your Task
Synthesize all Critic reviews into a single cohesive report. Prioritize the Critics' consolidated findings and cross-segment patterns.

## Output
Write the final report to: {ABSOLUTE_PATH_TO_WORK_DIR}/final-report.md

Structure:

### Executive Summary
3-5 sentences: what was analyzed, what was found, what matters most.

### Key Findings
The most significant findings, ordered by importance. Each finding should include supporting evidence from the Critic and Worker reports.

### Detailed Analysis
Full narrative organized by theme or topic.

### Methodology Notes
- Corpus size, segment count, agent layout
- Any gaps, failures, or limitations encountered during analysis

### Appendix
- List of all Worker and Critic reports with paths

Do not dispatch or invoke any subagents.

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:

  1. Split its work in half.
  2. For Workers: create two new workers with half the segments each. Name them by appending a letter: W03a, W03b.
  3. For Critics: create two new critics with half the review scope. Name them C01a, C01b.
  4. Create new tasks for the split agents, with the same dependencies as the original.
  5. Mark the original task as completed (it was replaced, not failed).
  6. Launch the new agents.

Missing Output Files

If a subagent completes but its output file does not exist:

  1. Retry once with the same prompt.
  2. If it fails again, note the gap in the Summarizer prompt so it can account for missing coverage.

Stuck Detection

If you have retried the same agent 3 times with similar failures, stop. Report what you expected, what happened, and what assumption might be wrong. Do not keep retrying.

Quick Reference

ParameterSome EffortA Lot of EffortHerculean
SEGMENTS_PER332
REVIEWS_PER233
Agent context reserved35%35%35%
Segment overlap10%10%10%
Default agent typesonnet-general-purposesonnet-general-purposesonnet-general-purpose
Agent NamingConvention
WorkersW01, W02, ... W99
Split workersW03a, W03b
CriticsC01, C02, ... C99
Split criticsC01a, C01b
Summarizer(just "Summarizer")

Absolute Path Rule

Every file path in every subagent prompt is an absolute path. Subagents do not inherit your working directory. If you write /tmp/fanout-abc123/workers/W01.md, that exact string appears in the prompt — never ./workers/W01.md or workers/W01.md.

Checklist

Create a task (TaskCreate) for every item below. Mark each in_progress before starting it, completed after finishing. Do not skip items or batch them.

  • Ask user for analysis goal (or confirm from context)
  • Ask user for effort level
  • Estimate corpus size (use Bash wc -c for character counts)
  • Compute layout (run compute_layout.py or use Bash python3 -c "..." — never mental math)
  • Generate critic-to-segment assignment table (use python3 -c "...")
  • Create temp directory with segments/, workers/, critics/ subdirectories
  • Enter plan mode and write orchestration plan with diagram, assignment tables, and file layout
  • Exit plan mode and get user approval
  • Create all subagent tasks (one per Worker, Critic, Summarizer) with dependencies
  • Launch Workers in parallel; verify output files exist with ls
  • Launch Critics in parallel; verify output files exist with ls
  • Launch Summarizer; verify output file exists
  • Return report path to user

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Doing A Simple Two Stage Fanout?

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

Waarom Doing A Simple Two Stage Fanout gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Doing A Simple Two Stage Fanout bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Doing A Simple Two Stage Fanout in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/ed3dai/ed3d-plugins/tree/main/plugins/ed3d-basic-agents/skills/doing-a-simple-two-stage-fanout. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Doing A Simple Two Stage Fanout gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Doing A Simple Two Stage Fanout gebruiken?

Zoveel als je wilt. Je kunt Doing A Simple Two Stage Fanout gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Doing A Simple Two Stage Fanout gratis?

Deze skill is door ed3dai op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇