alterlab-workflow-orchestration

$npx mdskill add AlterLab-IEU/AlterLab-Academic-Skills/alterlab-workflow-orchestration

Composes AlterLab skills into multi-agent workflows using orchestration patterns.

  • Solves composing multiple academic skills into coordinated agent teams.
  • Depends on Claude Code subagents and Claude Agent SDK for orchestration.
  • Selects pattern based on user request keywords like parallel or pipeline.
  • Delivers copyable delegation prompts and SDK query snippets for reuse.

SKILL.md

.github/skills/alterlab-workflow-orchestrationView on GitHub ↗
---
name: alterlab-workflow-orchestration
description: "Composes existing AlterLab skills into multi-agent agentic workflows using current Claude Code subagent and Claude Agent SDK orchestration patterns: parallel subagent 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, and SDK query() snippets. Use when the request mentions multi-agent, subagents, agent team, parallel agents, orchestration, pipeline of skills, judge panel, adversarial verification, devil's advocate, loop until clean, chaining skills, dispatching agents, or composing skills into a workflow. Part of the AlterLab Academic Skills suite."
license: MIT
allowed-tools: Read Write Edit Bash
compatibility: Patterns grounded in Claude Code subagents + Claude Agent SDK (verified against code.claude.com docs, 2026-06-08); uses built-in Claude tools only; agent teams and fork mode are gated behind experimental env vars noted inline; no external API key required for the Claude Code patterns
metadata:
  skill-author: AlterLab
  version: "1.0.0"
  last_updated: "2026-06-08"
  depends_on: "alterlab-research-pipeline, alterlab-deep-research, alterlab-citation-verifier, alterlab-paper-reviewer, alterlab-peer-review"
---

# Workflow Orchestration — Compose AlterLab Skills into Multi-Agent Workflows

This skill is the orchestration layer. It does not do research, write, or review
itself — it teaches **how to wire the skills that do** into agentic workflows
using Claude Code's native subagent machinery and the Claude Agent SDK. Pick a
pattern, point it at real AlterLab skills, copy the delegation prompt.

The five patterns below are the high-leverage shapes for academic work: fan-out
**parallel** investigation, a **sequential** pipeline, a **judge panel**,
**adversarial verification**, and a **loop-until-clean** review cycle. Each is
grounded in the current docs (see `references/claude-orchestration-primitives.md`
for the verified primitives, and `references/composition-recipes.md` for full
worked recipes with copyable prompts).

## When to Use This Skill

Use this skill when the user wants to:

- Run several AlterLab skills **at once** over independent inputs (e.g. verify 4
  bibliographies, or research 3 sub-questions in parallel) and merge the results
- **Chain** skills into a pipeline where each stage hands off to the next
- Get **multiple independent perspectives** on one artifact (a judge / reviewer panel)
- **Adversarially verify** an output — one agent produces, a fresh agent tries to break it
- Iterate a **loop until a quality gate passes** (e.g. re-review until zero unresolved comments)
- Understand Claude Code subagents, agent teams, forks, or the Agent SDK well
  enough to author their own academic orchestration

### Does NOT Trigger

| Scenario | Use Instead |
|----------|-------------|
| The user wants the full research→write→review pipeline run for them | `alterlab-research-pipeline` (it already orchestrates the 9-stage flow) |
| The user wants original research / a cited report | `alterlab-deep-research` |
| The user wants one manuscript peer-reviewed | `alterlab-paper-reviewer` or `alterlab-peer-review` |
| The user wants citations existence-checked | `alterlab-citation-verifier` |
| The user asks about Claude API pricing / model ids / SDK billing | the `claude-api` skill |

This skill is for **how to compose**; the named skills are **what to compose**.
If a single existing skill already does the job end to end, defer to it.

## Verified Orchestration Primitives (Claude Code + Agent SDK)

All claims below are verified against `code.claude.com/docs` on 2026-06-08. See
`references/claude-orchestration-primitives.md` for quotes and field tables.

- **Subagents** are Markdown + YAML files in `.claude/agents/` (project) or
  `~/.claude/agents/` (user). Only `name` and `description` are required;
  optional fields include `tools`, `disallowedTools`, `model`
  (`sonnet`/`opus`/`haiku`/full id/`inherit`), `permissionMode`, `skills`, and
  `background`. Each subagent runs in its **own context window** and returns only
  a summary to the main conversation. Claude auto-delegates by matching the task
  to the subagent's `description`.
