/utils:aiwg-missionfrom utils
Launches AIWG Missions for durable, audited dynamic agent orchestration toward a completion criterion. Manages activity-log, gates, best-output, checkpoint/resume, and cost tracking across worker cycles.
Ships in utils. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are launching (or participating in) an AIWG Mission — AIWG's dynamic, durable, audited agent orchestration. A Mission decomposes a goal into worker cycles, runs them toward a measurable completion criterion, and aggregates the result, while AIWG owns the bookkeeping and gates regardless of which agent stack each worker runs on.
This is an AIWG-specific kernel capability. On Codex it surfaces as /aiwg-mission, deployed by AIWG to ~/.codex/prompts/ — it is AIWG-owned, not the plugin-provided /workflow an arbitrary Codex install may or may not have (/workflow is not a core Codex primitive — see .aiwg/research/provider-workflow-integration.md).
Required for each bounded worker brief: @$AIWG_ROOT/agentic/code/addons/aiwg-utils/templates/subagent-brief.md. Fill every required section; explain non-applicable fields and unrun checks.
Start with $AIWG_ROOT/docs/addons/aiwg-utils/choosing-orchestration.md for
example prompts, minimal declarations, recovery behavior and quoted evidence
caveats for plain loops, dependency missions, growth, typed flows and node loops.
Typed routing plus growth fails with MISSION_MODE_CONFLICT before dispatch.
For evidence-led planning, declare MissionPlan.growthPolicy with
{ "version": 1, "mode": "evaluate-then-grow", "taskCap": 20 } and explicit
dependsOn on every known task. Supply the host evaluateGrowth callback;
it evaluates completed batches and returns versioned evidence references, a reason,
and the next tasks (or an empty list to finish). Growth defaults to three rounds.
The conductor records decisions and stops with a report when a budget is exceeded.
Resume from the same seed plan and ledger; appended specs are recovered from the
ledger. Details: $AIWG_ROOT/docs/addons/aiwg-utils/mission-recovery.md.
flow.aiwg.io/v1); use aiwg discover to find a matching Flow before improvising a Mission./goal, Claude's Workflow tool) = orchestrates within one stack's process/turn. A Mission may dispatch workers to these; they do not replace the Mission conductor.Natural-language triggers:
Non-triggers (route elsewhere):
god-session / subagent-scoping).aiwg discover (e.g. flow-release, flow-deploy-to-production)./goal (Codex, Claude Code) already routes for that (#1451/#1469).address-issues skill (which may itself run as a Mission).State the completion criterion measurably (per the vague-discretion rule). "good enough" is not a criterion; "all tests pass and CI green", "score ≥ 85", "every flagged finding verified" are. If the user's goal is vague, extract a checkable criterion first.
Right-size + decompose. Assign each work unit a wrapper, role and requested tier through resolveDelegation() (src/models/delegation.ts); external work uses aiwg models resolve before launch. Exploration uses aiwg-model-explorer (efficiency/economy); verification uses aiwg-model-verifier (coding/standard). Keep specialist frontmatter requirements. Apply defaults.workerSelection strategy and ceiling, stop blocked work units, and require election: user for flagship. Record the common routing record (requested_tier, resolved_tier, resolved_model, wrapper, role, strategy, ceiling and election) per worker in the activity-log. Never inherit the session model.
Decompose. Break the goal into independently-verifiable worker cycles (subagent-scoping). Decide single-stack vs cross-stack:
stack:<name> capability via AIWG's serve executor-registry. The conductor stays AIWG-owned.Dispatch. For durable/detached/unattended Missions use AIWG's external route (aiwg mc dispatch / ralph-external) so the Mission survives the session ending. For in-session orchestration, the native primitive may drive the mechanism — but AIWG still owns everything in step 4.
Retain ownership (non-negotiable, identical across stacks). Whatever drives the worker mechanism, AIWG owns:
activity-log rule)human-authorization)Control the loss surface. For any long-running, budgeted, or eval-driven
Mission, declare observable iteration/wall-clock/token/tool/spend ceilings
before dispatch. Each retry records the hypothesis, expected failure mode,
distinguishing diagnostic, and whether the next attempt is structurally
different. If the budget or exploration quota is exhausted, stop and emit a
best-output report; do not continue by random walk. Eval/holdout Missions
expose only aggregate score/probe/status or VOID to workers, while holdout
answers and detailed lint diagnostics stay private. For durable Mission
Control dispatch, use --max-iterations, --max-total-tokens,
--max-output-tokens, --max-tool-calls, --max-total-cost,
--max-wall-clock-minutes, and --exploration-quota.
Converge + report. Run cycles until the completion criterion is met (with a max-cycles escape hatch), select the best output, and report what each worker did and the aggregated result. Apply the anti-laziness recovery protocol (PAUSE→DIAGNOSE→ADAPT→RETRY→ESCALATE) rather than abandoning on failure.
Use optional uncertaintyPolicy: stop-and-report to pause and report uncertainty;
omission or default follows conductor policy. Fill mustNotRegress with
{kind: command|path, target, expectedStatus: passed|failed|present|absent}
(command: passed/failed; path: present/absent). Set verificationOracle to
{command, expectedExitCode} checks: exact observed exit statuses decide done.
The trusted verifier records oracleResults with artifact evidence; worker
claims alone do not satisfy the oracle. Run regression checks before acceptance.
For non-trivial implementation, set designReviewRequired: true, review the
design first, then attach designReviewArtifact: {ref, digest} to the brief
before dispatch. Result assembly refuses acceptance without that reference.
For final PR review set the intent's existing verification.independentReview
to required and differentFamily to require. Supply the current PR headSha
and observed writer/reviewer lineage to assembleWorkerResult; never take them
from worker claims. Resolve reviewers with reviewOf and
requireDifferentFamily. Record each reviewRounds entry with its 1-based
round, exact headSha, reviewerObservationRef and review artifact.
A changed head needs a new review. Different CLI names do not prove diversity.
Keep findingsLedger across rounds (an empty array records a clean review):
{id, class, severity, round, status, summary, followUp?}. A means introduced or
exposed by this diff; open A blocker/major findings must be resolved. B means
pre-existing: file a follow-up and retain its reference. C means out of scope.
B/C never block acceptance. Retain finding IDs and earlier rounds in successor
records; do not delete findings to obtain a clean result. Record clean rounds
even when no findings were raised. Acceptance derives readable roundsToClean
on the verification record. Stop at the declared round/budget limit and report
remaining blockers instead of extending scope indefinitely.
Check each live worker every 15s; confirm startup within 60s. Quiet limit 90s and stall limit 300s by default (a configured 1.25 scale on those defaults gives 112.5s/375s); hard stop 1800s. Resolved values win over these defaults. Without a native monitor, poll owned run files and processes from the shell at the same cadence. Heartbeats and log bytes are not progress. Supervise by observer state: quiet (suspected) is not a stop — keep waiting while you diagnose (read the status, check owned-worktree progress); stalled opens diagnosis through the diagnostic grace period; only hung authorizes a no-progress stop, and only a worker this conductor owns — confirm it stopped, then continue within remaining attempts; preserve partial work. The launcher also stops independently of progress state on failed-to-start, the hard wall-clock deadline (HARD_DEADLINE), the step-count limit (STEP_LIMIT), and a fatal observer-record failure. Observer loss and opaque MCP coverage are unknown, never worker failure. Terminal verification still applies: read the diff and run trusted checks outside the worker sandbox before integrating.
Before worker/model/effort picks (--caller aiwg-mission:worker-pick) and before classifying a failure as environmental or real (--caller aiwg-mission:failure-triage), call aiwg decision ask ... --json and use the answer when status is answered. On fallback, decide normally — fallback never stops the run. Without Jev setup this skill runs unchanged. Never send secrets in the question or context; Jev output is advisory data, never authorization. See the decision-offload skill for the exact command shape and the full caller-tag table.
Before hand-rolling a Mission, run aiwg discover "<the goal>" — a curated Flow or skill may already exist (the skill-discovery rule). A Mission is for genuinely dynamic orchestration where no pre-established Flow fits.
.aiwg/architecture/adr-workflow-routing.md — routing + cross-stack amendment.aiwg/research/provider-workflow-integration.md — why Codex /workflow is not core (#1535)aiwg mc (mission-control) — the durable dispatch surfaceFor dependency missions, opt in with recoveryPolicy: { version: 1, attemptHistory: true, inputIdentity: true }. Retries receive bounded prior errors and verifier output through the existing worker prompt and retain the existing retry budget and health gates. Completed tasks record input identities; corrections invalidate only their descendants on resume. Keep completed siblings. See $AIWG_ROOT/docs/addons/aiwg-utils/mission-recovery.md for correction requests, stale sets and research caveats.
AIWG conductors emit content-free routing telemetry automatically. For native
workers launched by the host, follow the activity-log telemetry contract in
$AIWG_ROOT/docs/models/orchestration-worker-selection.md: record every actual
launch with aiwg activity-log telemetry --start --session <id> --worker-id <id> --orchestrator mission --requested-tier <tier|unknown> --resolved-tier <tier|unknown> --resolved-model <model|unknown>. Save the returned routing ID; update it with
measured input/output counts, UTF-8 summary bytes and --result-used true|false|unknown
when the parent consumes or discards the result. Unobserved data remains unknown.
Record actual orchestrator context samples with --orchestrator-context-tokens;
never substitute cumulative token spend or a character estimate.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jmagly/aiwg --plugin utils133 skills in this plugin
/activity-logQuery and manage the unified .aiwg/activity.log chronological record of AIWG-managed workflow operations/add-agentScaffold a new agent definition file inside an existing addon or framework/add-behaviorScaffold a new behavior definition with BEHAVIOR.md and optional scripts inside an existing addon or framework/add-commandScaffold a new command definition inside an existing addon or frameworkOther plugins' skills for the same job