sync-docs-after-edit
Skill0 starsChanged 4 months agoMITView on GitHub
After local changes or a commit, scan all .md files in the repo and flag any that are stale or contradicted by the changes. Triggered by "sync docs", "check if docs are up to date", "update docs after my changes", "did my change break any docs?", "are the docs current", "update the readme", "docs out of date", "docs stale", "update documentation".
In this repository21 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- ci-cd-pipelineSkill
- requirements-synthesisSkill
- security-hardeningSkill
- spec-driven-developmentSkill
- workflow-from-chatsSkill
- architecture-decision-recordsSkill
- commit-history-auditSkill
- commit-messageSkill
- deslopSkill
- document-thisSkill
- env-drift-checkSkill
- handoffSkill
- minimal-diff-reviewSkill
- onboardingSkill
- pre-commit-checkSkill
- pr-review-canvasSkill
- pr-summarySkill
- release-readinessSkill
- requirements-qaSkill
- write-changelogSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Keep documentation honest after local edits or commits.
- Distinctive: line 48
If you're truly outside a git repo, use the PowerShell-native equivalent instead:
- Very specific: line 57
Read the .md file and the changed source files.
- Very specific: line 70
Always include README.md and CHANGELOG.md as explicit rows — even if they appear unaffected.
- Distinctive: line 85
If the user says "update them" or "fix the docs":
- Distinctive: line 87
Do not rewrite docs wholesale — only fix what's factually stale.
- Distinctive: line 88
After editing, re-run the assessment for the updated files to confirm they're now clean.
- Very specific: line 102
If CHANGELOG.md exists, always flag it as a candidate — new changes often warrant a changelog entry.
- Distinctive: line 103
If README.md has a "Quick start" or "API" section, always read it against the changed source.
- Very specific: line 104
Do not update CHANGELOG.md automatically — propose the entry and let the user confirm.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
📝 Skill: sync-docs-after-edit
Purpose
Keep documentation honest after local edits or commits. Distinct from sync-docs-after-git-pull (which fires after receiving remote changes) — this skill reacts to what you just changed locally.
Trigger phrases
- "sync docs"
- "check if docs are up to date"
- "update docs after my changes"
- "did my change break any docs?"
- "sync-docs-after-edit"
Steps
1. Identify what changed
# Uncommitted changes
git diff --name-only
# Last commit
git diff --name-only HEAD~1..HEAD
# Staged but not committed
git diff --cached --name-onlyCollect the full set of changed source files. Exclude .md files themselves from the "changed source" list — they are the targets, not the triggers.
2. Discover all documentation files
# List tracked markdown files — cross-platform by construction (git ships
# identically on macOS/Linux/Windows), and naturally excludes .git/node_modules/
# vendor/.venv as long as they're gitignored, with no -not -path gymnastics needed.
git ls-files '*.md'
# If newly-added (untracked) docs should also be in scope, add:
git ls-files --others --exclude-standard '*.md'This only covers files git knows about (tracked, plus untracked if you add the second command) — which is the correct scope for a "sync docs" pass, since a doc that isn't even staged for commit isn't part of "what you just changed."
If you're truly outside a git repo, use the PowerShell-native equivalent instead:
Get-ChildItem -Recurse -Filter *.md | Where-Object { $_.FullName -notmatch '\\(\.git|node_modules|vendor|\.venv)\\' }(GNU find -not -path has no native Windows equivalent — the find.exe bundled
with cmd.exe is a completely different, incompatible tool.)
3. For each .md file, assess relevance
Read the .md file and the changed source files. Assess:
| Question | If yes → |
| Does the doc reference a function, class, or API that was renamed or removed? | Needs update |
| Does the doc describe a workflow or command that no longer works as written? | Needs update |
| Does the doc include example code that is now incorrect? | Needs update |
| Does the doc describe a config option that was added or changed? | Needs update |
| Is the doc entirely unrelated to the changed files? | Not affected |
| Is the doc correct and consistent with the changes? | Up to date |
4. Report per-file verdicts
Always include README.md and CHANGELOG.md as explicit rows — even if they appear unaffected. These are the two docs most likely to drift silently.
Documentation sync report
Changed source files: <list>
| Doc file | Verdict | Notes |
|----------|---------|-------|
| README.md | Needs update | Quick Start references `DB_URL` — now `DATABASE_URL` |
| CHANGELOG.md | Needs entry | No entry yet for changes in this diff |
| docs/api.md | Needs update | References `getUser()` which was renamed to `fetchUser()` |
| docs/setup.md | Up to date | |5. Apply updates (if instructed)
If the user says "update them" or "fix the docs":
- For each file marked Needs update: make the minimal edit to bring it in line with the code changes.
- Do not rewrite docs wholesale — only fix what's factually stale.
- After editing, re-run the assessment for the updated files to confirm they're now clean.
6. Final confirmation
After all updates:
All docs synced.
Updated: <list of files changed>
No-change: <list confirmed up to date>Output
A per-file verdict table, plus optional edits if the user confirms.
Notes
- If
CHANGELOG.mdexists, always flag it as a candidate — new changes often warrant a changelog entry. - If
README.mdhas a "Quick start" or "API" section, always read it against the changed source. - Do not update
CHANGELOG.mdautomatically — propose the entry and let the user confirm.
Gotchas
git diff --name-only HEAD~1..HEADerrors on a repo's very first commit (noHEAD~1exists) — checkgit rev-list --count HEADfirst, or fall back togit show --name-only HEAD.- On a repo with hundreds of
.mdfiles, reading every one in full to assess relevance can blow the context budget — filter to docs that plausibly reference the changed paths/symbols (grep first) before doing a full read. - A doc can look "up to date" on a text match while actually describing removed behavior if the removal wasn't a rename (e.g. a feature deleted outright, not renamed) — cross-check against the diff's deletions, not just its additions.
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.

