Workflow builder
Skill Infrasity-Labs/dev-gtm-claude-skills/notion-skills/workflow-builder
Design and write deterministic multi-agent workflow scripts (.js files in .claude/workflows/) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.From its SKILL.md
npx -y skills add Infrasity-Labs/dev-gtm-claude-skills --skill workflow-builderAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
5.1 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
Workflow Builder
Author runnable workflow scripts for Claude Code's Workflow tool: deterministic multi-agent orchestration files (.js) that fan work out to fresh-context sub-agents under plain JavaScript control flow. Only leaf agent() calls spend tokens, so the main session stays clean and the whole run is resumable.
ALWAYS start every session with intake (non-negotiable)
Before proposing or writing any workflow, run the intake. Do not skip to code.
-
Ask what kind of workflow they want. Use this opening question set:
- What repeatable, multi-step task do you want to automate?
- What is the one unit of work a single sub-agent does once?
- How many units — a known list, or discovered by looping?
- Do later steps need all prior results at once, or can each item flow on its own?
- Does any step need structured data back (a verdict, a list, scores)?
- Roughly how many tokens / how deep should it go?
-
If the user is vague, do NOT stall. Run the recommendation engine to turn whatever you have into 1-2 concrete proposals, then present them with the reasoning:
python scripts/workflow_intake.py --task "their description" \ --units unknown --stages unknown --needs-all unknown --structured unknownThe engine returns a recommended topology (fan-out / pipeline / loop / barrier / judge-panel), model picks, a budget guard, and a one-line rationale per choice. Present those as "Here's what I'd build and why" — never ask the user to re-answer questions they already half-answered.
-
Confirm the shape with the user (topology + phases + parallel-vs-pipeline) before writing the file. This is the only approval gate.
See references/decision_and_intake_guide.md for the full question framework, the vague-input playbook, and worked recommendation examples.
Decide if a workflow is even the right tool
| Scenario | Use |
|---|---|
| Single sub-agent, one task | plain Agent tool |
| Reusable procedure, Claude picks steps dynamically | a Skill |
| Many sub-agents in a fixed topology, deterministic + resumable | Workflow ✓ |
Workflows earn their cost when work is parallel or multi-stage, must be reproducible, long enough to fail halfway (so resume matters), or benefits from isolating each step in its own context window. For one-off tasks, just use Claude directly.
Build → validate → run loop
- Scaffold a starter from the confirmed topology:
python scripts/scaffold_workflow.py --topology pipeline --name pr-triage \ --description "Triage open PRs" > .claude/workflows/pr-triage.js - Edit the file:
metablock first (pure literal, first statement), then the async body using the injected globals —agent(),pipeline(),parallel(),phase(),log(),budget,args,workflow(). Full surface in references/api_reference.md; copy-paste shapes in references/orchestration_patterns.md. - Validate before running — catches the parser-fatal mistakes:
python scripts/validate_workflow.py .claude/workflows/pr-triage.js - Run it: enable the feature with
export CLAUDE_CODE_WORKFLOWS=1, save the file under.claude/workflows/, then use/workflowsto launch and watch it live. Press P to pause/resume, X to skip a sub-agent. Failed agents retry automatically.
Hard rules (validator enforces these)
metais a pure literal and the first statement — no variables, spreads, template strings, or function calls inside it.- No non-determinism:
Date.now(),Math.random(), arglessnew Date()break resume — pass timestamps viaargs. - No filesystem / Node APIs (
require,fs,process, network) in the orchestrator — that work belongs insideagent()prompts. parallel()takes thunks (() => agent(...)), not bare promises. Default topipeline()unless a stage needs the whole prior result set.- Guard every open-ended loop with a counter or
budget.remaining()check — unguarded loops hit the 1000-agent cap. - Filter skipped/failed agents:
results.filter(Boolean).
Tooling
scripts/workflow_intake.py— intake recommendation engine (topology + model + budget + rationale from vague input).scripts/validate_workflow.py— stdlib linter for the rules above; PASS / WARN / FAIL with line numbers.scripts/scaffold_workflow.py— generate a starter.jsfor any topology.assets/templates/— fan-out, pipeline, loop-until-budget starters.assets/examples/— a complete runnable workflow.
All scripts run with --sample (no args) and --help.
What ships with it: 14 files
54.2 KB alongside SKILL.md, 8 of them executable
assets/
- examples/pr-triage.jsruns3.5 KB
- templates/fan-out.jsruns1.1 KB
- templates/loop-until-budget.jsruns1.2 KB
- templates/pipeline.jsruns1.2 KB
expected_outputs/
- intake_pr_review.json1.2 KB
- scaffold_pipeline.jsruns1.2 KB
- validate_sample.txt555 B
references/
- api_reference.md5.5 KB
- decision_and_intake_guide.md5.1 KB
- orchestration_patterns.md4.7 KB
scripts/
- scaffold_workflow.pyruns6.7 KB
- validate_workflow.pyruns10.7 KB
- workflow_intake.pyruns10.2 KB
- README.md1.3 KB
Gives 0 of the 12 instructions most agent orchestration skills give in ~1.1k tokens
Counted across 848 of the 1,300 authors here whose files we hold, read 2026-09-06
- Dispatch one agent per independent problem domainin 56 of 848, across 42 files
- Run full test suite after integrationin 55 of 848, across 42 files
- Verify fixes do not conflictin 40 of 848, across 32 files
- Review each summary when agents returnin 40 of 848, across 31 files
- Write a handoff document summarising the current conversationin 30 of 848, across 25 files
- Reference existing artifacts by path or URLin 26 of 848, across 24 files
- Give each agent a specific scopein 19 of 848, across 10 files
- Give each agent a clear goalin 19 of 848, across 10 files
- Include a suggested skills section in the documentin 18 of 848, across 16 files
- Tailor the doc to the user argumentsin 18 of 848, across 15 files
- Issue all subagent dispatches in the same responsein 17 of 848, across 11 files
- Use git worktrees for isolationin 17 of 848, across 8 files
Said here and by no other author read
- Run the intake before proposing any workflow
- Confirm the shape with the user before writing
- Scaffold a starter from the confirmed topology
- Guard every open-ended loop with a counter
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.