Source profileQuality 96/100

event4u-app/agent-config/src/skills/subagent-orchestration/SKILL.md

subagent-orchestration

Use when orchestrating implementer/judge subagents — form gate + nine modes (do-and-judge ±two-stage, steps/parallel/worktrees, competitively, debate, live-app-judge, adversarial-council).

Source repository stars
7
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Use when orchestrating implementer/judge subagents — form gate + nine modes (do-and-judge ±two-stage, steps/parallel/worktrees, competitively, debate, live-app-judge, adversarial-council).

Best for

  • A task benefits from a second agent reviewing before apply — safety,
  • A plan has clear, independent slices that can be worked on in
  • A solution space is broad enough that multiple candidate

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/subagent-orchestration"
Safe inspection promptEditorial

Inspect the Agent Skill "subagent-orchestration" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/subagent-orchestration/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    2. do-and-judge-two-stage

    Implementer produces a diff; two judges run sequentially — spec compliance first, code quality second. Stage-one BLOCKED shortcuts the loop (no point quality-reviewing a diff that misses the spec). Stage routing + why-two-stages rationale → modes-detail § Mode 2.

    Implementer produces a diff; two judges run sequentially — spec compliance first, code quality second. Stage-one BLOCKED shortcuts the loop (no point quality-reviewing a diff that misses the spec). Stage routing + why-t…
  2. 02

    9. adversarial-verification-council (gated — opt-in, advisory)

    A panel of N (default 2) distinct-model skeptics red-teams a real, already-verified change through the judge- lenses — each prompted to break it. Returns reconcile deterministically (lib/adversarialreconcile.ts) into one findings-by-severity envelope with provenance + cross-mode…

    prompts/adversarial-verification-council.mdA panel of N (default 2) distinct-model skeptics red-teams a real, already-verified change through the judge- lenses — each prompted to break it. Returns reconcile deterministically (lib/adversarialreconcile.ts) into on…Disposition (2026-07-28, honest null). The adversarial-council finding- coverage benchmark resolved as a published null (see docs/benchmark.md) — this mode is NOT sold as a defect-detection capability. It stays default-…
  3. 03

    Procedure

    Before picking a mode, check:

    Is the task single-change or multi-step?Are slices truly independent, or do they share state?Is solution space narrow (one right answer) or broad (trade-offs)?
  4. 04

    When to use

    A task benefits from a second agent reviewing before apply — safety, regression risk, cross-layer change A plan has clear, independent slices that can be worked on in parallel — unrelated bug fixes, multi-file migrations A solution space is broad enough that multiple candidate i…

    A task benefits from a second agent reviewing before apply — safety,A plan has clear, independent slices that can be worked on inA solution space is broad enough that multiple candidate
  5. 05

    Goal

    Land a verified change (or set of changes) by combining implementer and judge subagents in a mode chosen deliberately, with model pairing read from .agent-settings.yml — never silently improvised.

    Land a verified change (or set of changes) by combining implementer and judge subagents in a mode chosen deliberately, with model pairing read from .agent-settings.yml — never silently improvised.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score96/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars7SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/subagent-orchestration/SKILL.md
Commit
0adf49a8ae84b0ff6e2de8759eea43257e020eff
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

subagent-orchestration

When to use

  • A task benefits from a second agent reviewing before apply — safety, regression risk, cross-layer change
  • A plan has clear, independent slices that can be worked on in parallel — unrelated bug fixes, multi-file migrations
  • A solution space is broad enough that multiple candidate implementations are worth producing and comparing
  • The user explicitly asks "have a second agent review this" or "try this two different ways"

Do NOT use when:

  • The task is small and the overhead of a second agent exceeds the value — single file, one-liner fix
  • The user is still exploring — route to brainstorming / planning skills first
  • Budget is the constraint — each subagent call multiplies cost; non-interactive bulk cohorts → batch/caching via the token-optimizer index branch
  • The implementer and judge would be the same model on the same context — no added signal

Goal

Land a verified change (or set of changes) by combining implementer and judge subagents in a mode chosen deliberately, with model pairing read from .agent-settings.yml — never silently improvised.

