Loop 001
The overnight docs sweep
A scheduled AI coding-agent workflow for comparing documentation with the current codebase, fixing drift, and opening a reviewable pull request.
Ready-to-use prompt
Copy the loop
Each night, review the codebase in full and make sure all documentation reflects the latest changes from the previous day. Update the documentation as needed, then open a pull request with those changes.
Verify / stop
Documentation matches the current implementation.
Finish with a reviewable pull request.
Context and guidance When to use it, steps, safety notes, and related loops
Use this when
Use this after active development days when implementation changes can leave READMEs, setup guides, API references, examples, or runbooks behind.
How to run it
- Review implementation changes since the last documentation pass.
- Compare the repository's documentation with the code, configuration, commands, and behavior that now ship.
- Update only stale material, then verify commands, links, and examples against the current repository.
- Run the relevant checks and open a pull request that explains the documentation drift and the fixes.
Why it works
The loop ties documentation to the implementation instead of relying on memory. Requiring a pull request creates a visible diff, a review point, and a durable record of what changed.
Implementation note
Keep the scope tied to real implementation changes. Do not rewrite accurate documentation just to create activity.