{"slug":"alterlab-workflow-orchestration","title":"alterlab-workflow-orchestration","summary":"Composes existing AlterLab skills into multi-agent agentic workflows using current Claude Code orchestration primitives — subagents (including nested subagents), dynamic workflow scripts, agent teams, forks, and the Claude Agent SDK: parallel fan-out, sequential pipelines, judge ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-23T18:57:03.549482Z","repo":{"url":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","stars":86,"forks":18,"license":"MIT","updatedAt":"2026-11-11T06:54:45Z"},"bodyHtml":"<hr>\n<h2>name: alterlab-workflow-orchestration\ndescription: \"Composes existing AlterLab skills into multi-agent agentic workflows using current Claude Code orchestration primitives — subagents (including nested subagents), dynamic workflow scripts, agent teams, forks, and the Claude Agent SDK: parallel fan-out, sequential pipelines, judge panels, adversarial verification, and loop-until-clean review cycles. Maps each pattern onto real skills (alterlab-research-pipeline, alterlab-deep-research, alterlab-citation-verifier, alterlab-paper-reviewer, alterlab-peer-review) with copyable delegation prompts, agent-definition frontmatter, workflow-script skeletons, and SDK query() snippets. Use when the request mentions multi-agent, subagents, agent team, dynamic workflow, workflow script, parallel agents, orchestration, pipeline of skills, judge panel, adversarial verification, devil's advocate, loop until clean, chaining skills, or composing skills into a custom workflow. Part of the AlterLab Academic Skills suite.\"\nlicense: MIT\nallowed-tools: Read Write Edit Bash\ncompatibility: \"Patterns grounded in Claude Code subagents, dynamic workflows, and the Claude Agent SDK (verified against code.claude.com docs on 2026-09-23, Claude Code v2.1.280). Dynamic workflows need a paid plan or API access; agent teams need CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. No external API key required for the Claude Code patterns.\"\nmetadata:\nskill-author: AlterLab\nversion: \"1.1.0\"\nlast_updated: \"2026-09-23\"\ndepends_on: \"alterlab-research-pipeline, alterlab-deep-research, alterlab-citation-verifier, alterlab-paper-reviewer, alterlab-peer-review\"</h2>\n<h1>Workflow Orchestration — Compose AlterLab Skills into Multi-Agent Workflows</h1>\n<p>This skill is the orchestration layer. It does not do research, write, or review\nitself — it teaches <strong>how to wire the skills that do</strong> into agentic workflows\nusing Claude Code's native subagent machinery and the Claude Agent SDK. Pick a\npattern, point it at real AlterLab skills, copy the delegation prompt.</p>\n<p>The five patterns below are the high-leverage shapes for academic work: fan-out\n<strong>parallel</strong> investigation, a <strong>sequential</strong> pipeline, a <strong>judge panel</strong>,\n<strong>adversarial verification</strong>, and a <strong>loop-until-clean</strong> review cycle. Each is\ngrounded in the current docs (see <code>references/claude-orchestration-primitives.md</code>\nfor the verified primitives, and <code>references/composition-recipes.md</code> for full\nworked recipes with copyable prompts).</p>\n<h2>When to Use This Skill</h2>\n<p>Use this skill when the user wants to:</p>\n<ul>\n<li>Run several AlterLab skills <strong>at once</strong> over independent inputs (e.g. verify 4\nbibliographies, or research 3 sub-questions in parallel) and merge the results</li>\n<li><strong>Chain</strong> skills into a pipeline where each stage hands off to the next</li>\n<li>Get <strong>multiple independent perspectives</strong> on one artifact (a judge / reviewer panel)</li>\n<li><strong>Adversarially verify</strong> an output — one agent produces, a fresh agent tries to break it</li>\n<li>Iterate a <strong>loop until a quality gate passes</strong> (e.g. re-review until zero unresolved comments)</li>\n<li>Understand Claude Code subagents, agent teams, forks, or the Agent SDK well\nenough to author their own academic orchestration</li>\n</ul>\n<h3>Does NOT Trigger</h3>\n<table>\n<thead>\n<tr>\n<th>Scenario</th>\n<th>Use Instead</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>The user wants the full research→write→review pipeline run for them</td>\n<td><code>alterlab-research-pipeline</code> (it already orchestrates the 9-stage flow)</td>\n</tr>\n<tr>\n<td>The user wants original research / a cited report</td>\n<td><code>alterlab-deep-research</code></td>\n</tr>\n<tr>\n<td>The user wants one manuscript peer-reviewed</td>\n<td><code>alterlab-paper-reviewer</code> or <code>alterlab-peer-review</code></td>\n</tr>\n<tr>\n<td>The user wants citations existence-checked</td>\n<td><code>alterlab-citation-verifier</code></td>\n</tr>\n<tr>\n<td>The user wants to run one of the packaged AlterLab workflows (citation audit, review panel, PRISMA screening, rebuttal, grant panel, literature map)</td>\n<td><code>alterlab-research-workflows</code></td>\n</tr>\n<tr>\n<td>The user asks about Claude API pricing / model ids / SDK billing</td>\n<td>the <code>claude-api</code> skill</td>\n</tr>\n</tbody>\n</table>\n<p>This skill is for <strong>how to compose</strong>; the named skills are <strong>what to compose</strong>.\nIf a single existing skill already does the job end to end, defer to it.</p>\n<h2>Verified Orchestration Primitives (Claude Code + Agent SDK)</h2>\n<p>Verified against <code>code.claude.com/docs</code> on 2026-09-23 (Claude Code v2.1.280). See\n<code>references/claude-orchestration-primitives.md</code> for quotes, field tables, and version gates.</p>\n<ul>\n<li><strong>Subagents</strong> are Markdown + YAML files in <code>.claude/agents/</code> (project),\n<code>~/.claude/agents/</code> (user), or a plugin's agents. Only <code>name</code> and <code>description</code> are\nrequired; the tool allowlist field is <code>tools</code> (comma-separated or a YAML list), and\n<code>model</code> accepts <code>sonnet</code>/<code>opus</code>/<code>haiku</code>/<code>fable</code>/a full ID/<code>inherit</code>. Each subagent runs\nin its <strong>own context window</strong> and returns only a summary. Claude auto-delegates by\nmatching the task to the <code>description</code>.</li>\n<li><strong>Subagents can nest</strong> — by default up to three layers below the main conversation\n(<code>CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH</code>; <code>1</code> turns nesting off). A reviewer can\ndispatch one verifier per finding. Omit <code>Agent</code> from a subagent's <code>tools</code> to keep it\nfrom spawning. Built-ins: <strong>Explore</strong> and <strong>Plan</strong> (read-only, inherit the main model),\n<strong>general-purpose</strong> (all tools).</li>\n<li><strong>Fork mode</strong> is on by default in interactive sessions: Claude can spawn a <code>fork</code> that\ninherits the whole conversation (and its prompt cache), and subagents run in the\nbackground. Start one yourself with <code>/subtask</code>.</li>\n<li><strong>Dynamic workflows</strong> move the plan into a JavaScript script the runtime executes:\n<code>agent()</code>, <code>parallel()</code>, <code>pipeline()</code>, <code>phase()</code>, <code>args</code>, with JSON-schema outputs and\nintermediate results kept in script variables instead of Claude's context. Dozens to\nhundreds of agents per run; resumable; saved to <code>.claude/workflows/</code> or shipped in a\nplugin's <code>workflows/</code> folder and run as <code>/&lt;name&gt;</code> or <code>/&lt;plugin&gt;:&lt;name&gt;</code>.</li>\n<li><strong>Agent teams</strong> (experimental, <code>CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1</code>, interactive\nsessions only): teammates have independent contexts, a shared task list, and <strong>message\neach other directly</strong> — the right tool for sustained adversarial debate. Higher token cost.</li>\n<li><strong>Claude Agent SDK</strong> (Python <code>claude-agent-sdk</code>, TypeScript\n<code>@anthropic-ai/claude-agent-sdk</code>) packages the same agent loop programmatically via\n<code>query(...)</code>; define subagents with the <code>agents</code> option (<code>AgentDefinition</code>) and resume\nby <code>session_id</code>. Use it to script the patterns below in CI or batch jobs.</li>\n</ul>\n<p><strong>Ready-made versions.</strong> The <code>alterlab-workflows</code> plugin ships these patterns as runnable\ndynamic workflows (documented in <code>alterlab-research-workflows</code>): fan-out + adversarial\nverify → <code>citation-audit</code>; judge panel → <code>review-panel</code> and <code>grant-mock-panel</code>;\nadversarial verification → <code>claim-stress-test</code>; dual independent coding with\nadjudication → <code>systematic-review-screening</code>. Adapt one of those before writing a new\nworkflow from scratch.</p>\n<h2>The Five Patterns</h2>\n<h3>1. Parallel fan-out (map)</h3>\n<p>When N inputs are independent, dispatch one worker per input and merge. Classic\nacademic uses: verify several bibliographies at once, or research distinct\nsub-questions concurrently.</p>\n<pre><code>I have 4 reference lists (one per chapter). Verify them in parallel using\nseparate subagents — each subagent runs the alterlab-citation-verifier skill\non one list — then merge the per-entry verdicts into one table flagging every\nTF/IH/SH problem across all four chapters.\n</code></pre>\n<p>Why subagents: each verification floods context with API lookups you won't reuse;\nisolating each in its own window keeps the main conversation clean. Best when\npaths don't depend on each other (the docs' stated condition for parallel\nresearch). See recipe P1 in <code>references/composition-recipes.md</code>.</p>\n<h3>2. Sequential pipeline (chain)</h3>\n<p>Stage outputs feed the next stage. The canonical academic chain — research →\nwrite → integrity-check → review → revise — is already packaged as\n<code>alterlab-research-pipeline</code>; <strong>prefer that skill</strong> rather than rebuilding it.\nUse this pattern when you need a <em>custom</em> chain it doesn't cover, e.g.\ndeep-research → citation-verifier → peer-review on an externally supplied draft.</p>\n<pre><code>Use the alterlab-deep-research skill to produce a lit-review synthesis on X,\nthen chain its bibliography into alterlab-citation-verifier to existence-check\nevery entry, then pass the verified draft to alterlab-peer-review for a\nsection-by-section critique. Carry forward only each stage's summary.\n</code></pre>\n<p>See recipe P2 in <code>references/composition-recipes.md</code>.</p>\n<h3>3. Judge panel (independent multi-perspective)</h3>\n<p>Several independent reviewers each apply a different lens to <strong>one</strong> artifact,\nthen a synthesizer reconciles. <code>alterlab-paper-reviewer</code> already simulates a\n5-reviewer panel internally; use <em>this</em> pattern when you want the panelists to be\n<strong>genuinely separate agents</strong> (separate contexts, no cross-contamination) — e.g.\na methodology reviewer, a domain reviewer, and a reproducibility reviewer that\nmust not anchor on each other.</p>\n<pre><code>Spawn three independent reviewer subagents on this manuscript: one on\nmethodology, one on domain contribution, one on reproducibility/statistics.\nEach works from the paper alone and reports independently; then synthesize a\nsingle editorial decision noting where they agree and disagree.\n</code></pre>\n<p>Independence is the point — running them in one context lets the first opinion\nanchor the rest. See recipe P3 in <code>references/composition-recipes.md</code>.</p>\n<h3>4. Adversarial verification (produce → break)</h3>\n<p>One agent produces a claim or result; a <strong>fresh</strong> agent is tasked solely with\ndisproving it. This is the highest-value pattern for research integrity. The\ndocs' competing-hypotheses agent-team example is the reference implementation:\nteammates \"talk to each other to try to disprove each other's theories, like a\nscientific debate.\"</p>\n<pre><code>Take the three headline claims in my draft. For each, spawn a skeptic subagent\nwhose only job is to find disconfirming evidence and check the supporting\ncitation actually supports the claim (via alterlab-citation-verifier). Report\nany claim that survives and any that breaks.\n</code></pre>\n<p>For sustained debate where the skeptics challenge <strong>each other</strong>, escalate to an\nagent team (the env var above). See recipe P4 in <code>references/composition-recipes.md</code>.</p>\n<h3>5. Loop until clean (validator → fix → repeat)</h3>\n<p>Iterate a fix-and-recheck cycle until a quality gate passes — bounded by a turn\ncap so it terminates. Academic use: revise → re-review until zero unresolved\nreviewer comments, or verify → fix → re-verify until the bibliography is 100%\nresolvable.</p>\n<pre><code>Run a revision loop: alterlab-paper-reviewer produces comments; revise the\ndraft to address them; re-review only the previously-flagged items; repeat\nuntil no unresolved comments remain or after at most 3 rounds, then stop and\nreport the residual issues.\n</code></pre>\n<p>Always set an explicit stop condition and a max-iteration cap — open loops burn\ncontext and tokens. As a dynamic workflow, the loop lives in the script:</p>\n<pre><code>export const meta = { name: 'revise-until-clean', description: 'Review, revise, re-review until no unresolved comments or 3 rounds' }\nlet open = []\nfor (let round = 1; round &lt;= 3; round++) {\n  const review = await agent(`Review draft.md (round ${round}); list unresolved comments only.`,\n    { schema: { type: 'object', required: ['comments'], properties: { comments: { type: 'array', items: { type: 'string' } } } } })\n  if (!review) break          // agent() returns null if the run is stopped or the agent fails\n  open = review.comments\n  if (!open.length) break\n  await agent(`Revise draft.md to resolve exactly these comments: ${JSON.stringify(open)}`)\n}\nreturn { unresolved: open }\n</code></pre>\n<p>See recipe P5 in <code>references/composition-recipes.md</code>.</p>\n<h2>Choosing a Mechanism</h2>\n<table>\n<thead>\n<tr>\n<th>Need</th>\n<th>Mechanism</th>\n<th>Why</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Isolate verbose output, get a summary back</td>\n<td><strong>Subagent</strong></td>\n<td>Own context window; only summary returns</td>\n</tr>\n<tr>\n<td>Independent investigations, no cross-talk</td>\n<td><strong>Parallel subagents</strong></td>\n<td>Each explores alone; main agent synthesizes</td>\n</tr>\n<tr>\n<td>Side task that needs full current context</td>\n<td><strong>Fork</strong> (<code>/fork</code>)</td>\n<td>Inherits conversation; reuses prompt cache</td>\n</tr>\n<tr>\n<td>Workers must debate / challenge each other</td>\n<td><strong>Agent team</strong> (experimental)</td>\n<td>Shared task list + direct messaging</td>\n</tr>\n<tr>\n<td>Dozens+ of workers, votes, or a fixed loop you want to rerun</td>\n<td><strong>Dynamic workflow</strong></td>\n<td>Script holds the plan; results stay out of context; resumable</td>\n</tr>\n<tr>\n<td>A worker's task itself splits into parallel subtasks</td>\n<td><strong>Nested subagents</strong></td>\n<td>A reviewer dispatches a verifier per finding (depth ≤ 3 by default)</td>\n</tr>\n<tr>\n<td>Script the workflow in CI / batch</td>\n<td><strong>Agent SDK</strong></td>\n<td><code>query()</code> + <code>agents</code> option, programmatic</td>\n</tr>\n<tr>\n<td>It's already one packaged flow</td>\n<td><strong>Existing skill</strong></td>\n<td>Don't rebuild <code>alterlab-research-pipeline</code></td>\n</tr>\n</tbody>\n</table>\n<p>Match freedom to fragility: open-ended exploration gets prose prompts; fragile\nmulti-step sequences get explicit, ordered instructions and a stop condition.</p>\n<h2>Resources</h2>\n<ul>\n<li><code>references/claude-orchestration-primitives.md</code> — verified Claude Code subagent\n<ul>\n<li>agent-team + fork + Agent SDK primitives, with field tables and doc-sourced\nquotes (load when you need exact frontmatter fields, env vars, or version gates)</li>\n</ul>\n</li>\n<li><code>references/composition-recipes.md</code> — five full worked recipes (P1–P5) mapping\neach pattern onto real AlterLab skills, with copyable delegation prompts,\nsubagent-definition frontmatter, and a Python Agent SDK <code>query()</code> example\n(load when you need a complete, ready-to-run composition)</li>\n</ul>\n\n","files":[{"path":"evals/evals.json","sizeBytes":7416,"isText":true},{"path":"evals/fixtures/chapter1.bib","sizeBytes":488,"isText":false},{"path":"evals/fixtures/chapter2.bib","sizeBytes":532,"isText":false},{"path":"evals/fixtures/chapter3.bib","sizeBytes":275,"isText":false},{"path":"evals/fixtures/chapter4.bib","sizeBytes":354,"isText":false},{"path":"references/claude-orchestration-primitives.md","sizeBytes":12017,"isText":true},{"path":"references/composition-recipes.md","sizeBytes":11648,"isText":true},{"path":"SKILL.md","sizeBytes":14609,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-19T19:34:00.603495Z","sha256":"8FE6BF6974F3361B5FB081B9EB580E1B1B94EAFE4D309DA570222F2C67CCDB7E","sizeBytes":20515},"review":null,"source":{"repositoryUrl":"https://github.com/AlterLab-IEU/AlterLab-Academic-Skills","path":"skills/core/alterlab-workflow-orchestration","license":"MIT","commit":"3ab6d034385ec4fedc3f6f4099292d4e91f60300","subtreeSha":"1982A6BE6861EEC6A803272ADCA866CC72E5662F22BA19EA43B2659EDA61EFB8","lastSyncedAt":"2026-11-19T19:28:57.150271Z"},"reviewedAt":"2026-11-19T19:42:41.712208Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/AlterLab-IEU/AlterLab-Academic-Skills/tree/main/skills/core/alterlab-workflow-orchestration"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install alterlab-ieu-alterlab-academic-skills@llmmart"},{"target":"git","command":"git clone https://github.com/AlterLab-IEU/AlterLab-Academic-Skills.git"}]}