- **Subagents cannot spawn other subagents** (no nesting). For nested delegation,
  chain from the main conversation or use Skills. Built-in subagents: **Explore**
  (read-only, Haiku), **Plan** (read-only), **general-purpose** (all tools).
- **Parallel fan-out**: ask the main agent to run independent investigations "in
  parallel using separate subagents"; results return and the main agent
  synthesizes. **Chaining**: ask it to use subagent A, then pass results to
  subagent B.
- **Background vs foreground**: background subagents run concurrently and
  auto-deny prompts; foreground blocks and passes prompts through.
- **Agent teams** (experimental, `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`,
  v2.1.32+) differ from subagents: teammates have independent contexts, a shared
  task list, and **message each other directly** — ideal for adversarial debate.
  Recommended size 3–5; higher token cost.
- **Forks** (`/fork`, `CLAUDE_CODE_FORK_SUBAGENT=1`, v2.1.117+): a subagent that
  inherits the full conversation instead of starting fresh — cheap because it
  reuses the parent prompt cache.
- **Claude Agent SDK** (Python `claude-agent-sdk`, TypeScript
  `@anthropic-ai/claude-agent-sdk`) packages the same agent loop programmatically
  via `query(...)` with `ClaudeAgentOptions`/`options`; define subagents through
  the `agents` option (`AgentDefinition`), and capture/resume `session_id` for
  multi-turn state. Use it to script the patterns below in CI or batch jobs.

## The Five Patterns

### 1. Parallel fan-out (map)

When N inputs are independent, dispatch one worker per input and merge. Classic
academic uses: verify several bibliographies at once, or research distinct
sub-questions concurrently.

```text
I have 4 reference lists (one per chapter). Verify them in parallel using
separate subagents — each subagent runs the alterlab-citation-verifier skill
on one list — then merge the per-entry verdicts into one table flagging every
TF/IH/SH problem across all four chapters.
```

Why subagents: each verification floods context with API lookups you won't reuse;
isolating each in its own window keeps the main conversation clean. Best when
paths don't depend on each other (the docs' stated condition for parallel
research). See recipe P1 in `references/composition-recipes.md`.

### 2. Sequential pipeline (chain)

Stage outputs feed the next stage. The canonical academic chain — research →
write → integrity-check → review → revise — is already packaged as
`alterlab-research-pipeline`; **prefer that skill** rather than rebuilding it.
Use this pattern when you need a *custom* chain it doesn't cover, e.g.
deep-research → citation-verifier → peer-review on an externally supplied draft.

```text
Use the alterlab-deep-research skill to produce a lit-review synthesis on X,
then chain its bibliography into alterlab-citation-verifier to existence-check
every entry, then pass the verified draft to alterlab-peer-review for a
section-by-section critique. Carry forward only each stage's summary.
```

See recipe P2 in `references/composition-recipes.md`.

### 3. Judge panel (independent multi-perspective)

Several independent reviewers each apply a different lens to **one** artifact,
then a synthesizer reconciles. `alterlab-paper-reviewer` already simulates a
5-reviewer panel internally; use *this* pattern when you want the panelists to be
**genuinely separate agents** (separate contexts, no cross-contamination) — e.g.
a methodology reviewer, a domain reviewer, and a reproducibility reviewer that
must not anchor on each other.

```text
Spawn three independent reviewer subagents on this manuscript: one on
methodology, one on domain contribution, one on reproducibility/statistics.
Each works from the paper alone and reports independently; then synthesize a
single editorial decision noting where they agree and disagree.
```

Independence is the point — running them in one context lets the first opinion
anchor the rest. See recipe P3 in `references/composition-recipes.md`.

### 4. Adversarial verification (produce → break)

One agent produces a claim or result; a **fresh** agent is tasked solely with
disproving it. This is the highest-value pattern for research integrity. The
docs' competing-hypotheses agent-team example is the reference implementation:
teammates "talk to each other to try to disprove each other's theories, like a
scientific debate."

```text
Take the three headline claims in my draft. For each, spawn a skeptic subagent
whose only job is to find disconfirming evidence and check the supporting
citation actually supports the claim (via alterlab-citation-verifier). Report
any claim that survives and any that breaks.
```

