keeping-docs-fresh
Skill3 starsChanged 7 months agoMITView on GitHub
Use when changing a public API surface — renamed export, changed signature/return type, new or removed flag/route/env var, schema migration, deprecation — before committing, so README, docs/, CHANGELOG, and inline references stay coherent with the code
- Reads credentials
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cleaning-existing-codebaseSkill
- gating-commitsSkill
- keeping-files-smallSkill
- orienting-to-repoSkill
- testing-new-codeSkill
- using-repo-hygieneSkill
- writing-commit-messagesSkill
- writing-docstringsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Run BEFORE committing. One ripgrep catches most references:
- Very specific: line 44
If the scan returns zero hits, say so explicitly ("No doc references to <old> found, safe to commit") rather than skipping the step …
- Very specific: line 69
Update each: rewrite README example to await fetchUser("abc"), update docs/api.md to the new name and async, fix the comment in migrate.ts, …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Keeping Docs Fresh
Overview
Any change to the public API surface should propagate to the docs that describe it — in the same commit. Otherwise the README quietly starts lying to readers. The honest baseline from agents is "ship it = commit whatever's staged," which silently leaves stale docs in the repo.
Core principle: Code change without doc change = doc lies. Scan before you commit.
What Counts as a Public API Change
Trigger this skill when any of these happen:
- Renamed an exported function, class, type, or constant
- Changed the signature, return type, or behavior contract of an exported item
- Added or removed a CLI flag, env var, or config key
- Added or removed an HTTP route, GraphQL field, or RPC method
- Changed a database schema (added/removed/renamed column)
- Marked a public symbol deprecated or removed it
- Changed default behavior in a way users would notice
NOT triggered by: Internal refactor with no exported surface change, comment tweaks, formatting, test-only changes.
The Scan
Run BEFORE committing. One ripgrep catches most references:
# Old symbol name across docs + non-source files
rg -n 'getUserById' README.md docs/ CHANGELOG.md 2>/dev/null
# Broader sweep including inline comments in code
rg -n 'getUserById' .For each hit, decide:
- Update — the doc should reflect the new name / signature / behavior
- Remove — the doc described a thing that no longer exists
- Keep — historical context (release notes, ADRs); leave alone
If the scan returns zero hits, say so explicitly ("No doc references to <old> found, safe to commit") rather than skipping the step silently.
What to Update
| File | When |
README.md | Usage examples or feature list mention the change |
docs/**/*.md | Always scan; update matching references |
CHANGELOG.md (if present) | Add an entry; mark breaking changes as such |
openapi.yaml / GraphQL schema | HTTP / GraphQL surface changed |
--help text / man pages | CLI flags changed |
.env.example | Env vars added or removed |
Inline // or # comments | Comments name the old symbol |
Quick Example
You renamed getUserById(id: string): User to fetchUser(id: string): Promise<User>.
$ rg -n 'getUserById' .
README.md:42: `getUserById("abc")` example
docs/api.md:18: function reference
src/legacy/migrate.ts:99: commentUpdate each: rewrite README example to await fetchUser("abc"), update docs/api.md to the new name and async, fix the comment in migrate.ts, add a CHANGELOG entry like BREAKING: Renamed getUserById → fetchUser; now returns Promise<User>. Then commit all of it together.
Common Mistakes
| Mistake | Fix |
| "Ship it" → commit immediately | Scan first. Doc updates ride in the same commit. |
Updating README only, missing docs/ | Use rg from repo root, not selective reads |
| Forgetting CHANGELOG when one exists | Every public-surface change deserves an entry |
| Soft-pedaling a breaking change | If it breaks callers, mark it BREAKING |
| "I'll update docs later" | Later = never. Same commit. |
| Spotting a stale reference and thinking "out of scope" | If it's stale because of YOUR change, it's in scope |
Red Flags — STOP
- About to commit a renamed export without running the scan
- "The user said ship it" — ship still means doc-coherent ship
- "It's just a typo" — not a typo if the function's contract changed
- "I'll update docs later" — almost always becomes never
- Saw a stale reference in
docs/and rationalized it as out of scope
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

