Sweeps

From Esposter/Esposter · View interactive version

Sweeps is an AI agent skill from the GitHub repository Esposter/Esposter. Apply when running, resuming, ticking, adding or retiring a repo-wide sweep or its ledger, or when deciding whether a mechanical pass needs one. Esposter's repo-wide sweeps — a settled convention carried across old code one behaviour-preserving unit at a time, its progress kept as a ledger in .agent

How to use this skill

Skill file

Sweeps

A sweep carries one already-settled convention across a tree too large to finish in one commit. It decides nothing: the convention is owned by a skill or spec, and the sweep only applies it to code that predates it, changing no behaviour.

Each sweep is a question, kept as a ledger: one row in .agents/ledgers/README.md naming its rules owner and Scope, and a file for its rules and notes. Its cells are the units of the one area list (.agents/ledgers/areas/) holding a file its scope names, so every question reads the same partition and one read of a unit serves each question holding it. An entity ledger, whose unit is not a set of files (a dependency, a skill, a spec folder), keeps rows of its own (references/ledger-files.md). Progress is the Ledger: and Reopens: trailers on the commits that swept and reopened each cell, which pnpm ai:sweep:status reads.

A ledger is named after the skill that owns its rules, where one skill does — pinia, naming, trpc, testing. A second name for the same subject makes the ledger and the skill read as two topics, and the index row is where the pairing is stated. A ledger several skills own takes the name of the question instead (schemas, styling).

Settled — do not re-propose

The find recipe — `references/find-recipes.md`

Prove the scan can fail before believing it passed — run it against a known violation; an empty result is the same shape as a clean tree. Which form a scan takes is the skill-authoring skill's rule; a script lives under scripts/src/sweeps/, runs as pnpm ai:sweep:<scan>, and a colocated test keeps "prove the scan can fail" proved. Writing one, or moving one out of a code block, is references/find-recipes.md.

One pass

Behaviour-preserving only (a unit correcting toward the reference or spec is named in its commit body), one unit per commit with a Ledger: <ledger> | <unit> trailer, a clean unit's trailer riding the next commit or a trailer-only record commit, and the checks once when the sitting goes out — the loop and every rule inside it are references/one-pass.md.

The ledger file — `references/ledger-files.md`

A ledger holds only what exists nowhere else, never explanatory prose, and is keyed by the question it asks rather than by the files it reaches. Writing, merging or retiring one, deciding whether a mechanical pass earns a file at all or whether a new convention joins an existing question, and sizing an area unit to what one pass can read, is references/ledger-files.md.

Every sweep is standing

There is no one-shot mode: a unit's trailers give it a date and the model that read it, which pnpm ai:sweep:status prints, a pass resumes from what changed since over the index row's Scope, and a row an older model read is open for a full pass (references/standing-resume.md).

A sitting reads units, not ledgers — `references/windows-and-convergence.md`

A sitting reads units, not ledgers: pnpm ai:sweep:sample prints the units to read, each with every question it is

judged for, and a unit is never left half-read. Planning a sitting, sampling a question, and why a resume that

reports nothing is the sweep converging rather than failing, is references/windows-and-convergence.md.

A sample sitting runs the steps references/windows-and-convergence.md ("Sampled clean") gives, in that order. After a sync brings other sessions' commits, the cells they touched are read as a sitting of their own, drawn by pnpm ai:sweep:sample --touched <range> and never sampled (the same section).

Draining beats scheduling

A change that edits a file inside an unswept unit sweeps that file first, in its own commit ahead of the behaviour change, and leaves the cell — (references/draining.md).

When the rule runs out — `references/rule-gaps.md`

The convention a pass carries is evidence rather than authority: a unit that will not fit it is as likely to have found a gap as to be a violation. The shapes a gap takes, and where the fix lands, are references/rule-gaps.md.

Shrinking beats re-running

A sweep shrinks by handing what is decidable to an enforcer, and the second time a pass writes the same finding it writes the enforcer instead; which part earns one is the decision tree in the oxlint skill (references/custom-js-plugins.md), and the handover is references/handing-to-an-enforcer.md.

A sample's defects are classes, never instances. Fixing what the sample read ends nothing: its defects are grouped by mechanical shape, each class takes the highest rung that catches every instance (the invariants skill's ladder: construction, lint, then a find recipe), that rung is run across the question's whole scope with every hit fixed, and the question is sampled again. The loop recurs until a sample finds no defect of a class that already holds a rung; a rung that let an instance through is moved up, and a new class starts its own pass. Quality findings are classes too: a duplicate, a near-twin helper or a slow shape is merged into one mechanism, and every copy the repository holds converges on it in the same pass, per the per-case bound in openspec/specs/architecture/write-once/design.md.

Reference pages

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.