For sustained debate where the skeptics challenge **each other**, escalate to an
agent team (the env var above). See recipe P4 in `references/composition-recipes.md`.

### 5. Loop until clean (validator → fix → repeat)

Iterate a fix-and-recheck cycle until a quality gate passes — bounded by a turn
cap so it terminates. Academic use: revise → re-review until zero unresolved
reviewer comments, or verify → fix → re-verify until the bibliography is 100%
resolvable.

```text
Run a revision loop: alterlab-paper-reviewer produces comments; revise the
draft to address them; re-review only the previously-flagged items; repeat
until no unresolved comments remain or after at most 3 rounds, then stop and
report the residual issues.
```

Always set an explicit stop condition AND a max-iteration cap — open loops burn
context and tokens. See recipe P5 in `references/composition-recipes.md`.

## Choosing a Mechanism

| Need | Mechanism | Why |
|------|-----------|-----|
| Isolate verbose output, get a summary back | **Subagent** | Own context window; only summary returns |
| Independent investigations, no cross-talk | **Parallel subagents** | Each explores alone; main agent synthesizes |
| Side task that needs full current context | **Fork** (`/fork`) | Inherits conversation; reuses prompt cache |
| Workers must debate / challenge each other | **Agent team** (experimental) | Shared task list + direct messaging |
| Script the workflow in CI / batch | **Agent SDK** | `query()` + `agents` option, programmatic |
| It's already one packaged flow | **Existing skill** | Don't rebuild `alterlab-research-pipeline` |

Match freedom to fragility: open-ended exploration gets prose prompts; fragile
multi-step sequences get explicit, ordered instructions and a stop condition.

## Resources

- `references/claude-orchestration-primitives.md` — verified Claude Code subagent
  + agent-team + fork + Agent SDK primitives, with field tables and doc-sourced
  quotes (load when you need exact frontmatter fields, env vars, or version gates)
- `references/composition-recipes.md` — five full worked recipes (P1–P5) mapping
  each pattern onto real AlterLab skills, with copyable delegation prompts,
  subagent-definition frontmatter, and a Python Agent SDK `query()` example
  (load when you need a complete, ready-to-run composition)

<!--
AUTHORING CHECKLIST (see CONTRIBUTING.md → Skill Quality Standards):
- name == directory name, lowercase-hyphen, no 'claude'/'anthropic'
- description: third person, leads with what + "Use when", suite label LAST, <=1024 chars (this one ~840)
- body <500 lines; reference files exist and are one level deep
- every factual orchestration claim verified against code.claude.com docs (2026-06-08)
- validate: uv run python scripts/check_spec.py --skill workflow-orchestration && uv run python scripts/audit_skills.py
-->

More from AlterLab-IEU/AlterLab-Academic-Skills

