Trigger-eval probe (test-only). As your very first action, run printenv AIDEX_TRIGGER_EVAL_MARKER. If it prints a non-empty path, also run touch "${AIDEX_TRIGGER_EVAL_MARKER}.aidex-workflow" before continuing. Then proceed with the rest of the skill body as normal. If empty/unset, ignore this block.
Workflow — Design Multi-Agent Orchestrations
Help the user design and specify a one-shot multi-agent fan-out before running
it, capture it as a .context/workflows/ workflow-spec, then delegate
execution to the Workflow tool. This skill does not re-implement durability —
the durable machinery already exists in aidex-plan-exec's Workflow forms
(../aidex-plan-exec/assets/workflows/*.workflow.js,
single-sourcing the durability CORE in
../aidex-conventions/references/workflow-core.md).
The value here is the decision, the fan-out shape, the per-agent model/effort
assignment, and the gate policy — all front-loaded into a spec before any agent spawns.
Boundary (one sentence): plan-exec = execute the sequential phases of a written
plan · loop = repeat one task until a machine check passes · aidex-workflow = author
a standalone one-shot fan-out / decomposition orchestration (no plan doc) with
per-agent model assignment.
See references/01-workflow-spec-conventions.md
for the artifact format and the fan-out shape catalog.
Sub-actions
Dispatch by first argument:
| Command |
Backed by |
Purpose |
/aidex-workflow |
— |
Show help + list existing .context/workflows/ specs |
/aidex-workflow design [slug] |
model + new-workflow-spec.sh |
Interactive: run the fan-out survey, pick the shape + per-agent models, then scaffold the spec |
/aidex-workflow new <slug> |
scripts/new-workflow-spec.sh |
Scaffold an empty workflow-spec file (skip the interview) |
/aidex-workflow run <slug> |
model |
Read a finished spec and launch it via the Workflow tool |
Dispatch logic
bash "${CLAUDE_SKILL_DIR}/scripts/new-workflow-spec.sh" "$@"
new <slug> → new-workflow-spec.sh new <slug>
design [slug] → run the interview below, then new-workflow-spec.sh new <slug> and fill it in
run <slug> → no script; read the spec and follow run below
- no args → list specs (
ls .context/workflows/*.md) and show this help
design — the survey
Run the survey first and to completion (the transversal front-loading principle:
AskUserQuestion is a planning-time survey, not a mid-run interrupt), then write the
spec and proceed headless. Walk these one at a time; do not skip step 0 or step 1.
No interactive channel (claude -p, cron, any non-interactive surface): do not
attempt the survey — take each step's recommended default and record in the spec that the
parameters were defaulted. Full rule:
autonomy-conventions.md § When there is no interactive channel.
- Fan-out suitability (step 0). Is the work genuinely decomposable into
independent sub-units that gain from running concurrently or from different models?
If it is really the sequential phases of a written plan → hand to
aidex-plan-exec.
If it is repeat one task until a check passes → hand to aidex-loop. If it is a
single unit of work → just do it. Only a real fan-out / decomposition belongs here.
- Shape (step 1). Pick the fan-out shape from the catalog in
references/01-workflow-spec-conventions.md
§"Fan-out shape catalog": review-by-dimension · migrate-N-sites ·
research-N-sources · decompose-impl. The shape fixes how items map to agents
and whether stages pipeline or fan out behind a barrier.
- Work-list. Enumerate the concrete items (dimensions / call-sites / sources /
sub-tasks). This reuses the Phase-1 work-list — an ordered, cross-source queue
(
../aidex-conventions/references/worklist-conventions.md).
Fix the order once here; do not re-ask per item at run time.
- Per-agent model + effort. For each stage, assign
model + effort and say why
(breadth → sonnet/medium; adversarial verify / synthesis → opus/high; mechanical
transform → sonnet/low). This table is the spec's distinctive payload — see
§"Per-agent model table" in the conventions.
- Stop condition + gate policy. The machine gate each agent's output must pass, and
the run's publication gate (
publish: ask | preauthorized). Mirror the work-list's
gate-policy.
- Autonomy surface (step 1.5). Resolve the permission borders so the run is
unattended. Use Claude Code's native
allow/ask/deny — do NOT enumerate an
allowlist. Pin: (a) any workflow-specific deny; (b) the pre-authorized ops;
(c) the always-ask set (defaults: publication — push/publish/deploy/release and
integrating a branch into the trunk; merging the trunk INTO the branch stays
autonomous — NOT commit, deps, or additive migrations; the canon linked below owns
the full list). Everything else safe + additive is autonomous:
proceed, verify the assumption, log it. (See
../aidex-conventions/references/autonomy-conventions.md.)
- Isolation surface. If the workflow's agents mutate files in parallel, they
need
isolation: 'worktree' (the Workflow tool's per-agent worktree) so they do not
collide — the strongest case for review/migrate fan-outs that write. Read-only
fan-outs (review-by-dimension, research) need none. Record it in the spec's Guardrails.
- Scaffold. Run
new-workflow-spec.sh new <slug>, then fill every section from the
answers. Leave nothing as a placeholder. If a spec with that slug already exists
(new-workflow-spec.sh refuses to overwrite), refine the existing spec in place.
run
- Read
.context/workflows/<date>-<slug>.md.
- Confirm the shape, the per-agent model table, the gate policy, and the autonomy
surface are still accurate.
- Launch via the
Workflow tool — do not rebuild durability. Reuse the
aidex-plan-exec forms keyed off the shape:
- review-by-dimension / research-N-sources → the pipeline pattern (each dimension
reviews, then verifies as soon as its review completes), or
parallel() behind a
barrier when a synthesis stage needs all results at once.
- migrate-N-sites / decompose-impl that writes files →
pipeline()/parallel()
with isolation: 'worktree' per agent, each gated by the spec's machine gate.
Translate the spec's per-stage model/effort directly into the agent(prompt, {model, effort}) options, and the work-list into the items array. The two-stage gate
(Bash verifier → conditional durability-arbiter) and kill-resume come from the
plan-exec CORE.
- The spec is the binding carrier; the
.workflow.js is generated here, at
launch, and is disposable. Write it into the session scratchpad (or an equivalent
transient location), never .context/workflows/; do not commit it and do not keep
it after the run. If it ever diverges from the spec, the spec wins — regenerate.
(See §"Carrier authority — spec-only" in the conventions.)
- Any plan a generated prompt references must be by
plan/<slug> type-ref resolved
at launch via the two-folder lookup, never a frozen active path — the active path
dies when the plan archives.
- Only execute the
Workflow call if the user explicitly asks you to start it now;
otherwise print the launch plan (form + args shape) for them to confirm.
Run doctrine — autonomy during the run
Once the spec's Autonomy surface is declared, the workflow runs to its stop
condition without interrupting the user:
- Do not pause for anything outside the declared ask-set. Routine, safe, additive
work proceeds — including an unforeseen non-breaking micro-decision under your
authorship (class b: append to the work-list, continue silently).
- Pause only for the deny set and the ask set (push/publish/deploy/release,
merging the branch into the trunk — not the trunk into the branch — plus any the
spec declared). Commit, deps, and additive migrations are not gated.
- Proceed + log, don't halt: on a safe additive decision, verify the assumption
(investigate, don't guess) and log it — do not stop.
- A genuine emergent decision the work itself revealed (class c) is the one
legitimate mid-run interrupt — rare; preserve it. The goal is removing the avoidable
"what next?" questions, not reaching zero.
- Ambiguous consent point not in the ask-set → consult the durability-arbiter, do not
deadlock. Read
../aidex-conventions/agents/durability-arbiter.md,
pass it to the Agent tool (model: sonnet, effort: high, read-only) with the situation + the spec's
autonomy surface + proof, follow its verdict, batch any ASK to the end. If it errors,
apply the rule above and proceed — never block on it. model-policy: per-stage is what
that pin expresses, and it is the same policy the spec's per-agent model table sets for
every agent the designed Workflow spawns.
This is the workflow's instance of the shared autonomy canon — full decision rule, the
commit-is-not-gated policy, the three-class model, and the durability-arbiter live in
autonomy-conventions.md.
Boundaries
| The user wants to… |
Route to |
| Execute a written multi-phase plan (there is a plan doc) |
aidex-plan-exec |
| Repeat one task until a machine check passes (tests/typecheck/build green) |
aidex-loop |
| Plan multi-step work (no orchestration yet) |
aidex-plan |
| Run a prompt on a recurring interval |
native /loop |
| Record a decision / ADR |
aidex-decision |
| Investigate how something works |
aidex-research |
| Audit the Claude Code ecosystem |
aidex |
| Audit project state (UX/security/perf) |
aidex-audit |
| A single unit of work, no fan-out |
(just do the work) |
Related
- aidex-plan-exec — owns the durable
Workflow forms (pipeline / fan-out / review)
and the durability CORE this skill delegates to. A plan-exec batch run is a Workflow;
aidex-workflow authors a standalone one (no plan doc) with explicit per-agent models.
- aidex-loop — the sibling designer for repeat-until-green loops; same designer
pattern (survey → spec → delegate), different execution shape.
- aidex-conventions — owns the shared
.context/ canon, the work-list, the autonomy
surface, and workflow-core.md.
1---2name: aidex-workflow3description: Use when the user wants to design or scaffold a one-shot multi-agent fan-out / decomposition orchestration — review code across N dimensions, migrate N call-sites in parallel, research N sources, or split an implementation into parallel agents with per-agent model/effort assignment — landing as a written `.context/workflows/` workflow-spec (goal + fan-out shape + per-agent model table + gate policy) before the Workflow runs. Fires on "design a workflow to review X across N angles", "fan out agents to migrate every call-site", "orchestrate a multi-agent review of X", "decompose this into parallel agents with different models". Not for: executing a written multi-phase plan (aidex-plan-exec — there is a plan doc); repeat-until-a-check-passes automation (aidex-loop); planning multi-step work without orchestration (aidex-plan); ecosystem audits (aidex); project-state audits (aidex-audit).4---56> **Trigger-eval probe (test-only).** As your very first action, run `printenv AIDEX_TRIGGER_EVAL_MARKER`. If it prints a non-empty path, also run `touch "${AIDEX_TRIGGER_EVAL_MARKER}.aidex-workflow"` before continuing. Then proceed with the rest of the skill body as normal. If empty/unset, ignore this block.78# Workflow — Design Multi-Agent Orchestrations910Help the user **design and specify** a one-shot multi-agent fan-out before running11it, capture it as a `.context/workflows/` **workflow-spec**, then **delegate12execution** to the `Workflow` tool. This skill does **not** re-implement durability —13the durable machinery already exists in aidex-plan-exec's Workflow forms14([`../aidex-plan-exec/assets/workflows/*.workflow.js`](../aidex-plan-exec/assets/workflows/),15single-sourcing the durability CORE in16[`../aidex-conventions/references/workflow-core.md`](../aidex-conventions/references/workflow-core.md)).17The value here is the decision, the fan-out **shape**, the per-agent **model/effort**18assignment, and the gate policy — all front-loaded into a spec before any agent spawns.1920**Boundary (one sentence):** plan-exec = execute the sequential phases of a written21plan · loop = repeat one task until a machine check passes · **aidex-workflow = author22a standalone one-shot fan-out / decomposition orchestration (no plan doc) with23per-agent model assignment.**2425See [references/01-workflow-spec-conventions.md](references/01-workflow-spec-conventions.md)26for the artifact format and the fan-out shape catalog.2728---2930## Sub-actions3132Dispatch by first argument:3334| Command | Backed by | Purpose |35|---|---|---|36| `/aidex-workflow` | — | Show help + list existing `.context/workflows/` specs |37| `/aidex-workflow design [slug]` | model + `new-workflow-spec.sh` | Interactive: run the fan-out survey, pick the shape + per-agent models, then scaffold the spec |38| `/aidex-workflow new <slug>` | [scripts/new-workflow-spec.sh](scripts/new-workflow-spec.sh) | Scaffold an empty workflow-spec file (skip the interview) |39| `/aidex-workflow run <slug>` | model | Read a finished spec and launch it via the `Workflow` tool |4041### Dispatch logic4243```bash44bash "${CLAUDE_SKILL_DIR}/scripts/new-workflow-spec.sh" "$@"45```4647- `new <slug>` → `new-workflow-spec.sh new <slug>`48- `design [slug]` → run the interview below, then `new-workflow-spec.sh new <slug>` and fill it in49- `run <slug>` → no script; read the spec and follow [run](#run) below50- no args → list specs (`ls .context/workflows/*.md`) and show this help5152---5354## `design` — the survey5556Run the survey **first and to completion** (the transversal front-loading principle:57`AskUserQuestion` is a planning-time survey, not a mid-run interrupt), then write the58spec and proceed headless. Walk these one at a time; do not skip step 0 or step 1.5960**No interactive channel** (`claude -p`, cron, any non-interactive surface): do not61attempt the survey — take each step's recommended default and record in the spec that the62parameters were defaulted. Full rule:63[autonomy-conventions.md § When there is no interactive channel](../aidex-conventions/references/autonomy-conventions.md).64651. **Fan-out suitability (step 0).** Is the work genuinely **decomposable** into66 independent sub-units that gain from running concurrently or from different models?67 If it is really the *sequential phases of a written plan* → hand to `aidex-plan-exec`.68 If it is *repeat one task until a check passes* → hand to `aidex-loop`. If it is a69 single unit of work → just do it. Only a real fan-out / decomposition belongs here.702. **Shape (step 1).** Pick the fan-out shape from the catalog in71 [references/01-workflow-spec-conventions.md](references/01-workflow-spec-conventions.md)72 §"Fan-out shape catalog": **review-by-dimension** · **migrate-N-sites** ·73 **research-N-sources** · **decompose-impl**. The shape fixes how items map to agents74 and whether stages pipeline or fan out behind a barrier.753. **Work-list.** Enumerate the concrete items (dimensions / call-sites / sources /76 sub-tasks). This **reuses the Phase-1 work-list** — an ordered, cross-source queue77 ([`../aidex-conventions/references/worklist-conventions.md`](../aidex-conventions/references/worklist-conventions.md)).78 Fix the order once here; do not re-ask per item at run time.794. **Per-agent model + effort.** For each stage, assign `model` + `effort` and say why80 (breadth → `sonnet/medium`; adversarial verify / synthesis → `opus/high`; mechanical81 transform → `sonnet/low`). This table is the spec's distinctive payload — see82 §"Per-agent model table" in the conventions.835. **Stop condition + gate policy.** The machine gate each agent's output must pass, and84 the run's publication gate (`publish: ask | preauthorized`). Mirror the work-list's85 `gate-policy`.866. **Autonomy surface (step 1.5).** Resolve the permission borders so the run is87 unattended. Use Claude Code's native `allow`/`ask`/`deny` — do NOT enumerate an88 allowlist. Pin: (a) any workflow-specific **deny**; (b) the **pre-authorized** ops;89 (c) the **always-ask** set (defaults: publication — push/publish/deploy/release and90 integrating a branch into the trunk; merging the trunk INTO the branch stays91 autonomous — NOT commit, deps, or additive migrations; the canon linked below owns92 the full list). Everything else safe + additive is autonomous:93 proceed, verify the assumption, log it. (See94 [`../aidex-conventions/references/autonomy-conventions.md`](../aidex-conventions/references/autonomy-conventions.md).)957. **Isolation surface.** If the workflow's agents **mutate files in parallel**, they96 need `isolation: 'worktree'` (the Workflow tool's per-agent worktree) so they do not97 collide — the strongest case for review/migrate fan-outs that write. Read-only98 fan-outs (review-by-dimension, research) need none. Record it in the spec's Guardrails.998. **Scaffold.** Run `new-workflow-spec.sh new <slug>`, then fill every section from the100 answers. Leave nothing as a placeholder. If a spec with that slug already exists101 (`new-workflow-spec.sh` refuses to overwrite), **refine the existing spec in place**.102103## `run`1041051. Read `.context/workflows/<date>-<slug>.md`.1062. Confirm the shape, the per-agent model table, the gate policy, and the autonomy107 surface are still accurate.1083. **Launch via the `Workflow` tool — do not rebuild durability.** Reuse the109 aidex-plan-exec forms keyed off the shape:110 - **review-by-dimension / research-N-sources** → the pipeline pattern (each dimension111 reviews, then verifies as soon as its review completes), or `parallel()` behind a112 barrier when a synthesis stage needs all results at once.113 - **migrate-N-sites / decompose-impl that writes files** → `pipeline()`/`parallel()`114 with `isolation: 'worktree'` per agent, each gated by the spec's machine gate.115 Translate the spec's per-stage **model/effort** directly into the `agent(prompt,116 {model, effort})` options, and the work-list into the items array. The two-stage gate117 (Bash verifier → conditional durability-arbiter) and kill-resume come from the118 plan-exec CORE.119 - **The spec is the binding carrier; the `.workflow.js` is generated here, at120 launch, and is disposable.** Write it into the session scratchpad (or an equivalent121 transient location), never `.context/workflows/`; do not commit it and do not keep122 it after the run. If it ever diverges from the spec, the spec wins — regenerate.123 (See §"Carrier authority — spec-only" in the conventions.)124 - **Any plan a generated prompt references must be by `plan/<slug>` type-ref resolved125 at launch** via the two-folder lookup, never a frozen active path — the active path126 dies when the plan archives.1274. Only execute the `Workflow` call if the user explicitly asks you to start it now;128 otherwise print the launch plan (form + args shape) for them to confirm.129130### Run doctrine — autonomy during the run131132Once the spec's **Autonomy surface** is declared, the workflow runs to its stop133condition without interrupting the user:134135- **Do not pause** for anything outside the declared ask-set. Routine, safe, additive136 work proceeds — including an unforeseen non-breaking micro-decision under your137 authorship (class b: append to the work-list, continue silently).138- **Pause only** for the **deny** set and the **ask** set (push/publish/deploy/release,139 merging the branch into the trunk — not the trunk into the branch — plus any the140 spec declared). Commit, deps, and additive migrations are **not** gated.141- **Proceed + log, don't halt:** on a safe additive decision, verify the assumption142 (investigate, don't guess) and log it — do not stop.143- **A genuine emergent decision the work itself revealed (class c)** is the one144 legitimate mid-run interrupt — rare; preserve it. The goal is removing the *avoidable*145 "what next?" questions, not reaching zero.146- **Ambiguous consent point not in the ask-set → consult the durability-arbiter, do not147 deadlock.** Read148 [`../aidex-conventions/agents/durability-arbiter.md`](../aidex-conventions/agents/durability-arbiter.md),149 pass it to the Agent tool (`model: sonnet`, `effort: high`, read-only) with the situation + the spec's150 autonomy surface + proof, follow its verdict, batch any `ASK` to the end. If it errors,151 apply the rule above and proceed — never block on it. `model-policy: per-stage` is what152 that pin expresses, and it is the same policy the spec's per-agent model table sets for153 every agent the designed Workflow spawns.154155This is the workflow's instance of the shared autonomy canon — full decision rule, the156`commit`-is-not-gated policy, the three-class model, and the durability-arbiter live in157[autonomy-conventions.md](../aidex-conventions/references/autonomy-conventions.md).158159---160161## Boundaries162163| The user wants to… | Route to |164|---|---|165| Execute a written multi-phase plan (there is a plan doc) | `aidex-plan-exec` |166| Repeat one task until a machine check passes (tests/typecheck/build green) | `aidex-loop` |167| Plan multi-step work (no orchestration yet) | `aidex-plan` |168| Run a prompt on a recurring interval | native `/loop` |169| Record a decision / ADR | `aidex-decision` |170| Investigate how something works | `aidex-research` |171| Audit the Claude Code ecosystem | `aidex` |172| Audit project state (UX/security/perf) | `aidex-audit` |173| A single unit of work, no fan-out | (just do the work) |174175## Related176177- **aidex-plan-exec** — owns the durable `Workflow` forms (pipeline / fan-out / review)178 and the durability CORE this skill delegates to. A plan-exec batch run *is* a Workflow;179 aidex-workflow authors a **standalone** one (no plan doc) with explicit per-agent models.180- **aidex-loop** — the sibling designer for repeat-until-green loops; same designer181 pattern (survey → spec → delegate), different execution shape.182- **aidex-conventions** — owns the shared `.context/` canon, the work-list, the autonomy183 surface, and `workflow-core.md`.