readme-sync
Skill0 starsChanged 3 months agoMITView on GitHub
Anti-aging update of project onboarding docs — scan doc-vs-code drift using code as the single source of truth and fix discrepancies. Use when the user says 'is the doc outdated?', 'update the README', 'sync docs after this code change'. Don't use for writing new docs from scratch (use guide-and-manual).
7 other projects use a version of this.
Adopted by
Most recently taken up by
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- alfredang/ai4kidstheir own version, first seen Nov 2, 2026
- tygwan/cc-initializer-windowstheir own version, first seen Oct 20, 2026
- shipshitgames/skillstheir own version, first seen Jun 3, 2026
- yu-iskw/coding-agent-skillstheir own version, first seen Mar 28, 2026
- yu-iskw/github-project-skillstheir own version, first seen Mar 23, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- yu-iskw/github-project-skills★ 10same name
- chrysogonus/power-agents★ 4same name
- shipshitgames/skills★ 2same name
- alfredang/ai4kids★ 1same name
- yu-iskw/coding-agent-skills★ 1same name
- tygwan/cc-initializer★ 0same name
- tygwan/cc-initializer-windows★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skill-recapSkill
- comm-link-debuggingSkill
- deep-comparison-analysisSkill
- industry-practice-surveySkill
- tech-selection-convergenceSkill
- dev-recap-docsSkill
- guide-and-manualSkill
- change-recapSkill
- code-reviewSkill
- error-handlingSkill
- legacy-code-dispositionSkill
- phase-trackingSkill
- repo-hygieneSkill
- workspace-consistencySkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
After completing a feature, a refactor, or a bug fix and archiving it (code moved.
- Distinctive: line 19
After replacing a Stub with a real implementation
- Distinctive: line 20
After a refactor that renamed packages, moved files, or changed signatures
- Distinctive: line 22
When the user says things like "update the docs" / "is the doc out of date?" / "sync docs after this code change"
- Very specific: line 37
Diagrams must render: After any change to a Mermaid / PlantUML / graphviz diagram, verify the syntax pairing (@startuml/@enduml, complete …
- Distinctive: line 61
If the user does not specify, default to a full scan but let them narrow it.
- Distinctive: line 67
Do not skip this stage and jump straight into editing.
- Distinctive: line 109
If a doc has no drift at all, mark it explicitly as "✅ no staleness" rather than padding the list.
- Distinctive: line 122
Diagram: if a Mermaid / PlantUML diagram's content is stale (e.g., nodes added/removed in a class diagram, steps changed in a sequence …
- Very specific: line 135
Use Edit / Write to commit the user-approved plan to disk.
- Very specific: line 142
Scope audit: run git diff <docs-path> on the actually changed lines and confirm nothing outside the approved plan slipped in.
- Distinctive: line 144
If a self-check surfaces an issue, fix it before continuing.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Purpose
Project onboarding docs (typically an intro series under docs/, a main README.md index, or a wiki) lose all value once they drift from the code. The sole responsibility of this skill is to eliminate staleness — not to rewrite, not to polish wording, not to add new content.
The governing principle is that code is the single source of truth. Any description in the docs that disagrees with the code is a bug, and the fix is to correct the doc rather than bend it toward the old description.
When to use
- After completing a feature, a refactor, or a bug fix and archiving it (code moved; docs may be stale)
- After replacing a Stub with a real implementation
- After a refactor that renamed packages, moved files, or changed signatures
- During a periodic health check (e.g., monthly)
- When the user says things like "update the docs" / "is the doc out of date?" / "sync docs after this code change"
When NOT to use
- Writing new docs from scratch — use
guide-and-manualinstead - Reviewing the quality of code changes themselves — use
code-review - Distilling freshly completed work into knowledge — use
change-recap(this skill does not produce new knowledge; it only removes staleness) - Fixing bugs — use
error-handling(but after the fix changes the code, call this skill to sync the docs)
Non-negotiable constraints
- Treat code as the source of truth. Every decision to change or keep a passage must be based on code actually read in this session. Do not reach conclusions from memory or from the old doc — memory and stale text are exactly what produced the drift in the first place.
- Make minimal changes. Fix only what is outdated or wrong; leave already-correct content untouched. Do not take the opportunity to rewrite, "incidentally optimize" wording, or restructure. Passages that are correct but averagely written stay as-is — opportunistic rewrites are how scope creeps in.
- Get user confirmation at every stage. The three gates — drift list, update plan, and write-to-disk — each require explicit user agreement before proceeding. Writing silently breaks trust and makes the user unable to catch scope creep.
- Preserve user-added content. Manual notes, examples, and gotchas that a human added to the docs should be kept unless the user explicitly asks to remove them.
- Diagrams must render. After any change to a Mermaid / PlantUML / graphviz diagram, verify the syntax pairing (
@startuml/@enduml, complete mermaid code fence, etc.). A broken diagram is worse than a stale paragraph because it actively fails to render. - Match the doc's existing quality bar (applies only to newly added content; do not use this as a pretext to rewrite existing content). Follow the language, target audience, and level of detail the doc already uses.
Doc inventory (what gets maintained)
This skill does not assume a fixed directory layout. The very first step in Stage 0 is to confirm with the user: which docs are being maintained this run?
Common layouts (any combination is valid):
- Per-chapter files under
docs/(e.g.,01-overview.md/02-architecture.md/ ...) - A single
README.mdplus sub-files underdocs/ - A
wiki/directory CONTRIBUTING.md+docs/getting-started.md
Process
Stage 0: Confirm the maintenance scope
Confirm with the user:
- Targets: Which docs are scanned this run? (list of paths)
- Granularity:
- Full scan: compare each doc against the code one-by-one (the default for first runs or after long gaps)
- Targeted update: the user narrows the scope (e.g., "only the routing part", "only the auth flow", "I just changed module X")
If the user does not specify, default to a full scan but let them narrow it.
Stage 1: Drift scan (code ↔ docs) ★ core
Do not skip this stage and jump straight into editing. The reasoning is straightforward: drift cannot be fixed without first knowing exactly where the code currently stands, and any edit made before that knowledge is in hand is just a guess.
1.1 Establish the current state of the code (use tools, not memory)
Sample the code along the following dimensions and record the actual values (adapt the concrete commands to the language/framework):
| Check item | How to check (generic) | What drift to look for | |||
| Directory structure | Glob "**/*.<ext>" (using the main language's extension) compared against the doc's directory tree | Added / removed / moved files or packages | |||
| Build config | Read package.json / pyproject.toml / Cargo.toml / go.mod / build.gradle* / pom.xml, etc. | Versions, dependencies, build params | |||
| Entry points | Read the main entry file (main / index / app / Application class, etc.) | Startup flow, init order | |||
| Routing / command dispatch | Read the route table / command registration / handler registration | Route branch additions/removals, params, redirect logic | |||
| Per-module class/function inventory | Read each module's core files one by one | Class / interface / function signatures / fields / constants / enum values | |||
| State machines / type branches | Read sealed classes / union types / enums plus transition logic | Branch additions/removals, transition conditions | |||
| Stub / TODO status | `Grep "TODO | Stub | placeholder | FIXME"` + read the corresponding impl | Whether placeholders have been implemented (the single most common drift source) |
| Tests | Glob files under the test directory | Test additions/removals, coverage | |||
| Progress / roadmap | Read the project's progress-tracking file (CLAUDE.md / ROADMAP.md / TODO.md / issue tracker, etc., if present) | Status changes |
Efficient approach: for the "read every file" pass, dispatch
Agent(Explore)in parallel split by module — it is both faster and more complete. However, the conclusions must be re-verified line-by-line back in the main thread, because an Explore summary can silently drop nuance.
1.2 Compare each doc against the code and produce the drift list
For each doc, check its factual claims against the current code one by one. Focus on these high-frequency drift zones:
| Drift type | Typical symptoms | How to verify |
| Structure drift | The doc's directory tree / class diagram contains files that no longer exist in the code, or the code has new files the doc does not mention | Directory tree vs Glob results |
| Signature drift | Function / method signatures, fields, or constant values in the doc do not match the code | Read the code and compare field-by-field |
| State-machine drift | Enum / sealed-class / union branches were added or removed; transition conditions changed | Read the type definition + transition logic |
| Stub got implemented | Doc marks something as TODO / placeholder / Stub, but the code now has a real implementation (the most dangerous case — it actively misleads newcomers) | grep + read the impl body |
| Flow drift | The call order or participants in a sequence diagram do not match the code | Re-walk the flow by following the code |
| Config drift | Version numbers / dependencies / build params / permissions / env vars changed | Read the build config files |
| Progress drift | The roadmap / progress-tracking doc disagrees with the actual state | Read the progress file + archive directory |
1.3 Output the drift list (wait for user confirmation)
Output the table below and wait for the user to check off each item. The user may: fix all / fix some / skip / add items.
| # | Doc | Location (section / line) | Doc currently says | Code actually says | Drift type | Suggested action |
- "Suggested action" should be brief — "fix / add / remove node X from diagram / add section Y" — without spelling out the concrete wording (that is Stage 2's job).
- If a doc has no drift at all, mark it explicitly as "✅ no staleness" rather than padding the list.
Submit the list and wait for the user to confirm which items to fix.
Stage 2: Propose the concrete update plan
For each confirmed drift item, give a file-and-section-precise old→new:
- Fix: paste the doc's original sentence (old) → the corrected sentence (new), and state why, citing
file:linefrom the code. - Add: state which doc and after which section to insert, and provide a draft of the new paragraph / table / diagram.
- Delete: state which paragraph or diagram to remove, and why leaving it in would mislead.
- Diagram: if a Mermaid / PlantUML diagram's content is stale (e.g., nodes added/removed in a class diagram, steps changed in a sequence diagram), provide a full rewrite of the block.
Principle re-check (self-audit again to prevent scope creep):
- Does every change map directly to a Stage-1 drift item? Drop any change that does not.
- Did you touch a passage that is "correct but averagely worded"? If so, revert it.
- Does any newly added content meet the "quality bar" (matching the doc's existing language, audience, and level of detail)?
Submit the plan and wait for the user to confirm it (item-by-item or wholesale) before writing.
Stage 3: Apply the updates + diagram validation
Use Edit / Write to commit the user-approved plan to disk. Immediately self-check after writing:
- Diagram health:
- Code fences are properly paired (
@startuml/@enduml, mermaid```mermaidclosing, etc.) - No syntax breakage
- For any diagram that was touched, render it mentally or with a tool to confirm the structure is correct
- Code fences are properly paired (
- Cross-references: file names / links in the main index still point to docs that exist; inter-doc references like "see [N]" still resolve.
- Scope audit: run
git diff <docs-path>on the actually changed lines and confirm nothing outside the approved plan slipped in.
If a self-check surfaces an issue, fix it before continuing.
Stage 4: Consistency verification + summary
4.1 Spot re-verification
Randomly sample 3–5 factual claims from this run's changes and re-read the code on the spot to confirm "what the doc now says == what the code now does". If any one fails to match, go back to Stage 2 and patch.
4.2 Summary output
## Doc Update Summary
**Scan scope**: <list of maintained docs / full or targeted: xxx>
**Code sampling**: <which key files were read / how many Explore agents used>
**Total drift items**: N (structure drift x / signature drift y / Stub-implemented z / ...)
**Updated**:
- <doc path>: <what was changed, mapping to which drift item>
- ...
**Skipped / rejected by user**: <list them, for the record>
**Known TODOs / placeholders still present** (the doc already labels them honestly — these are not staleness):
- <e.g., module X is still a Stub; config item Y is a placeholder pending decision>
**Diagram validation**: ✅ all paired, no syntax breakage
**Spot re-verification**: ✅ x/y items verified consistentBoundaries with other skills
code-review: reviews the quality of git-changed code itself. This skill updates docs.change-recap: distills freshly completed work into knowledge. This skill removes doc staleness and does not produce new knowledge — but if the scan turns up "a new feature the doc does not yet cover", suggest the user runchange-recapto capture it; this skill does not do that on its own.error-handling: handles bugs. After a bug fix changes the code, call this skill to sync the docs.
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.