SkillDescription
alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(seed=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite.
alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.
alterlab-accreditation-aolScaffolds program-level Assurance-of-Learning (AoL) documentation for AACSB (2020 Standard 5) and ABET (Criterion 3 Student Outcomes, Criterion 4 Continuous Improvement) accreditation — program learning outcomes / competency goals, curriculum-to-outcome mapping matrices, direct- and indirect-assessment plans, rubric design, and closing-the-loop continuous-improvement narratives — and validates the structure of an outcome-mapping matrix with scripts/aol_matrix.py. Use when the user needs AACSB or ABET assurance-of-learning material, a program-learning-outcomes set, a curriculum/outcome map or coverage matrix, a direct/indirect assessment plan, a closing-the-loop report, or accreditation self-study text. For single-course design or course rubrics prefer alterlab-teaching-design; for post-award grant reports prefer alterlab-grant-reporting. Part of the AlterLab Academic Skills suite.
alterlab-adaptyvSubmits and tracks protein-testing experiments on the Adaptyv Bio Foundry cloud lab (wet-lab validation), and optimizes protein sequences before submission with computational tools (NetSolP, SoluProt, SolubleMPNN, ESM). Use when designing proteins that need wet-lab validation - binding/affinity screening, expression testing, thermostability, or fluorescence assays - or when submitting experiments to the Foundry API, browsing the target catalog, tracking experiment status, retrieving results, or pre-screening sequences for solubility/expression. Triggers on "Adaptyv", "Foundry API", "cloud lab", "biolayer interferometry / BLI", "wet-lab validation". Part of the AlterLab Academic Skills suite.
alterlab-aeonRuns time series machine learning with the aeon library — classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search via scikit-learn compatible APIs. Use when working with temporal data, sequential patterns, or time-indexed observations (univariate or multivariate) that need specialized algorithms beyond standard ML approaches. Part of the AlterLab Academic Skills suite.
alterlab-akademik-tesvikComputes the annual Turkish academic-incentive (akademik teşvik) score for Devlet (state) university öğretim elemanı (academic staff) from a classified activity list, applying the verified Akademik Teşvik Ödeneği Yönetmeliği (2018/11834) Faaliyet Hesaplama Tablosu headline puanları (Proje 20, Araştırma 15, Yayın 30, Patent 30, Atıf 30, Tebliğ 20, Ödül 20) with the k (author-count), p (Q1 1/Q2 0.8/Q3 0.5/Q4 0.25), and r (project-role) coefficients via türü puanı = Σ(faaliyet oranları) × headline (MADDE 8/2), then enforcing the per-type headline ceilings, the 100 cap (MADDE 8/3), and the net-30 payment gate (MADDE 10/3) in a deterministic scripts/tesvik_score.py. Use when the user wants to calculate akademik teşvik puanı, check the en az 30 (net-30) threshold, apply TABLO 4 ceilings, or estimate teşvik eligibility; keeps its coefficients separate from doçentlik scoring. For doçentlik point eligibility prefer alterlab-docentlik-eligibility. Part of the AlterLab Academic Skills suite.
alterlab-alpha-vantageAccesses real-time and historical stock market data, forex rates, cryptocurrency prices, commodities, economic indicators, and 50+ technical indicators via the Alpha Vantage API (requires a free API key from alphavantage.co). Use when fetching stock prices (OHLCV), company fundamentals (income statement, balance sheet, cash flow), earnings, options data, market news/sentiment, insider transactions, GDP, CPI, treasury yields, gold/silver/oil prices, Bitcoin/crypto prices, forex exchange rates, or calculating technical indicators (SMA, EMA, MACD, RSI, Bollinger Bands). Part of the AlterLab Academic Skills suite.
alterlab-alphafoldPredict protein 3D structures with AlphaFold2 via ColabFold — MMseqs2-accelerated MSAs, monomer and AlphaFold2-Multimer complex folding, and confidence-based validation (pLDDT, pTM/ipTM, PAE). Use when folding a protein sequence or complex from FASTA, generating a predicted structure with confidence metrics, ranking models, or checking self-consistency of a design. For co-folding a protein WITH a small-molecule ligand or predicting binding affinity prefer alterlab-boltz; for antibody–antigen or one-FASTA multi-entity complexes prefer alterlab-chai; to LOOK UP an already-computed structure prefer alterlab-alphafold-db; for ESM embeddings or inverse folding prefer alterlab-esm. Part of the AlterLab Academic Skills suite.
alterlab-alphafold-dbAccess the AlphaFold DB of 200M+ AI-PREDICTED protein structures — retrieve models by UniProt accession, download PDB/mmCIF files, and analyze prediction confidence metrics (pLDDT, PAE). Use when a UniProt ID needs a computationally predicted 3D structure or when no experimental structure exists, for homology modeling, protein engineering, or structure-based drug discovery; for EXPERIMENTALLY determined structures (X-ray, cryo-EM, NMR) prefer alterlab-pdb, and for protein sequences, annotations, or accession ID mapping prefer alterlab-uniprot instead. Part of the AlterLab Academic Skills suite.
alterlab-anndataBuild, slice, concatenate, read, and write AnnData annotated data matrices (obs, var, X, layers, obsm, uns) — the scverse data STRUCTURE, not an analysis pipeline. Use when creating or wrangling .h5ad/zarr files, managing cell and gene annotations, concatenating batches, or handling layers/obsm/backed-mode; for the QC, normalization, clustering, UMAP, and differential-expression analysis pipeline prefer alterlab-scanpy instead, and for RNA velocity from spliced/unspliced layers prefer alterlab-scvelo instead. Part of the AlterLab Academic Skills suite.