
bmad-loop-sweep
Triage the deferred-work ledger for the bmad-loop orchestrator: verify every selected open entry against the actual codebase and return a machine-readable partition (bundles, already-resolved, blocked, skip, human decisions). Also migrates legacy pre-DW-format ledgers when invoked with --migrate. Automation-only — invoked by bmad-loop sweep runs, not by humans.
- Installs
- 90
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/bmad-code-org/bmad-loop --skill bmad-loop-sweep- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads bmad-loop-sweep automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Deferred-Work Sweep Triage
Goal: Classify every selected open entry in {implementation_artifacts}/deferred-work.md
into a machine-readable triage plan the orchestrator can validate and execute.
This workflow is read-only and automation-native: it runs only inside a
bmad-loop sweep session. You never edit the ledger, never edit code, never
ask questions. Your sole output is the result file. (The one exception is
migration mode, which edits exactly one file — the ledger.)
On Activation
Step 0: Automation Check & Mode Dispatch
Run: echo "${BMAD_LOOP_MODE:-}"
If the output is not 1, state that this skill only runs inside a bmad-loop
sweep and end your turn. Otherwise read ./automation-mode.md fully — its
rules and result schema govern this entire run.
If the invocation carries --migrate <manifest-path>, this is a migration
session, not triage: read ./migration-mode.md and follow it instead of
Steps 1–4 below.
Step 1: Locate the ledger
Run: echo "${BMAD_LOOP_LEDGER:-}"
The printed path is the ledger — the orchestrator resolved it from the project's
BMAD config (on v6 {implementation_artifacts}, on v7 the active initiative
folder), so read that file and never re-derive it; its directory is
{implementation_artifacts}. Read the ledger in full. Open entries are
### DW-<n>: blocks whose status: line is open. If the output is empty, or
the ledger is missing or unreadable, escalate CRITICAL
(type: missing-ledger) per automation-mode.md and end your turn.
An entry carrying an archived: line keeps only a stub here — its full body
lives in the sibling deferred-work-archive.md, keyed by the same DW- id; read
it there before classifying that entry. An archived-body: line says the same
of an entry that was archived and later reopened: it is live work again, but the
body it carried before that close is still in the archive file, in the block
stamped with the date the line carries.
If the invocation carries --only DW-1,DW-2,..., those ids are the complete
triage universe for this session. Read the full ledger, but verify and partition
exactly those named open entries; do not add other raw-open entries to
open_ids or any result category. The orchestrator has already applied the
operator's named-subset or severity-floor selector and validates your result
against this exact scope.
If the invocation carries --feedback <path>, read that file FIRST — it lists
the deterministic validation errors your previous attempt's result.json failed
on. Fix exactly those defects in this attempt's output.
Step 2: Verify every selected entry against the code
Ledger statuses are known-unreliable: entries are often resolved by later work but never marked done. For EACH entry in the triage universe:
- Read its
location:(file/component) in the current tree. - Check whether the described issue still exists — read the code, grep for
the symptom, check
git logfor commits that touched the area since the entry'sorigin:date. - Record concrete evidence either way. "Probably fixed" is not evidence; a file:line or commit hash is.
Use sub-agents for parallel verification when available; never ask permission.
Step 3: Partition
Classify each entry in the triage universe into exactly ONE category:
- already_resolved — the issue no longer exists in the code. Requires
concrete
evidence(file:line that now handles it, or the commit that fixed it). The orchestrator closes the ledger entry deterministically. - bundles — buildable now: every file the fix needs already exists and no
future story has to land first. Group entries that share a touchpoint (same
file, same subsystem, same validator pattern) into cohesive single-goal
bundles sized for one dev session; an entry that stands alone is a
one-entry bundle.
namematches^[a-z0-9][a-z0-9-]{1,39}\Z(kebab-case, at most 40 characters; e.g.unicode-string-hardening), andintentis 2–6 sentences describing the one cohesive goal. - blocked — the fix is only meaningful (or meaningfully easier) after a named future story/epic lands. Name the blocker verbatim.
- skip — superseded, moot, or tied to a scenario the project explicitly excludes. Give the reason.
- decisions — a human must choose. ALWAYS a decision, never a bundle:
renegotiating anything inside a spec's
<frozen-after-approval>block, reversing a deliberate human-approved scope decision, API-shape changes that ripple to unbuilt consumers, and entries deferred with reason "auto-mode: needs human decision". Each decision gets 2–4 concrete options (each with aneffect:build+ an implementation intent,close+ optional resolution, orkeep-open) and yourrecommendation. The only exception: a frozen-block renegotiation that is clearly net-positive, non-destructive, and behavior-tightening may be bundled — when in doubt, make it a decision.
Every entry in the triage universe appears in exactly one category. The orchestrator validates this deterministically; a missed or double-counted entry fails the whole result and burns a retry.
For a bundle whose intended deliverables are confined to ignored content in the
configured implementation_artifacts directory strictly inside the code repository,
describe those deliverables and their location in the existing intent field.
Do not add a triage receipt field or assert a receipt on the executing session's
behalf. That session may write Artifact only: true on its own line beside
Status:, with true on the same line as the label and no trailing explanation,
in its own last genuine ## Auto Run Result only when its actual deliverables
qualify, never based on old artifacts alone. The marker must be authored in the
current session, outside fenced blocks and without an orchestrator repair note; frontmatter does
not assert it, and the value must be the strict boolean true. The ordinary
proof-of-work probe must first positively find no changes, and the receipt gate
requires a positive ignored-file listing scoped to that directory. All other
verification and ledger-close checks still apply. In an isolated worktree, successful
integration publishes the accepted ignored bundle spec before teardown. Additional
ignored regular files must be named in the accepted spec's artifact_deliverables
frontmatter list, using exact paths relative to implementation_artifacts. Describe
these intended outputs in the bundle's intent so the executing session can declare
them. Directories, globs, absolute paths, traversal, symlinks, and the orchestrator-owned
ledger and sprint board are forbidden; undeclared files are not copied. Publication
checks destination baselines captured before execution. Conflicting main-checkout
changes pause publication and retain source artifacts for recovery. The receipt
alone does not publish files.
Step 4: Write the result and end your turn
Write the result.json per ./automation-mode.md and state in one line how
many entries went to each category. End your turn. Do not edit any file other
than the result file.
FAQ
What does the bmad-loop-sweep skill do?
Triage the deferred-work ledger for the bmad-loop orchestrator: verify every selected open entry against the actual codebase and return a machine-readable partition (bundles, already-resolved, blocked, skip, human decisions). Also migrates legacy pre-DW-format ledgers when invoked with --migrate. Automation-only — invoked by bmad-loop sweep runs, not by humans.
How do I install bmad-loop-sweep?
Run npx skills add https://github.com/bmad-code-org/bmad-loop --skill bmad-loop-sweep in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bmad-loop-sweep/ (personal) or .claude/skills/bmad-loop-sweep/ (project).
Which AI agents can use bmad-loop-sweep?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is bmad-loop-sweep safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains bmad-loop-sweep?
It is published by bmad-code-org in bmad-code-org/bmad-loop. It has 90 recorded installs.
More from bmad-code-org/bmad-loop
bmad-loop-resolve
bmad-code-org/bmad-loop
Interactive escalation-resolution workflow for the bmad-loop orchestrator. A bmad-loop run paused on a CRITICAL escalation (a contradiction or gap a dev/review session could not safely resolve alone); you and the human disambiguate the frozen spec so the story can be re-driven. Invoked as /bmad-loop-resolve . Unlike the automated dev/review sessions this session is interactive — a human is present and you SHOULD ask.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.