Sectioned fan-out with synthesis
You split a wide task into independent sections, each gets its own agent, and the synthesis shows what nobody checked.
Orchestration, intermediate. Published
What it does
The agent splits a task into sections with hard boundaries: by file, domain, source, concern or user journey. It sends every section agent in one message, so they run in parallel. Each one writes its full report to a file and replies with only the path and a summary. The report carries a coverage map, severity-tagged findings and cross-section dependencies. A synthesis pass then merges the maps, turns every uncovered spot into a finding with a follow-up agent, and resolves conflicts.
When to use it
When to use it
- A review, audit or build has two or more parts that do not need each other's output.
- One agent on a wide task skips parts and does not say which.
- Research across several sources you can read separately.
- A change spans several subsystems and you want one reviewer per subsystem.
When not to use it
- The task is one command, one line or a status check.
- The steps run strictly in order and each needs the previous result. That is a pipeline.
- The task is short. Every section loads its own context, so you pay several times the tokens.
Decision table
| Situation | What the skill does |
|---|---|
| Several independent parts | Cuts along seams and sends the section agents in one message |
| User-facing work | Cuts by user journey, not by resource |
| A file shared between sections | Gives one section write access, the rest read only |
| A report without a coverage map | Rejects it and redispatches the section with a corrected prompt |
| A spot no section covered | Records it as a finding and dispatches a follow-up agent |
| Steps that depend on each other | Does not split, runs them in order |
Template
The method: when to split a task, how to cut along seams, the section prompt, the reply contract and the mandatory synthesis pass.
---
name: sectioned-fan-out
description: Split a task with several independent parts into bounded sections, run one agent per section in parallel, and merge their reports in a mandatory synthesis pass. Use it when a review, audit, build or research task has two or more parts that do not depend on each other's output.
---
# Sectioned fan-out with synthesis
One agent working a task with five independent parts spreads one attention budget across all of them.
Nothing forces the fifth part to get the attention the first one got, and you never learn what it skipped.
This workflow gives each part its own agent with a hard boundary, makes every agent report what it
actually covered, and closes with a synthesis pass that turns every uncovered spot into a visible finding.
Read `CONTEXT.md` next to this file before you start. It holds the reader's model tiers, concurrency cap,
report folder and any project-specific seams.
If `CONTEXT.md` is missing, or a field you need is blank, stop and ask the user for it in the user's
language before you dispatch anything. Ask for one field at a time and name what it is for, for example:
EN "Add your concurrency cap: how many section agents may run at once on your machine?",
PL „Podaj limit równoległości: ilu agentów sekcji może działać naraz na Twoim komputerze?”.
Write the answer into `CONTEXT.md` so you do not ask again.
## Before you start / What you need
- **An AI coding agent that runs subagents in parallel** (required). Any of these works:
- Claude Code: install from https://code.claude.com/docs/en/setup, subagents at https://code.claude.com/docs/en/sub-agents
- Codex CLI: install from https://developers.openai.com/codex/cli, subagents at https://developers.openai.com/codex/subagents
- Cursor: install from https://cursor.com/downloads, subagents at https://cursor.com/docs/agent/subagents
Test it once: ask for two subagents that each list one folder, and check that both started before the
first one replied. If they run one after another, this workflow loses its point in your tool.
- **A report folder** the section agents can write to, named in `CONTEXT.md`.
- **A token budget** for several parallel contexts. Every section loads its own.
## 1. Decide whether to fan out
Fan out when you can name two or more chunks of the task that do not need each other's output.
Do NOT fan out when:
- **The task is trivial.** A single command, a one-line edit, a status lookup. Do it directly.
- **The work is indivisible.** One small surface with no independent seams gets one agent.
- **The steps are strictly sequential.** If each step needs the previous step's output, you have a pipeline, not a
fan-out. Run it in order.
- **The task is short.** Every section agent loads its own context, so a fan-out costs several times the
tokens of a single agent. It pays off on long, wide tasks and wastes budget on quick ones.
If none of these hold, fan out.
## 2. Cut along seams
List the sections before you dispatch anything. Pick the seam that matches the task:
| Seam | Cut by | Example |
|---|---|---|
| File or module | directory, package, file group | `checkout/`, `catalog/`, `accounts/` in a small online shop |
| Domain or subsystem | frontend, API, billing, auth, webhooks, migrations | one agent per subsystem of a small web app |
| Source | repos, documents, datasets, research angles | three competitor sites, two forums, one changelog |
| Concern | correctness, security, performance, data integrity, UX | four reviewers over the same diff |
| Feature slice | one feature end to end | "invite a teammate", "export invoices" |
For every section, write its boundary in one line: the exact files, folders, domain or question it owns.
**Keep boundaries disjoint.** Two agents editing the same file will overwrite each other. If a shared file
cannot be avoided, give exactly one section write access and make the others read-only on it.
### Connective tissue: the seams between the seams
Cutting by resource leaves the connections between resources unowned, so every section can report
green while the feature as a whole does not work.
- **User-facing work: cut by user journey.** A section is a path a person walks end to end ("reset a password and
log back in", "place an order and get the confirmation email"), through however many resources
it crosses.
- **If you must cut by resource, name the owner of every seam.** Write into the dispatch which section
owns each page, handler or file that sits between two sections. An unnamed seam is an unowned seam.
- **Resource-complete is not working.** A section can honestly finish its files while the feature stays
unusable. Each section verifies its own slice end to end before it reports green. For UI work that means
driving the real interface, not calling an endpoint and trusting the response.
## 3. Set concurrency and model tier
- **Concurrency:** read the cap from `CONTEXT.md`. If there are more sections than the cap allows, run them
in waves, each wave in one message. If the machine is short on memory, lower the cap before you start;
running out of memory mid-fan-out loses every section's work.
- **Model tier per section:** use the cheap tier from `CONTEXT.md` for mechanical sections (clear spec,
no judgment: renames, log extraction, checklist sweeps). Use the strongest tier for sections that need
judgment (architecture, security, taste, adversarial review). If a cheap-tier section returns weak work,
rerun it on a stronger tier if the "Escalation allowed" field in `CONTEXT.md` says yes, otherwise ask the human first.
## 4. Dispatch every section in ONE message
Send all section agents of a wave in a single message with multiple agent calls. Calls in one message run
in parallel. Calls spread over separate messages run one after another, and you lose the whole gain.
Every section prompt states four things: the boundary, the task, the exact output shape, and the stop
point. Use this shape:
```
You are the section agent for: [section name].
BOUNDARY: you work ONLY on [files / folders / domain / journey].
Nothing outside this boundary. If you see a problem next door, record it
as a cross-section dependency. Do not fix it.
[If this section owns a seam: you also own [seam]. Verify it end to end.]
TASK: [what to find, check or build]
Return exactly this (shape in section-report.template.md):
1. Coverage map: every file, flow or source you actually opened or exercised.
Anything not on this list counts as unchecked.
2. Findings: each with severity (CRITICAL / MAJOR / MINOR) and location.
3. Cross-section dependencies: anything in your section that touches another.
4. Verification: how you proved your slice works end to end.
REPLY CONTRACT: write the full report to [report folder]/[section-name].md.
Reply to me with ONLY the file path and a summary of at most [summary limit
from CONTEXT.md], written for a reader
who has seen none of your work: outcome first, then anything I must decide
or reconcile, in complete sentences. Do not paste the report into the reply.
STOP: finish after the report is written. Do not widen the scope.
```
## 5. Keep working while sections run
Dispatching is not a reason to stop. While the sections run:
- Do the parts that depend on nothing: read the seams yourself, prepare the synthesis frame (an empty
combined coverage map listing every surface of the task).
- Answer questions sections send back, from the original task and its constraints.
- Intervene in a section that has gone off track or lacks context it needed. Correct it, or stop it and
redispatch with a better prompt. Do not wait to discover the problem at synthesis.
## 6. The context-safety contract
Large reports stay on disk. A section that pastes its full report into its reply can overflow your
context mid-synthesis, and then all section work is lost. The rule for every section, with no exceptions:
- Substantial, durable or large output goes to a file in the report folder from `CONTEXT.md`.
- The reply is the path plus a short, selective summary: outcome first, then what the parent must decide.
- You read from each file only the part you need at the moment.
Keep the summary length limit from `CONTEXT.md` in every section prompt.
## 7. Gate each report
A section report fails, and gets redispatched with a corrected prompt, when:
- it has no coverage map,
- a finding has no severity or no location,
- the section claims green without saying how it verified end to end,
- the full report came back in the reply instead of in a file.
## 8. Synthesis pass (mandatory)
Never hand back N separate reports. Merge them into one result:
1. **Combine the coverage maps** into one map against the full task surface you listed in step 5.
2. **Name every uncovered spot.** A file, flow, domain or seam that appears on no map is a finding in its
own right. Dispatch a follow-up agent for it. The task is not closed while a blank spot remains.
3. **Walk the cross-section dependencies.** Each one either lands on a section that covered it, or it
becomes an uncovered seam under point 2.
4. **Reconcile conflicts.** When two sections disagree, decide which one is right and write why. Never
drop a finding silently.
5. **Order findings by severity**, not by the order reports arrived.
Return: the combined coverage map, the list of blank spots with the follow-up dispatched for each, the
reconciled conflicts, and the top actions in order.
Synthesis prompt, if a separate agent does it:
```
You have [N] section reports: [paths]. The full task surface is: [surface list].
1. Merge the coverage maps into one. List explicitly what NO section covered.
2. Check every cross-section dependency against the merged map.
3. Resolve conflicting findings and state why. Do not delete any silently.
4. Sort findings by severity, not by the sequence reports came in.
5. Return: merged coverage map, blank spots, resolved conflicts,
top actions in order. Write the full result to [path]; reply with path + summary.
```
## Failure modes
| Symptom | Cause | Fix |
|---|---|---|
| Parent context overflows during synthesis | sections pasted full reports into replies | reply contract in every prompt; reports on disk |
| Two agents overwrite the same file | overlapping boundaries | disjoint boundaries, or one writer and the rest read-only |
| Every section green, feature broken | sections cut by resource, seams unowned | cut by user journey, or name each seam's owner |
| A part of the task was never checked | no coverage map, or no synthesis | coverage map is mandatory; synthesis lists blank spots |
| Sections ran one by one | dispatched across several messages | one message per wave |
| Machine stalls or kills agents | too many sections at once | respect the concurrency cap; run waves |
Other files
CONTEXT.template.mdYour settings: model tiers per section, concurrency cap, report folder, the usual seams of your project.
# Sectioned fan-out: your context
Copy this file to CONTEXT.md next to SKILL.md and fill in every blank. Never put passwords, access keys or card numbers here.
## Agent tool
(How your agent spawns a sub-agent, and whether several calls in one message run in parallel in your tool.)
Example: The Agent/Task tool; several calls in one message run concurrently.
## Model tiers
(Which model handles mechanical sections and which handles judgment sections. Use the names your tool accepts.)
Cheap tier (mechanical, clear spec): ___
Strong tier (judgment, security, taste, review): ___
Example: Cheap tier: a small fast model. Strong tier: your most capable model.
## Escalation allowed
(May the agent rerun a weak cheap-tier section on a stronger tier without asking you first? Answer yes or no.)
Escalation allowed: ___
Example: yes, rerun once on the strong tier, then ask.
## Concurrency cap
(How many section agents may run at once. Derive it from your machine's free memory and your plan's rate limits: start low, raise it while nothing stalls, lower it when free memory is tight.)
Cap: ___
Lower the cap when: ___
Example: Cap 4. Drop to 2 when less than a third of memory is free; run one at a time below that.
## Report folder
(Where section agents write their full reports. A folder outside version control or one you clean up after each run.)
Example: ./tmp/fanout-reports/
## Reply summary limit
(The maximum length of the summary a section agent may put in its reply. Pick a size your parent session can take from every section at once with room to spare.)
Example: a short paragraph, at most a few hundred words.
## Usual seams in this project
(The cuts that fit your codebase or work. List subsystems, user journeys and shared files.)
Subsystems: ___
Main user journeys: ___
Shared files that need a single writer: ___
Example: Subsystems: storefront, checkout API, admin panel. Journeys: browse and buy; refund request. Shared: the database schema file.
## Verification per section
(How a section proves its slice works end to end: a test command, a browser run, a query.)
Example: run the journey in a real browser against the staging site and attach a screenshot path.
section-report.template.mdThe report shape every section agent returns: coverage map, severity-tagged findings, dependencies, verification.
# Section report: [section name]
Boundary: [exact files, folders, domain or journey this section owned]
Seams owned: [pages, handlers or files between sections that this section was named owner of, or "none"]
## Coverage map
(Every file, flow or source actually opened or exercised. Anything missing here counts as unchecked.)
- [path or flow] | [read / edited / exercised]
- ...
## Findings
| Severity | Location | Finding | Suggested fix |
|---|---|---|---|
| CRITICAL / MAJOR / MINOR | [file:line or flow step] | [what is wrong] | [what to do] |
## Cross-section dependencies
- [what in this section touches which other section, and what that section must check]
## Verification
(How this slice was proven to work end to end. For UI work: the real interface was driven, not only an endpoint called.)
- Method: [test command, browser run, query]
- Result: [pass / fail, with evidence path]
## Out of scope, noticed
- [problems seen outside the boundary, recorded, not fixed]
What you need
An AI coding agent that runs subagents in parallel (Claude Code, Codex CLI or Cursor) (opens in new tab)
The workflow sends one subagent per section in a single message, so your agent must be able to spawn subagents and run them at the same time.
- Claude Code: install it from https://code.claude.com/docs/en/setup (opens in new tab). Subagents are documented on the page linked above.
- Codex CLI: install it from https://developers.openai.com/codex/cli (opens in new tab). Subagents are documented at https://developers.openai.com/codex/subagents (opens in new tab).
- Cursor: install it from https://cursor.com/downloads (opens in new tab). Subagents are documented at https://cursor.com/docs/agent/subagents (opens in new tab).
- Test: ask the agent for two subagents that each list one folder, and check that both started before the first one replied.
Install
- Claude Code: copy the folder to .claude/skills/sectioned-fan-out/ in the project, or to ~/.claude/skills/sectioned-fan-out/ for every project. Claude loads the skill when its description matches the task, or when you type /sectioned-fan-out.
- Codex: paste the contents of SKILL.md into AGENTS.md at the repository root, or into the global ~/.codex/AGENTS.md.
- Cursor: add SKILL.md as a project rule, or paste it into AGENTS.md.
- Any other agent: paste SKILL.md into the project instruction file or the system prompt.
- Copy CONTEXT.template.md to CONTEXT.md next to SKILL.md and fill in every field.
- Keep section-report.template.md next to SKILL.md so section agents have the report shape.
It's working if
- Before dispatching anything, the agent lists the sections with a one-line boundary for each.
- All section agent calls appear in one message, not in consecutive ones.
- The report folder from CONTEXT.md gains one file per section.
- Each section's reply is a file path plus a short summary, with no pasted report.
- Every report has a coverage map, and every finding has a severity and a location.
- The final result lists the uncovered spots, or states plainly that there are none.
Requirements
- An agent that can spawn sub-agents and run several calls in parallel.
- A report folder the section agents can write to.
- A token budget for several parallel contexts.
Questions
How many agents should run at once?
As many as the cap in CONTEXT.md allows. Start low, raise it while nothing stalls, and lower it when free memory runs short. Run extra sections in waves, each wave in one message.
Why a coverage map when the agent already reports findings?
Findings say what the agent found. The coverage map says what it opened at all. Without it, no findings looks the same as no check, and the synthesis has nothing to compute blank spots from.
Why must the report go to a file?
Several full reports pasted into replies can overflow the parent session's context halfway through synthesis, and all section work is lost. A file on disk plus a short summary keeps the context under control.
Every section reports green and the feature still fails. What went wrong?
Usually a cut by resource left seams without an owner, such as a file two sections both touch. Cut by user journey, or assign every seam an owner and require end-to-end verification in each section.
Which model should a section use?
A cheap model for mechanical sections with a clear spec, the strongest one for sections that need judgment: architecture, security, review. Rerun weak cheap-model output on a stronger model.
Where it fits
This skill is the execution engine for other workflows. The orchestrator template decides what to delegate, and the fan-out splits a wide assignment into sections. The adversarial review template uses the same pattern: one reviewer per section, and the worst verdict decides. In a build, the synthesis output feeds the build-through template as an ordered action list.
All skillsSources
- Claude Code docs: skills (accessed 2026-09-22)
- OpenAI Codex docs: AGENTS.md (accessed 2026-09-22)
- Cursor docs: rules (accessed 2026-09-22)
Questions about setting these up go in the Discord.Join free