The Iron Law

NO JUDGE ON THE SAME MODEL AS THE IMPLEMENTER ON THE SAME CONTEXT.

Same model + same context = same blind spots. The whole point of a judge is a fresh pair of eyes. If .agent-settings.yml resolves to identical implementer and judge models, surface the mismatch before running — do not silently continue.

RDP: parallel async dispatch by default

Within the Reasoning Discipline Protocol, dispatch independent subtasks to parallel subagents by default and keep working while they run (async), rather than blocking on each return — intervene only if one goes off track. Engage per rdp-gate.

Settings-gated auto-dispatch

"By default" is governed by the delegation-policy rule — the single source of the auto-trigger. It gates on the activation context (auto-orchestration-activation): dispatch only when subagents.enabled, subagents.auto != off, the host manifest reports subagent_spawn: true, and the task is classified delegable. auto: ask → ask once; auto: on → surface mode + per-subtask tiers in one line; any gate failing → in-session no-op. Never lifts a safety floor.

Worker-prompt contract

Every dispatched worker prompt obeys five rules that prevent the two classic handoff failures (lossy re-summarization dropping the user's requirements; over-scripted prompts that break on first contingency): (a) user constraints verbatim, (b) describe the goal — don't script the approach, (c) translate environment paths into the worker's sandbox, (d) pre-declare check-in conditions, (e) attach relevant knowledge read-only (auto-surface, never auto-write — ADR-098 floor). The five rules verbatim: subagent-spawn-contract § Worker-prompt rules.

When to delegate at all is delegation-policy; the spawn boundary is the subagent-spawn-contract.

Hand-off worked examples

Ordered / fan-out hand-offs embed each step's return verbatim in the next prompt and state what to do with it (never "continue from before" — the lossy re-summarization failure). Two worked shapes: subagent-spawn-contract § Hand-off worked examples.

Form gate — deterministic, BEFORE mode selection

With auto-dispatch on by default (ADR-117), mode selection happens without a human in the loop — so the FORM is decided by a static table first, and only then is the specific mode picked inside that form. Static table only: no learned routing, no self-modifying selector (rejected, stays rejected).

Task shape (structural signal)FormModes in the form
≥ 2 independent, verifiable slicesparalleldo-in-parallel, do-competitively
Multi-step cross-wing chain needing filesystem isolationworktreesdo-in-worktrees
Ordered steps with declared dependenciesstepsdo-in-steps
Single change with non-trivial risk / contested spec / decisionjudgedo-and-judge, do-and-judge-two-stage, judge-with-debate, do-with-live-app-judge
High-risk change needing defect-FINDING coverage (opt-in, advisory)verify-counciladversarial-verification-council (default-off; subagents.adversarial_council)
Single slice below the delegability floor, unstructured, or frontier-pricednoneno dispatch — run in-session

Rules:

  • The gate consumes the SAME structural signals as auto_dispatch.ts::classifyTask (slice count, dependency declarations, size floor) — it never re-interprets the task text on vibes.
  • Ambiguous shape → none (in-session), never a speculative spawn — the delegation-policy default.
  • Record the outcome in the telemetry line (dispatch_mode field, mode id or none) so the gate's value is measurable inside the ADR-117 prove-or-drop window.

Severity-conditioned team composition — conditions pattern

Incident-style severity tiers (Critical / High / Medium / Low) refine composition and activation within the form the static gate already picked — severity never overrides the form gate, the Iron Law, or any safety floor. Guidance, not a new object class (persona-catalog disposition). Severity→composition table + escalation rule → subagent-modes-detail § Severity-conditioned team composition.

The nine modes

Each mode has a decision row: when to use, when not, and the expected model pairing. Defaults come from subagent-configuration.

Topology hints — per-mode communication shape

Descriptive lookup material (per-mode topology table, anti-drift default, glossary) lives in subagent-topologies — pull it for capacity planning; it is metadata, not runtime-enforced.

Per-mode decision rows (when to use / when not / model pairing) and the mode-2 stage-routing contract live in subagent-modes-detail § Modes 1–6 — pull them at dispatch time.

1. do-and-judge

Implementer produces a diff; judge reviews; loop applies, revises, or hands off. Hard ceiling: two revision cycles, then stop and hand back to the user.

2. do-and-judge-two-stage

Implementer produces a diff; two judges run sequentially — spec compliance first, code quality second. Stage-one BLOCKED shortcuts the loop (no point quality-reviewing a diff that misses the spec). Stage routing + why-two-stages rationale → modes-detail § Mode 2.

3. do-in-steps

Plan is split into N steps; judge runs between steps. A step that fails judgment is revised before the next step starts. Used for multi-file changes where a mid-plan mistake would cascade.

4. do-in-parallel

Independent slices run concurrently. No judge per slice — judge runs once on the aggregated result. Parallelism capped by subagents.max_parallel in .agent-settings.yml.

5. do-competitively

Multiple implementers produce candidate diffs for the same slice. Judge picks the winner and rejects the losers. Expensive — use only when the solution space is genuinely broad.

6. judge-with-debate

Two judges each produce a verdict; a meta-judge reconciles disagreements. Used for high-stakes changes (security, data migration, public API) where a single judge is too easy to fool.

Mode 6 = go/no-go (strict-er verdict wins); for defect-FINDING coverage (the union of what diverse models catch) use Mode 9.

7. do-in-worktrees

Cross-wing or cross-skill chain executed across isolated git worktrees — each handoff runs in its own worktree so one step's workspace state never leaks into the next. Use for a multi-step cross-wing chain (≥2 senior skills, each ≥30 min); not for fast iteration under 30 min (overhead dominates). Full handoff shape, example chain, competitive per-candidate isolation, and the no-auto-merge Hard Floor → subagent-modes-detail § Mode 7.

8. do-with-live-app-judge (gated — UI-heavy tasks)

Implementer ships the change AND starts the dev server; the judge drives the RUNNING app (Playwright / browser) against a written rubric, never reading the diff. Use for UI-heavy change where "looks right in the diff" ≠ "works in the app"; not for backend/logic (a diff judge is cheaper). Experimental until verdict_changed_outcome telemetry proves it. Rubric, adoption gate, and the async-verifier future candidate → subagent-modes-detail § Mode 8.

9. adversarial-verification-council (gated — opt-in, advisory)

A panel of N (default 2) distinct-model skeptics red-teams a real, already-verified change through the judge-* lenses — each prompted to break it. Returns reconcile deterministically (_lib/adversarial_reconcile.ts) into one findings-by-severity envelope with provenance + cross-model confidence (schemas/adversarial-findings.json). Unlike Mode 6 it emits a findings-union, not a go/no-go verdict. Advisory only — never auto-gates (Hard Floor). Default-off (subagents.adversarial_council); opt-in high-risk changes only; registered claim + high-risk tier need cross-vendor skeptics. Invariants, skeptic prompt, reconciliation, prove-or-drop gate → subagent-modes-detail § Mode 9

Disposition (2026-07-28, honest null). The adversarial-council finding- coverage benchmark resolved as a published null (see docs/benchmark.md) — this mode is NOT sold as a defect-detection capability. It stays default-off bound to that null; scheduled for removal at the next major unless external evidence (a consumer-filed case where the panel surfaced a real defect the single verifier missed) appears first. Its remaining honest value is perspective diversity + decision documentation, nothing more. (ADR-122).

Status taxonomy — every subagent return uses one envelope

Every implementer or judge return must conform to schemas/subagent-status.json. Exactly four statuses — DONE · DONE_WITH_CONCERNS · NEEDS_CONTEXT · BLOCKED — no free-form alternatives; orchestrators route on status mechanically. Meaning/required-keys table, why-fixed rationale, and the NEEDS_CONTEXT-vs-BLOCKED distinction → subagent-modes-detail § Status taxonomy.

Dispatch prompts — externalized

Each mode's literal dispatch template lives under prompts/{mode}.md. The orchestrator loads the matching prompt at dispatch time and substitutes {{placeholders}}. Edits to a prompt do not bloat this skill against the 400-line sunset trigger. Eight prompt files cover modes 1–7 and 9 (the standalone judge reuses prompts/do-and-judge.md; mode 8's live-app rubric lives in subagent-modes-detail § Mode 8); each prompt cites all four taxonomy statuses — see prompts/README.md.

