/amphion:resume-interrupted-phasefrom amphion
Recovery runbook for orchestration interruptions in phase or spec-driven implementation. Use when a delegated implementation sub-agent returned no usable report — an API error string, an empty or truncated result, or a generic "completed" with no commits/PR/test results — or when picking up multi-commit phase work cold after a crash, context compaction, user interruption, or machine restart. Reconstructs progress and per-sub-phase validation status from git history plus the in-repo progress ledger (never the agent's memory), re-validates the frontier, and resumes from the first unverified sub-phase. Not for normal phase work where the implementer returned a clean structured report (that is the orchestrator's ordinary validate step); not for in-implementer judgment calls (that is flag-or-fix).
Ships in amphion. 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.
Read when SKILL.md points to them.
A delegated implementation sub-agent died, or you are picking up multi-commit phase work cold. The work is partially done and the agent's account of it is gone or untrustworthy. This skill walks the recovery rather than letting you guess or restart from zero.
Doctrine, in one line: git history plus the in-repo progress ledger are the source of truth — never the dead agent's summary. Reconstruct, re-validate, resume.
A missing or non-contract report is itself the signal. What was actually lost is not the code (git has it) but the validation status, which must be re-established, never assumed.
Supporting files in this skill directory:
runbook.md — the precise mechanical procedure (commands, truth tables, decision
trees). The steps below summarize it; follow it for the detail.report-contract.md — what every implementer must return, and how you
decide a return is a crash.resume-brief-template.md — the verbatim block to prepend to any
relaunched implementer so it is idempotent.Config (.claude/amphion.config.json): ledger.path is the progress ledger (default
docs/PHASE-PROGRESS.md); gates.build / gates.test are the commands to re-run; and
gates.mandatedChecks[] is the list of project-specific checks — each with a name, a command,
and the expected evidence — that a crash silently eats. If there is no config, derive the gate
commands from the plan or the repo's build files and say which you used.
| Return looks like | Verdict | Action |
|---|---|---|
Contract-shaped REPORT block (report-contract.md) with real SHAs | Not a crash | Hand to the orchestrator's normal validate step. Stop — this skill does not apply. |
API error string (API Error: 500 …, timeout, transport) | Crash | Continue. |
| Empty / truncated / cut mid-output | Crash | Continue. |
"Completed" / a summary with no REPORT block, no SHAs | Suspected crash | Continue — never mark done on an unverifiable summary. |
| Clean report, but you are cold (new session / post-compaction) | Resume | Continue (skip the crash framing; re-anchor on durable state). |
Capture the raw return verbatim — its failure class is needed for the retry decision in Step 5 and for the friction log.
Run the forensics block in runbook.md Step 2 (git fetch, status -sb,
log --oneline <base>..HEAD, diff --stat, stash list). Read the ledger at ledger.path.
Cross-check it against git log — if the ledger is absent or stale (the classic failure), rebuild
the picture from git log plus reading the diffs directly. Git is the authority; the ledger is
the convenience.
Classify every sub-phase into exactly one bucket: validated (trust, don't touch) / committed-unvalidated (code exists, quality unknown) / uncommitted WIP (inspect and decide) / not started (the resume target). The boundary between validated and everything after is the frontier.
Validation that died with the agent does not exist. Re-establish it (runbook.md Step 4): run
gates.build / gates.test on the last committed sub-phase; re-run every check in
gates.mandatedChecks[] that applies to the committed range; record the real results in the
ledger now (repay the checkpoint debt). Inspect any wip(…) commit, stash, or untracked WIP and
deliberately keep or reset it, noting the decision.
If a committed sub-phase fails re-validation, the frontier moves back to before it — fix forward or revert deliberately. Never build on an unverified-red base.
resume-brief-template.md plus the report contract.Right after a crash, prefer orchestrator-direct for one chunk to re-establish a clean checkpoint,
then delegate subsequent chunks. Resume from the first not-started (or reset-to-clean) sub-phase.
Going forward, enforce the checkpoint discipline (runbook.md Steps 5–6): per-sub-phase commit;
ledger in-progress + commit before, done + verification + commit after; a wip(…) checkpoint
before any long operation; and re-chunk so that no delegated run is a long unhedged bet.
If the failure was transient (500 / timeout / transport) and the chunk is
ledger-idempotent, the orchestrator MAY auto-relaunch that one chunk once, with the resume
brief, after a short backoff. Exactly one auto-retry. A second failure, or any non-transient
failure, means stop and surface a state summary to the user — see
flag-or-fix for the escalation framing.
Then, if the project keeps a friction log, invoke log-friction (Amphion's skill, where it is installed) with
the failure class (verbatim error), the signal lost and how it was re-established, the recovery
cost (mode, retries, wall-time, whether the user had to intervene), and a tuning hint (chunk too
big? run too long? wrong model?). Every recovery is friction by definition, and the accumulated
dataset is what tunes chunk size and delegation policy. If no frictionLog sink is configured,
put the same summary in the PR description instead — don't drop it.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kumouri/mesmer-grimoire --plugin amphion6 skills in this plugin
/flag-or-fixDecision framework for in-flight situations not covered by the project's standard playbook. Use when working through a phase or spec-driven implementation and you encounter something the briefing, spec, or CLAUDE.md doesn't directly address — a missing file, a layout that won't accommodate the spec's copy, an out-of-scope issue, a voice or naming judgment call, or unexpected breakage. Walks through fix-now / fix-and-flag / defer / stop./initialize-ciSet up GitHub Actions CI for a repository that has none. This skill should be used when the user asks to "set up CI", "add CI", "initialize CI", "configure CI", "add a GitHub Actions workflow", "add a CI pipeline", "set up continuous integration", "create a build/test workflow", "add .github/workflows", "this repo has no CI", "this repo needs CI", "there's no CI yet", or "wire up automated tests on push"; and proactively when working in or right after running /init on a git repository whose remote is (or is intended to be) on GitHub and which has no .github/workflows directory. Detects the project type (Java/Spring Boot+Gradle, TypeScript/Vite+React, C#/.NET, Lua, Node, Python, or generic), generates a CI workflow adapted to the repo's real build/test/lint commands, language version, and package manager, flags monorepos, never clobbers existing workflows, and verifies the workflow before finishing. Detects the repo's branch model and emits Git Flow trigger shapes (develop + main) where applicable.