Skip to content
Back to skills

Author Workflow Fanout

ASecurity

Use when authoring a Claude Code Workflow scriptPath / multi-agent fan-out script: deciding pipeline vs a parallel barrier, wiring per-agent() error handling, choosing schema vs longform output, persisting bulk results, or writing a budget/cap loop. Symptoms this skill exists for: one dead search or rate-limit crashing the whole fan-out because an agent() call had no .catch, a barrier stalling fast agents behind the slowest, a budget loop running to the 1000-agent cap because it was not guard...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 25, 2026
ai-agentsjavascriptpythonrustjavanode

Works with

  • claude code

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 25, 2026

npx -y skills add OrionArchitekton/orion-skills --skill author-workflow-fanout --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Author Workflow Fanout?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Author Workflow Fanout
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/orionarchitekton-author-workflow-fanout/badge)](https://www.skillsdirectory.com/skills/orionarchitekton-author-workflow-fanout)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: author-workflow-fanout
description: "Use when authoring a Claude Code Workflow scriptPath / multi-agent fan-out script: deciding pipeline vs a parallel barrier, wiring per-agent() error handling, choosing schema vs longform output, persisting bulk results, or writing a budget/cap loop. Symptoms this skill exists for: one dead search or rate-limit crashing the whole fan-out because an agent() call had no .catch, a barrier stalling fast agents behind the slowest, a budget loop running to the 1000-agent cap because it was not guarded on budget.total, bulk output stuffed into return values instead of disk."
---

# Authoring Workflow Fan-Out Scripts

## Overview

A fan-out script spends real tokens across many subagents, and its failure
modes are silent: an un-caught reject kills the whole run, an unguarded loop
burns the agent cap, a barrier stalls every fast agent behind the slowest.
Author defensively: every `agent()` call handles its own failure into a ledger
plus abstention, the topology is a pipeline unless a barrier is genuinely
needed, and any budget loop is guarded so it cannot run unbounded. Run the
linter before you launch.

## When to use

- Writing or editing a `Workflow({scriptPath})` script, or any multi-`agent()`
  fan-out.
- NOT for deciding WHETHER to fan out (that is a parallel-dispatch decision),
  and NOT for reading the verdicts a fan-out returns (that is a verdict-triage
  discipline).

## Rules the linter enforces (run it before launch)

`python3 workflow_lint.py <script.js>` (exit 0 clean, 1 findings, 2 error).

| Rule | Why it matters |
|------|----------------|
| `no-catch` | Every `agent()` must carry `.catch` (or a wrapper that does). One rate-limit or dead-search reject otherwise rejects the whole `parallel`/`pipeline`; the failure must become a ledger entry plus abstention, not a crash |
| `budget-unguarded` | `while (budget.remaining() ...)` with no `budget.total` in the condition runs to the 1000-agent cap: with no target, `remaining()` is `Infinity`. Guard: `while (budget.total && budget.remaining() > N)` |
| `meta-missing` | A script with no `export const meta = {` is rejected at load |
| `unbounded-agent-hoard` | A schema-less (longform) `agent()` whose returns are accumulated (`pipeline`/`parallel`/`.push`/`+=`) with NO bound accumulator hoards unbounded bulk in the orchestrator's live context. Fix: pass a `schema` (small structured return), or route returns through a bounded accumulator (see Judgment section below) |

## Judgment the linter cannot check

- **Pipeline by default; barrier only for cross-item need.** `pipeline()` has
  no barrier, so a fast item is not stalled behind the slowest. Use
  `parallel()` between stages ONLY when a stage genuinely needs ALL prior
  results at once (dedup/merge, zero-count early-exit, "compare to the others").
- **schema vs longform.** Structured data (findings, verdicts) takes a
  `schema`. Human or prose output stays plain text; a schema mangles longform.
- **Persist bulk to disk.** Subagents write artifacts to files and return
  pointers or summaries; do not stuff large bodies into `agent()` return values. When you DO
  accumulate many returns, cap and dedupe them in-flight with a small bounded accumulator: budget
  a total byte cap plus a per-item byte cap, and preserve complete recoverable
  artifacts before omitting any inline output. The optional
  [local JavaScript helper](bounded-results.mjs) provides this boundary for a
  Node.js consumer; its [usage and recovery guide](docs/runbooks/bounded-results.md)
  defines the complete JSON byte budget, private storage and explicit failures.
  It needs filesystem access and cannot run inside a Workflow sandbox. In that
  sandbox, use the worker's storage interface and verify references yourself.
  Prose-only usage remains supported; the helper is optional. A recognized helper
  name is only a linter hint, never proof of persistence or an effective cap.
- **`.filter(Boolean)` before using results.** A failed thunk resolves to
  `null` in `parallel()`/`pipeline()` output; filter before you map.
- **No `Date.now()` / `Math.random()`** in the script body (they throw in the
  sandbox and break resume); vary by index, stamp timestamps after the run.

## Rationalizations

| Excuse | Reality |
|--------|---------|
| "The agents almost never fail, .catch is noise" | One 429 or dead search rejects the entire parallel()/pipeline(); the run dies at 90% |
| "A barrier is cleaner than a pipeline" | Barrier latency is real: the slowest item blocks every fast one; use pipeline unless a stage needs all prior results |
| "The budget loop is fine, it'll stop eventually" | With no `budget.total`, `remaining()` is Infinity; it stops at the 1000-agent backstop, not where you meant |
| "I'll return the full text and parse it later" | Bulk in return values bloats orchestrator context; persist to disk, return a pointer |

## Red flags

- An `await agent(...)` with no `.catch` anywhere in its statement.
- `parallel()` whose result feeds a transform that feeds another `parallel()`
  (that is a pipeline wearing a barrier).
- A `while` on `budget.remaining()`/`spent()` with no `budget.total` guard.
- `Date.now()` / `Math.random()` / bare `new Date()` in the script body.
- Launching without running the linter.

## Related

Complements a "whether to fan out" parallel-dispatch decision and a
verdict-triage discipline (reading the results a fan-out returns). Note the
name "workflow" collides with unrelated durable-execution frameworks: this is
about the Claude Code Workflow tool's fan-out script, not those.

## Boundary

This is an authoring discipline plus a shipped linter, not a runtime. The
linter (`workflow_lint.py`, co-located here) is a heuristic smell-detector: it
flags an `agent()` call with no `.catch`, an unguarded `budget` loop, and a
missing `meta` block, by blanking string/comment bodies before it tracks paren
depth so a prompt's punctuation cannot fool it. Wire it into your own
pre-launch step. The harness that runs the fan-out, the failure-ledger format,
and where you persist bulk output are your repo's mechanics. The discipline is
invariant: every `agent()` handles its own failure, pipeline unless a barrier
is needed, guard every budget loop. Selftest the linter in your own suite
before trusting it.

Files in this skill

  • LICENSE1 KB
  • SKILL.md6.2 KB
  • bounded-results.mjs6.2 KB
  • docs/runbooks/bounded-results.md6.6 KB
  • workflow_lint.py10.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.