Procedure

1. Inspect the task shape

Before picking a mode, check:

  • Is the task single-change or multi-step?
  • Are slices truly independent, or do they share state?
  • Is solution space narrow (one right answer) or broad (trade-offs)?
  • Is risk high enough to justify debate?

Do not pick a mode until these four questions have concrete answers.

2. Resolve models

Read .agent-settings.yml:

  • subagents.implementer_model → empty = session model
  • subagents.judge_model → empty = one tier above implementer
  • subagents.max_parallel → integer, default 3

If resolution produces an unknown alias or implementer == judge in the same context, stop and report. Do not improvise.

3. Pick the mode

Run the form gate first, then match task shape to one of the nine modes. When two modes could fit, prefer the cheaper one (do-and-judge < do-and-judge-two-stage < do-in-steps < do-in-parallel < do-competitively < judge-with-debate < do-in-worktrees).

Mode 6 (do-in-worktrees) is gated by worktrees.mode from .agent-settings.yml (default: ask). Resolve before picking:

worktrees.modeMode 6
askEligible. using-git-worktrees will run the per-creation permission ask.
onEligible. Per-creation ask suppressed.
offNot eligible. Fall back to mode 3 (do-in-steps) — same step-by-step chain, in-place on the current branch. Unless the user explicitly asked this turn for a worktree chain, in which case proceed with mode 6 and acknowledge the override per using-git-worktrees § Pre-flight.

