Skip to content

Patterns

Pattern: docs-sweep

Documentation drifts the instant code moves on without it — a renamed function, a dropped flag, a default nobody updated in the README. This kit…

Documentation drifts the instant code moves on without it — a renamed function, a dropped flag, a default nobody updated in the README. This kit compares the codebase against its own docs daily (or right after a push touching source), and drafts what changed and where the docs are now wrong. The original design behind it opens a pull request outright; this library makes every kit earn that step instead of starting there.

Quick facts

FieldValue
CategoryE · Documentation
Heartbeatschedule/event (push)
Cadence1d
LevelL1 (report-only)
CostMedium
GroupB — Forward Future Loop Library

The six parts

PartThis kit
Heartbeatschedule/event (push) — daily, or triggered by a push to main touching source paths
Bodyreads the codebase and its docs; writes only docs-drift-report.md, its own state file, and the run log
Spinedocs-sweep-state.md — the last-swept commit
Stopping conditionper-beat: every doc page touching changed code since the last mark has a report entry — drift confirmed or cleared
Checkerloop-verifier (read-only) — confirms each flagged drift by diffing the doc's claim against the actual code, not a stale-looking phrase alone
Human gateyou read the report and update the docs (or apply the drafted fix) yourself; nothing is opened or committed until you do

The three valid stops

  • Success — each beat: every doc page touching changed code has a report entry, and the last-swept mark is updated.
  • Limit — 10 runs/day or 200k tokens/day.
  • No progress — 3 consecutive beats with nothing newly stale → log and stop.

Source: Loop #1, "The docs sweep," from Forward Future's Loop Library, original prompt by Matthew Berman. Adapted here to L1 report-only (this library's rule for every kit's first run), with a heartbeat, spine, checker, and limits added — the source specified none. Full attribution: resources/sources.md.