name: bmad-loop-resolve
A bmad-loop run drove a story through dev → review, a session raised a
CRITICAL escalation (work could not proceed safely — usually a contradiction
or an unanswered question in the frozen spec), and the orchestrator paused the
whole run for a human. The session that escalated is gone; you are a fresh
interactive session whose job is to resolve the ambiguity with the human and
update the frozen spec, so the orchestrator can re-arm the story and re-drive
it against a corrected spec.
This is interactive: a human IS present. Ask questions, present options,
recommend — but the human makes the call. ($BMAD_LOOP_MODE is intentionally
unset for this session; the never-ask automation rules do NOT apply.)
These environment variables are set:
$BMAD_LOOP_RUN_DIR — the paused run's directory.$BMAD_LOOP_STORY_KEY — the escalated story key (also your invocation argument).$BMAD_LOOP_RESOLVE_CONTEXT — path to a context.json written for you.Read $BMAD_LOOP_RESOLVE_CONTEXT FIRST. Its schema:
{
"story_key": "6-4-cli-list-command",
"run_id": "20260613-111429-6a14",
"spec_file": "/abs/path/to/_bmad-output/implementation-artifacts/spec-<story>.md",
"baseline_commit": "<sha>",
"paused_reason": "CRITICAL escalation from review session: ...",
"escalations": [
{
"type": "<kind>",
"severity": "CRITICAL",
"detail": "<what's ambiguous/contradictory>"
}
],
"resolution_path": "/abs/path/to/<run>/resolve/<story>/resolution.json"
}
Your output marker is the file at resolution_path. Writing it is the LAST
action of a successful resolution. Schema:
{
"story_key": "<key>",
"decision": "<one or two sentences: the rule you and the human chose>",
"spec_file": "<the spec you edited>",
"spec_updated": true
}
spec_file in full —
especially its <frozen-after-approval> block (the intent the dev/review
sessions treat as authoritative). The escalation is almost always that this
block is silent on, or contradicts, a case the implementation hit.<frozen-after-approval> block and any affected acceptance criteria / test
matrix rows so a fresh dev session has exactly one correct reading. Make the
smallest change that removes the ambiguity. You MAY use the bmad-spec or
bmad-correct-course skills if a larger spec change is warranted.resolution_path (schema above), then tell
the human the resolution is recorded and they can exit this session — the
orchestrator will offer to re-arm the story and resume the run (a clean
rebuild against the corrected spec).result.json — that is a dev/review
artifact; this is not one of those sessions.sprint-status.yaml, and do NOT set the spec's status:
field — the orchestrator deterministically re-arms the spec status on resume.
Edit spec content only.If the human defers, the information needed is genuinely unavailable, or the right fix is out of scope for a spec edit (e.g. it needs a PRD/architecture change), say so plainly and do not write the resolution marker. Exiting without the marker leaves the story escalated and the run paused — the safe default. The orchestrator will not re-arm a story with no recorded resolution.