4. Dispatch

Use the matching dispatch prompt and orchestrate inline via this skill. Describe each dispatch step explicitly in chat so the user can follow it.

5. Report

Follow the output format below. Never merge a diff without reporting the judge verdict.

6. Emit telemetry

After every auto-dispatched run, write one audit-log-v1 line (input_kind: "orchestration") via the orchestration_record recorder — never hand-author the JSON. Line shape, field semantics, recorder invocation, and token_delta sourcing priority → orchestration-telemetry § Emit procedure. Skip emit when subagents.enabled: false or spawn_count == 0 (in-session run).

Gotcha

  • Identical model both sides — same blind spots. The Iron Law blocks this before dispatch.
  • Judge drifts off-task — judge reviews the diff, not the task description. Always attach the diff to the judge prompt.
  • Infinite revision loop — hard ceiling of two revisions in do-and-judge; then hand back to the user.
  • do-in-parallel on overlapping slices — race conditions, conflicting diffs. Verify independence before splitting.
  • Cost surprise on do-competitively — N implementers + 1 judge = N+1 subagent calls for one slice. Confirm budget before dispatch.

Output format

  1. Mode chosen — one of the nine, with the one-line reason
  2. Model pairing — implementer model / judge model (resolved)
  3. Verdict — applied / revised / handed back
  4. Evidence — diff summary, test output, or judge transcript
  5. Next step — what the user does now (review PR, pick winner, etc.)

Do NOT

  • NEVER run implementer and judge on the same model and same context
  • NEVER exceed the two-revision ceiling in do-and-judge without user consent
  • NEVER run do-in-parallel on slices that touch shared files
  • NEVER apply a diff that the judge rejected without explicit user override
  • NEVER silently resolve an unknown model alias to a fallback

Handover

TaskSkill / command
Configuration referencesubagent-configuration
Do-and-judge loopInline — see prompts/do-and-judge.md
Stepwise plan with judge gatesInline — see prompts/do-in-steps.md
Standalone judge on an existing diffInline — see judge prompt in prompts/do-and-judge.md
External / networked second opinionai-council
Cross-model review WITH repo access/team (collaborative; subagents are in-session same-weights)
Verifying completenessverify-before-complete
What a subagent owns vs never ownssubagent-boundary