Best for
- Use when updating README/docs/codemaps after code changes, running docs-drift checks, or producing scoped evidence-backed doc patches for service/library/CLI/monorepo projects.
johnqtcg/awesome-skills/skills/update-doc/SKILL.md
Keep repository documentation synchronized with the latest code. Use when updating README/docs/codemaps after code changes, running docs-drift checks, or producing scoped evidence-backed doc patches for service/library/CLI/monorepo projects.
Decision brief
Synchronize documentation with repository evidence and avoid stale or speculative content.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/update-doc"Inspect the Agent Skill "update-doc" from https://github.com/johnqtcg/awesome-skills/blob/d933bc88237f7a18a7ecf01e5d97a745b083df0f/skills/update-doc/SKILL.md at commit d933bc88237f7a18a7ecf01e5d97a745b083df0f. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Run scope discovery - Union of the four diff sources; record NEWSOURCE, DOMINANT, RESOLVED, LIKELY. - PRIMARY is a repo-level summary only. Never document a command from it. 2. Confirm scope - Identify target docs (README.md, docs/, docs/CODEMAPS/, module READMEs). - Apply §O…
Review the “Quick Reference” section in the pinned source before continuing.
Use repository files as the only source of truth.
Run the bundled discovery script before reading any document:
Run the bundled discovery script before reading any document:
Permission review
The documentation asks the agent to run terminal commands or scripts.
Run the bundled discovery script before reading any document:The documentation asks the agent to run terminal commands or scripts.
bash "${CLAUDE_SKILL_DIR}/scripts/discover_doc_scope.sh" --base <ref>Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 93/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 30 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Synchronize documentation with repository evidence and avoid stale or speculative content.
| If you need to… | Go to |
|---|---|
| Update README/docs after a code change (default workflow) | §Pre-Update Gates → §Output Mode Routing → §Standard Workflow |
| Find what actually changed | §1) Scope Discovery |
| Decide which command belongs in the doc | §4) Command Source Resolution |
| Choose the right doc structure for project type | §Project-Type Guidance + Load references/project-routing.md |
| Get the per-language evidence commands | Load references/evidence-commands.md |
| Check docs-drift: find gaps between code and docs | §Quality Scorecard (12 Checks) + Load references/update-doc.md |
| Add CI checks to catch docs drift automatically | Load references/ci-drift.md |
Understand what to mark vs. invent (Not found in repo) | §Hard Rules |
Not found in repo.Run the bundled discovery script before reading any document:
bash "${CLAUDE_SKILL_DIR}/scripts/discover_doc_scope.sh" --base <ref>
${CLAUDE_SKILL_DIR} expands to this skill's own directory. Two separate version
gates apply, and they are not the same number:
| Substituted in | Since | Source |
|---|---|---|
| SKILL.md body content | v2.1.69 | CHANGELOG |
allowed-tools Bash rules | v2.1.129 | Frontmatter reference docs |
So on v2.1.69–v2.1.128 the command above resolves correctly but the matching grant
stays a literal ${CLAUDE_SKILL_DIR} string and never matches, and the run prompts
for permission. Below v2.1.69 neither resolves; substitute the real path by hand.
Prompting is a degradation, not an error — the alternative, a Bash(bash *script.sh*)
wildcard, would match a same-named script anywhere on disk.
It reports the diff scope from four independent sources, the dominant language, command-source priority, project-type signals, and the existing doc/CI inventory.
A single git diff --name-only is not sufficient scope. It shows only unstaged edits
to tracked files. Four sources must be reconciled:
| Source | Command | What is missed if skipped |
|---|---|---|
| Working tree | git diff --name-only | — |
| Staged | git diff --cached --name-only | anything already added to the index |
| Untracked | git ls-files --others --exclude-standard | every newly created file |
| Base range | git diff --name-only <base>...HEAD | everything already committed on the branch |
Take the union: a new module normally appears only in the untracked or base-range set, which is exactly the change most likely to need new documentation.
--name-only reports an added file and a modified file identically, so that union
still cannot answer "did this introduce a new source file?" — the question §Output Mode
Routing turns on. The report answers it separately as NEW_SOURCE:, computed from adds
only (untracked, staged adds, --diff-filter=A over the base range) and filtered to
source extensions, so a new .md does not count.
Treat the run as valid only when the script exits 0 and its last line is === END ===.
A truncated report means discovery failed; say so instead of proceeding on partial scope.
If STATUS: DEGRADED_NO_GIT or BASE_REF: NOT_RESOLVED, state that limitation in the
assistant response and fall back to explicit file evidence from the touched code paths.
Before editing docs, determine:
If user did not specify:
Classify the repo and choose structure accordingly. The discovery script's LIKELY: and
SCORES: lines are the starting signal, not the verdict — confirm against actual layout.
If uncertain, state the assumption and proceed with the best-fit template.
Every command printed in a document must come from the highest-priority source that actually defines that command.
Read RESOLVED:, not PRIMARY:. PRIMARY: names the repo's dominant wrapper and is
a repo-level answer; it says nothing about where any particular command lives. A
Makefile holding only a lint target still makes PRIMARY: makefile while
npm run build remains the only real build command:
PRIMARY: makefile
RESOLVED:
build: package-scripts (npm run build)
test: package-scripts (npm run test)
lint: makefile (make lint)
install: native (npm install)
Document each command from its own resolved source. In a workspace, also read
MODULES: — a root wrapper frequently covers only some modules, and documenting the
root command for a module it does not apply to is the same defect one level down.
The ladder each kind is resolved against:
| Priority | Source | Use when |
|---|---|---|
| 1 | Makefile / GNUmakefile | any target exists — document make <target>, not the command it wraps |
| 2 | Taskfile.yml / justfile | repo uses a task runner instead of make |
| 3 | package.json scripts | Node repos — document npm run <script> |
| 4 | Native toolchain (go test ./..., cargo build, pytest) | no wrapper exists |
| 5 | CI workflow | nothing above defines it, but CI runs it — cite the workflow path |
Rules:
make test surviving an internal refactor is the entire point of the wrapper.NOT_FOUND, mark it Not found in repo. Do not fill the gap with a conventional default, and do not borrow the command from a different kind that did resolve.Never fabricate command validation.
Not verified in this environment into user-facing docs by default.Resolve in order. The first rule that fires wins — do not evaluate later rules.
Use full mode if any of these hold:
Use lightweight mode only if all of these hold:
NEW_SOURCE: 0 (do not infer this from TOTAL_UNIQUE — a modified file and an added file look the same there)Anything that matches neither rule uses full mode.
Escalation is one-way. If editing expands past the discovered scope mid-task, switch to full mode and say so. Never downgrade from full to lightweight.
Avoid these common documentation-update failures:
target readers, this document is for...) when the document already self-explains through title and opening value proposition.NEW_SOURCE, DOMINANT, RESOLVED, LIKELY.PRIMARY is a repo-level summary only. Never document a command from it.README.md, docs/*, docs/CODEMAPS/*, module READMEs).references/evidence-commands.md and run the block matching DOMINANT.Not found in repo.Prioritize:
Prioritize:
Prioritize:
Prioritize:
For top-level README updates, optimize for reader flow:
Do not remove a useful table of contents just to shorten the file. Compress it to major sections if needed.
Create only evidence-backed codemap files:
docs/CODEMAPS/INDEX.mddocs/CODEMAPS/backend.mddocs/CODEMAPS/integrations.mddocs/CODEMAPS/workers.md (if workers/cron/queues exist)docs/CODEMAPS/frontend.md (if frontend exists)docs/CODEMAPS/database.md (if schema evidence exists)Each codemap should contain:
When applicable, recommend/maintain:
If repo has no doc CI, mark as gap and provide minimal next-step commands.
This skill keeps its own contract test coverage for major workflow rules.
scripts/tests/ when changing output contracts, routing rules, or agent-facing behavior.bash "${CLAUDE_SKILL_DIR}/scripts/run_regression.sh" after editing the skill.The examples below show the expected shape of each output mode. Adapt field values to the actual project.
Scenario: user updated a Go CLI's flag parsing; only
README.mdneeds a command refresh.
Changed files
README.md — updated Usage section, refreshed --timeout flag descriptionEvidence map
| Section changed | Source evidence |
|---|---|
Usage > --timeout flag | cmd/root.go:42 — pflag.Duration("timeout", ...) |
Usage > exit codes | cmd/root.go:87-91 — explicit os.Exit calls |
Command verification
scripts/discover_doc_scope.sh — executed; TOTAL_UNIQUE: 1 (cmd/root.go), NEW_SOURCE: 0RESOLVED gives run: NOT_FOUND (no Makefile target, no main package at the module root), so the invocation is documented from cmd/root.go and marked Not found in repo for a run wrapperScenario: user added a background worker and a new
REDIS_URLenv var; README and codemaps need updating.
Changed files
README.md — added Worker runtime mode, added REDIS_URL to env tabledocs/CODEMAPS/workers.md — created; documents new queue consumerEvidence map
| Section changed | Source evidence |
|---|---|
Runtime modes > Worker | cmd/worker/main.go:1 — new entrypoint |
Config > REDIS_URL | internal/queue/client.go:14 — os.Getenv("REDIS_URL") |
Workers codemap > Entry point | cmd/worker/main.go:12 — queue.NewConsumer(...) |
Workers codemap > Dependencies | go.mod:9 — github.com/redis/go-redis/v9 |
Command verification
scripts/discover_doc_scope.sh — executed; TOTAL_UNIQUE: 4, NEW_SOURCE: 1; cmd/worker/main.go appeared only in the untracked setrg -n "os\.Getenv" --glob '*.go' — executed; found REDIS_URL, DATABASE_URLRESOLVED gives run: makefile (make run-worker), sourced from Makefile:run-workerScorecard
| # | Check | Result |
|---|---|---|
| 1 | Claims traceable to repo evidence | PASS |
| 2 | Audience/language assumptions explicit | PASS |
| 3 | Project type routing explicit | PASS — Service/backend |
| 4 | Diff scope reconciled across all four sources | PASS |
| 5 | Quick start/run path accurate | PASS |
| 6 | Config/env documented accurately | PASS |
| 7 | Command source priority respected | PASS — Makefile first |
| 8 | Command claims honest; no internal labels in docs | PASS |
| 9 | Structure and links/paths valid | PASS |
| 10 | Optional sections only where evidence exists | PASS |
| 11 | Drift guardrails documented | PASS |
| 12 | No fabricated claims; unknowns marked | PASS |
Total: 12/12 — PASS
Open gaps
Not found in repo: worker shutdown/graceful-stop behavior — no evidence in source; omitted from docsMark each item PASS / FAIL / N/A (reason), then output Total: X/12.
N/A does not reduce the denominator. A check marked N/A must carry a reason and
counts as neither pass nor fail; report it as Total: X/12 (Y N/A) so the reader can
see the real coverage rather than an inflated ratio.
Not found in repo.Decision rule:
PASS if score >= 10/12 and no fabricated claims.FAIL and list required follow-up fixes.Report these in the assistant response, not inside the edited docs unless the user explicitly asks for them in-document:
Changed files: updated files.Evidence map: table of changed section -> source files.Command verification: what was actually executed vs not executed.Skip the 12-item scorecard by default. Include Open gaps only when the change exposes
a real missing source of truth.
Changed files: updated files.Evidence map: table of section -> source files.Command verification: what was actually executed vs not executed.Scorecard: 12-item PASS/FAIL/N/A + total.Open gaps: unresolved items labeled Not found in repo.When gathering code evidence for a specific language, or working in a polyglot repo:
→ Load references/evidence-commands.md for per-language entrypoint/route/config/dependency commands and the regex and shell pitfalls that silently produce empty evidence.
When determining the appropriate README/docs structure for a project type (service, library, CLI, monorepo):
→ Load references/project-routing.md for structure templates per project type with required sections, ordering, and the routing signals that distinguish them.
When synchronizing README or docs after code changes, or applying drift-safe update rules:
→ Load references/update-doc.md for drift-safe synchronization rules and scoped evidence collection patterns.
When adding CI guardrails for docs drift detection, or reviewing CI pipelines for doc coverage:
→ Load references/ci-drift.md for recommended CI checks (markdown linting, link validation, drift detection), ownership policies, and update timing rules.
Frequently asked questions
Synchronize documentation with repository evidence and avoid stale or speculative content.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/update-doc". Inspect the command and pinned source before running it.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
oaustegard/claude-skills
Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre
dancingteeth/unified-code-review
Risk-first code review for PRs and branch audits: blast-radius triage, agent-authored discipline (tests first, intent evidence), call-graph pincer for integration defects between modules, then structural code-judo bar. Use when reviewing PRs, auditing agent-written diffs, catching rubber-stamp green CI, or wiring bugs single-file review misses. Prefer over structure-only thermo-nuclear review alone. Do not use for unrelated coding tasks or as an always-on rule.
PaulRBerg/agent-skills
Create/scaffold/init a project-local agent skill under `.agents/skills` in an ordinary repository; defer to repository instructions that define a source catalog and lifecycle.
NintendaDev/unikit-ai
Generate and maintain the project's TECHNICAL documentation from its codebase — scans the project structure, tech stack, and module boundaries, then writes a lean README landing page plus detailed topic pages (architecture, modules, setup, build, APIs), only the docs that are relevant. Use whenever the user wants to create, update, or validate documentation of the CODE or the project itself, e.g. "generate documentation", "create docs", "write the README", "update the project docs", "document th