/ev:ev-run <project-slug-or-path> [<free-form message>] [--mode=auto] [--env[=<provider>]]from ev
Thin router over a project. Loads the manifest, picks the next actionable phase (or routes a message like "address feedback on #14"), and dispatches to the appropriate loop. Does no work itself — the loops own execution and the substrate owns state. Use when the user wants to make progress on a project without picking the phase by hand.
Ships in ev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Router. Reads state via bin/loom, decides what to run next, invokes
the right loop. Owns no work of its own.
<project-slug-or-path> — resolved by loom's standard slug resolution
(full slug → date-less suffix → relative or absolute path).--env[=<provider>] — opt into running the dispatched work inside a
provisioned development environment (ADR-0010). When present, the
router provisions an environment via the configured provider before
dispatching; see § Environment provisioning. The optional
=<provider> overrides the machine-local configured provider for this
run. Absent, the run executes in the current session exactly as today
(the default; v1 does not auto-decide env-need).Invocations of /ev-loop-* and /loom-archive and /loom-plan skills
below mean Skill(skill: <name>, args: "…") — the Skill tool is how
the router dispatches. CLI invocations like bin/loom project read
mean Bash("loom project read <args>").
Tier 1 — presence. Before doing anything else, verify the
substrate CLIs are on PATH.
The marketplace dependencies cascade handles install-time + enable-
time correctness; this skill-body check catches the runtime case
where a user disabled a dep plugin mid-session.
Run:
Bash("command -v loom guild >/dev/null 2>&1 || { echo 'ev-run requires loom + guild plugins on PATH. Enable them with: claude plugin enable loom@krambuhl guild@krambuhl' >&2; exit 1; }")
If exit code is non-zero, stop and surface the message to the operator verbatim — do not dispatch to any loop.
Tier 2 — format-skew & Tier 3 — freshness. Tier 1 confirms the
binaries are present; it does not confirm the installed loom is
new enough to read this project's manifest.toml, nor that the
resolvable guild and its codegen'd agents are current with source. A
binary that predates a state-format cutover answers command -v yes
while silently failing every read — the false-green this substrate has
lived inside. The slug isn't known until § 0 parses arguments, so run
this probe as the first action after the slug resolves (before § 1
Orient's loom project read):
Bash("loom doctor <slug>")
loom doctor prints a JSON report {ok, issues: [{code, severity, detail}], ...} and exits non-zero only when the installed loom
cannot read the manifest. Read both the exit code and the issues
across the two tiers below. This is the single point in the substrate
where freshness is gated, once per dispatch; downstream loops trust
the result (see § 4 Dispatch).
Tier 2 (format-skew) — non-zero exit, or a parse error on the
output: the installed loom can't read this manifest. Surface
"installed loom cannot read this project manifest (format/version
skew) — fall back to repo-local node plugins/loom/cli/loom.ts (and
node plugins/guild/cli/guild.ts) for all loom/guild operations
this session" and switch to those repo-local entries.
Tier 3 (freshness) — exit 0 with one or more severity: "warning" entries in issues (warnings keep ok true and the exit
code 0, so they are easy to miss — do not discard stdout). Surface
each in the dispatch report's caveat line:
guild-cache-skew — the resolvable guild on PATH lags source
(missing verbs, or present-but-unqueryable). Codegen / live-spawn
may run on stale state.guild-codegen-drift — the committed agent bodies no longer match
their source fragments/cache; live-spawned agents may be stale.Each issue's detail carries the exact remediation command — relay
it verbatim. The operator decides; if they want certainty, switch
guild/loom ops to the repo-local node entries and (for a skew or
drift finding) re-sync the plugin cache and restart before
dispatching.
Tiers 2 and 3 are advisory, not blocking: a false-positive hard
stop would train operators to bypass preflight, making the gate
decorative. Scope honesty — this gate catches entry skew, the
state standing at dispatch. It does NOT catch recompile skew: a
phase that runs guild compile mid-loop changes the world after the
gate passed, so a loop with a codegen step should re-read freshness
after that step rather than trust the dispatch-time green. Once-per-
dispatch is the agreed cost/catch tradeoff, not a claim of total
coverage.
Treat the first whitespace-delimited token of $ARGUMENTS as the
project slug/path. Everything after it (if any) is the free-form
message. If $ARGUMENTS is empty, stop and ask for a slug.
Refresh git state before orientation so the autoload briefing reflects
what's actually merged on the remote — not a stale local snapshot.
This is the single point in the substrate where the working tree gets
synced; downstream loops trust the result. Branch hygiene matters here
because every substrate write the dispatched loop makes commits to the
checked-out branch (see docs/AGENT-CONVENTIONS.md § Branch hygiene
before substrate writes); the branch checks below establish which
branch that is before any dispatch.
git fetch origin — always; never modifies the working tree.main):
git pull --ff-only origin <base>. If non-fast-forward (local has
commits not on origin), stop and surface the error rather than
auto-resolving — local main with unexpected commits is suspicious.origin/<base> has new commits ahead of local <base>, note the
gap in the dispatch report so the user knows the next branch-cut
should pull first.git status --porcelain for tracked-modified files. Filter out
.claude/settings.local.json (permitted user-local carry-over).git checkout -- <files> and proceed.Untracked files (?? in git status --porcelain) are not surfaced —
they may be intentional WIP, substrate config, or scratch the user is
working with.
Refresh state via the loom CLI:
loom project read <slug> --pretty
loom events read <slug> --limit=20 --pretty
loom session list <slug> --pretty # for the last session's open_threads
Take in the manifest, recent events, and the latest session handoff. This tells you:
phases[].status)latest_checkin)loom pr discover <slug> --branch=<phase-branch>, which reports the PR number, url,
and gh merge state (OPEN / MERGED / CLOSED) plus the
checkin-marker reconciliation. No pr-* events are read; PR state
lives in gh, not the manifest.bin/loom session read <slug> --filename=<latest>)PR state is derived, not reconciled: because open/merged PR state
comes from loom pr discover (live gh state), a PR merged between
sessions needs no reconciliation event — discover reports
state: MERGED directly. The router reads that to decide the next
action (e.g. a phase-branch PR that is MERGED with all its checkins
covered means the phase can advance and the next unit's branch can cut
off a freshly pulled base). This is why the pr-opened / pr-merged
event vocabulary was retired: their reconcile-time timestamps were
fiction, and gh is the actual source of truth.
Drift detection: the remaining drift class is the manifest's phase
status disagreeing with git/gh reality (e.g. a phase marked
in-progress whose branch PR is MERGED with no successor unit
started). Surface the discrepancy as a one-line warning naming the
drift shape (manifest-says-X vs git-says-Y). The event stream plus
that warning are the substrate's trace of the drift.
If the user provided a message, parse its intent:
| Intent | Action |
|---|---|
| "address feedback on #N" | Verify #N belongs to this project. Dispatch to the loop that owns the branch, passing the redirect message. The loop's § Triage PR comments handles the rest. |
| "save session" / "wrap up" | Compose and write a session handoff per the ev-loop's § Save session recipe (bin/loom session corrections + bin/loom events read → compose Session JSON → bin/loom session write), then stop. |
| "archive" / "close out" | Verify all phases are complete (every phases[].status == "completed"). Invoke /loom-archive <slug>. |
| "skip to phase N" | Warn if dependencies aren't satisfied. Confirm with the user. If confirmed, dispatch to the loop for phase N. |
| "pause" | Stop and report. Do not dispatch. |
| ambiguous | Walk the user through a grill-me question (one at a time, recommendation first); in --mode=auto, defer to evaluator-contract-fit reading the redirect against open PRs. See § Grill-me + auto-mode below. |
With no message, pick the phase using this policy:
If any phase is in-progress, that's the next phase.
Otherwise, pick the lowest-numbered not-started phase whose
dependencies are all satisfied. Read each phase's dependencies from
loom parse-plan <slug> (plan.phasesById[<n>].dependsOn, a list of
phase-id strings) rather than parsing PLAN.md prose; a dependency is
satisfied when that phase's manifest status is completed (its PR
merged). loom parse-plan is the single source for dependencies — do
not re-derive them from the plan text.
If no phase qualifies AND there's an in-progress phase whose branch
has an OPEN PR (per loom pr discover), the run is blocked only on
that PR merging. The substrate subscribes to each PR at open
(§ Compose PR, "After open"), so the default posture here is
event-driven, not blocking — park the run and let the PR
activity wake it:
Subscribed (managed/web session — the default). Exit cleanly
with a parked handoff, e.g.: "Phase N is open as PR #X and
subscribed to PR activity; no other phase is unblocked yet.
Parking the run — a review, CI result, or the merge will re-wake
/ev-run, which re-evaluates from step 3 (on merge the phase
advances and unblocks its dependents). Re-run /ev-run manually
any time to re-check." Then stop. Do not block, do not
dispatch. This is the "open a PR, subscribe, move on" path: the
router has already moved past every phase it can act on, so
parking is moving on.
Treat the session as subscribed unless the most recent loop
return in this invocation reported PR subscription: unavailable
(set when the open ran in a local gh-only session). When that
PR-activity wake later fires, the substrate still derives live PR
state from gh via loom pr discover on the re-run — the wake
decides when to look, never what is true.
Not subscribed (local gh-only fallback). When the open
reported PR subscription: unavailable, there is no wake to wait
on, so fall back to the blocking poll: wait for the PR to reach
a terminal lifecycle state per § Wait for merge before surfacing
a blocker. The wait verb returns exitReason: 'merged' | 'closed' | 'timeout' | 'gh-failed'; route by that discriminant:
merged: re-fetch live state via loom pr discover
(observation-only — no manifest write side effect), then re-run
this step (3) from 3.1 above. The merged phase's manifest status
is completed, so dependent phases now qualify; the re-run
picks the lowest-numbered next phase and step 4 dispatches it.
No retry loop within a single /ev-run invocation past this
re-run — one re-fetch, one re-evaluation, one dispatch.
closed: PR closed without merging (operator manually
closed, force-pushed and recreated, branch deletion, etc.).
The phase's parent is NOT merged. Surface "PR #X closed
without merging — investigate (was it intentional? force-push?
branch deletion?); phase stays not-started (or in-progress,
whatever the manifest shows); resolve the closure and re-run
/ev-run." Exit cleanly — do NOT dispatch the next phase, the
substrate must not auto-dispatch against an unmerged parent.
timeout: PR still OPEN after the configured wait (default
30 minutes). Surface "still open after N minutes (gh state at
exit: <state>) — run /ev-run later." Exit cleanly. Each
timeout is a clean handoff to the operator; no automatic
re-wait within the same invocation.
gh-failed: K=3 consecutive gh failures (auth expired,
rate limit, network down). The wait verb's --quiet does NOT
silence this exit — terminal failures break silence by design.
Surface "wait failed: gh CLI not responding (last error:
<msg>); check gh auth status and re-run /ev-run." Exit
cleanly. Re-running after fixing gh starts the wait fresh.
When /ev-run is invoked under --mode=auto, the router passes
--quiet through to the wait verb so routine per-poll status is
silenced. The four exitReason branches above behave identically
in interactive and auto modes; only the routine-poll output
differs.
If no phase qualifies AND no in-progress phase has an OPEN PR (all
phases either completed or genuinely not-startable), surface the
blocker: "waiting on PR #X to merge but the wait above didn't
advance state" (shouldn't happen if § Wait for merge fires
correctly) or "all phases completed — run /loom-archive."
Determine which loop to invoke:
[config]
(worker_bindings field, e.g. {"default": "ev-loop-interactive"})./ev-loop-confidence.Invoke the loop with <slug> <phase-number> and, if a redirect message
is in play, pass it through.
Do not pass control back and forth. Once dispatched, the loop owns the session until it returns or yields. If the user wants a different loop mid-phase, they stop the current one explicitly.
One paragraph in this shape:
Dispatching <slug> → phase <N> "<phase-title>" via <loop-name>.
<Dependency-check sentence.> <Caveats or "No caveats.">
Then dispatch. Don't ask for permission unless a redirect or drift warrants it. Example dispatch:
Skill: ev-loop-confidence
args: "<slug> <phase-number> [<redirect-message>]"
The router has three classes of ambiguity that historically fell to
ad-hoc clarifying prompts. They now follow the substrate's standard
grill-me + auto-mode pattern. Per docs/AGENT-CONVENTIONS.md,
defaults are per-decision rounds = 3 and per-session
ambiguities = 3 for this surface.
The three ambiguity classes:
Ambiguous redirect (step 2). The free-form message doesn't
map cleanly to one of the documented intents. Example: the user
types "look at #14" — that's likely an "address feedback on #14"
but could also be "skip to the phase that produced #14." The
skill grill-mes: surface 2-4 interpretations via
AskUserQuestion, recommend the most likely one. In auto-mode,
evaluator-contract-fit reads the redirect text against the
project's open PRs (from the manifest's [[events]] trail) and picks the
highest-confidence match.
Manifest-vs-git drift (step 0.5 / step 1). The manifest's
phase status doesn't match git state (e.g. phase shows
in-progress but the branch is already merged). The skill
grill-mes: surface the discrepancy + 2-3 reconciliation options
(mark merged / pull and rebuild / treat as out-of-band). In
auto-mode, evaluator-contract-fit reads the drift against the
expected manifest shape (per docs/LOOM-CONVENTIONS.md § phase
lifecycle) and picks the reconciliation matching the actual git
state.
Ambiguous next-phase (step 3). Multiple not-started phases
could be picked (rare: e.g. two phases have the same dependency
set and both are unblocked). The skill grill-mes: surface the
candidates with one-line PLAN.md descriptions, recommend the
earlier-numbered one. In auto-mode, evaluator-contract-fit
reads each candidate against its PLAN.md description + the
project's last-decided direction (from the latest checkin's
notes_for_pr) and picks the most coherent next step.
Convergence: silent panel (the evaluator returns approved
with a single high-confidence resolution) OR 3 × 3 budget exhaust.
On budget exhaust: emit auto-mode-budget-exhausted with
{surface: 'ev-run', slug, decisions_completed, rounds_completed, reason}. The event's detail names which ambiguity class exhausted
and the candidate options the panel considered.
The router falls back to declining to dispatch — it surfaces the
unresolved ambiguity to the operator (or upstream caller) with a
structured error and stops. The substrate posture matches
/ev-loop-interactive's contract negotiation: ambiguity the
auto-mode panel can't resolve is too risky to dispatch through.
Event emissions (auto-mode only):
auto-mode-entered with {surface: 'ev-run', slug, decision_budget: 3, round_budget: 3}.auto-mode-converged with
{surface, slug, decisions_completed, rounds_completed}.auto-mode-budget-exhausted per above.Human-paired mode emits no auto-mode events — the AskUserQuestion
exchange is the audit trail.
--env)When --env is passed, the router provisions a development environment
for the project before § 4 Dispatch. The provider seam is the ev env
CLI (ADR-0010); the router never talks to fella/coder directly. This
is a loop-layer concept — loom owns no part of it. The provider's
mode (ADR-0011) decides what happens next: exec (shared-tree, e.g.
fella/OrbStack) routes the dispatched loop's commands into the env;
dispatch (separate-tree, e.g. a coder cloud workspace) runs the
whole phase inside the env via a Claude running there.
Run, in order, after § 0.5 Sync git state and before § 4 Dispatch:
Resolve the provider + mode. Bash("ev env which" + provider-flag) — pass --provider=<name> when the operator wrote
--env=<provider>. This prints the resolved provider, its mode,
and templates, or a structured env-* error.
On any env-* error, do NOT hard-stop. Surface the error's
detail as a one-line caveat and fall back to running in the
current session (proceed to § 4 Dispatch as if --env were
absent). A misconfigured or offline provider must never block a run
that could proceed locally — the absence of an environment when one
was requested is a surfaced warning, not a silent downgrade and not a
blocker (ADR-0010 § "Watch for").
Provision-or-reuse. Bash("ev env up <slug>"). The handle is
project-slug-keyed, so a parked run re-entering on a PR wake reuses
the same environment rather than creating a fresh one.
Gate on readiness. Bash("ev env status <slug>") before treating
the environment as usable — up exiting zero does not guarantee the
environment is ssh-able yet.
Act on mode:
exec (shared-tree). Dispatch as in § 4, but append
--env=<provider> to the loop's args:
Skill(ev-loop-*, args: "<slug> <phase> --env=<provider>"). The
loop body routes its repo commands through ev env exec <slug>
(see each loop's § Environment-aware execution). Claude reasoning +
file edits stay in this session; only shell commands run in the
env. Shared-tree requirement: this assumes the provider exposes
this checkout's working tree to the env (an OrbStack bind-mount),
so edits here are the bytes the env's commands see. Do not use
exec mode with a separate-clone provider.
dispatch (separate-tree). Do not dispatch a loop body in
this session. Hand the whole phase to a Claude running inside the
env: Bash("ev env dispatch <slug> --phase=<N>"). The dispatch
template (per the resolved provider) runs the loop on <slug>
phase <N> inside the env's own checkout — the literal automation
of "spin up the workspace, run Claude inside it." Dispatch is
headless, so ev env dispatch composes the inner invocation with
--mode=auto baked in (the seam's {run} placeholder, ADR-0011
§5) — the in-env Claude never stops to ask a clarifying question
with nobody there to answer. The in-env run does the edits,
commits, and opens the PR; this session waits for ev env dispatch
to return, then reports its outcome. No exec-routing and no
shared-tree requirement — the env owns the tree.
The env (provider's workspace/template) must provide an authed
claude + the substrate plugins + the repo (ADR-0011).
Teardown is manual in v1 — the environment persists for reuse; no router
path calls ev env down.
/loom-plan
to scaffold a new one./loom-archive and stop.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub krambuhl/agents --plugin ev4 skills in this plugin
/ev-goalAutonomous driver over a project — the "human-on-call" sibling of /ev-run (ADR-0009). Self-drives phase after phase toward a goal predicate (default: all phases merged), re-entering on PR-merge/CI wake, evaluating each phase with the guild panel substrate, and pausing to ask only when a panel can't resolve a decision. Reuses the existing ev-loop-* bodies unchanged. Use when the user wants a project (or its mechanical tail) driven to completion without picking each phase by hand./ev-loop-confidenceExecution loop for tiered-transform work. Runs a phase as a sequence of tiers, each tier processing a batch of files under a tier contract, gated by evaluator verdicts and pre-flight checks. Writes tactical retros between tiers. Dispatches to the bin/loom CLI directly; composes /guild-validate; composes no other loop. Use when a phase is a bulk transform, audit, or find-replace-style operation across many files./ev-loop-interactiveOther plugins' skills for the same job