update-doc
Skill30 starsChanged 4 months agoMITView on GitHub
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.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- bbvch-ai/aihub-coretheir own version, first seen Oct 25, 2026
- Kotlin/kotlinx-rpctheir own version, first seen Oct 8, 2026
- enbyaugust/zacs-claude-skillstheir own version, first seen Jan 23, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Kotlin/kotlinx-rpc★ 1.1ksame name
- enbyaugust/zacs-claude-skills★ 30same name
- bbvch-ai/aihub-core★ 16same 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 repository52 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-designSkill
- api-integration-testSkill
- constructive-thinkingSkill
- create-prSkill
- deep-researchSkill
- e2e-testSkill
- fuzzing-testSkill
- git-commitSkill
- go-benchmarkSkill
- go-ci-workflowSkill
- go-code-reviewerSkill
- go-concurrency-reviewSkill
- go-dependency-auditSkill
- go-error-reviewSkill
- go-logic-reviewSkill
- go-makefile-writerSkill
- go-observability-reviewSkill
- google-searchSkill
- go-performance-reviewSkill
- go-quality-reviewSkill
- go-review-leadSkill
- go-security-reviewSkill
- go-test-reviewSkill
- incident-postmortemSkill
- kafka-event-driven-designSkill
- load-testSkill
- local-transcriptSkill
- log-analyzerSkill
- mongo-migrationSkill
- monitoring-alertingSkill
- mysql-migrationSkill
- oceanbase-table-designSkill
- oracle-migrationSkill
- pg-migrationSkill
- readme-generatorSkill
- redis-cache-strategySkill
- security-reviewSkill
- stock-analysis-leadSkill
- stock-balance-sheet-reviewSkill
- stock-business-reviewSkill
- stock-earnings-quality-reviewSkill
- stock-industry-reviewSkill
- stock-management-reviewSkill
- stock-peer-comparison-reviewSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- tech-doc-writerSkill
- thirdparty-api-integration-testSkill
- unit-testSkill
- writing-plansSkill
- yt-dlp-downloaderSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
44 rules. 0 are common, 30 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
30
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Use repository files as the only source of truth.
- Distinctive: line 29
Do not invent APIs, routes, env vars, ports, jobs, or dependencies.
- Distinctive: line 30
Prefer minimal patches by default.
- Distinctive: line 31
Use diff-scoped updates first.
- Distinctive: line 32
Keep output scannable: headings + concise bullets + short runnable command blocks.
- Distinctive: line 33
Keep internal workflow markers out of user-facing docs by default.
- Distinctive: line 34
Do not add self-explanatory audience labels or author commentary to top-level docs unless they materially help readers.
- Distinctive: line 40
Run the bundled discovery script before reading any document:
- Very specific: line 82
Treat the run as valid only when the script exits 0 and its last line is === END ===.
- Very specific: line 85
If STATUS: DEGRADED_NO_GIT or BASE_REF: NOT_RESOLVED, state that limitation in the assistant response and fall back to explicit file …
- Distinctive: line 90
Before editing docs, determine:
- Distinctive: line 95
If user did not specify:
- Distinctive: line 97
follow current repository doc language
- Distinctive: line 98
keep assumptions in the assistant response.
- Distinctive: line 110
If uncertain, state the assumption and proceed with the best-fit template.
- Distinctive: line 114
Every command printed in a document must come from the highest-priority source that actually defines that command.
- Very specific: line 117
Read RESOLVED:, not PRIMARY:.
- Very specific: line 131
Document each command from its own resolved source.
- Very specific: line 147
When a wrapper exists for that command, document the wrapper.
- Distinctive: line 148
When only CI defines a command, document it and cite the workflow file so readers can see where it is authoritative.
- Very specific: line 149
When a kind resolves to NOT_FOUND, mark it Not found in repo.
- Distinctive: line 153
Never fabricate command validation.
- Distinctive: line 156
If commands were executed, report that in the assistant response.
- Very specific: line 157
If commands were not executed, do not inject Not verified in this environment into user-facing docs by default.
- Distinctive: line 158
Only add explicit verification wording to docs when the user requests it or the repo clearly uses internal verification notes as part of …
- Distinctive: line 166
Use full mode if any of these hold:
- Distinctive: line 176
Use lightweight mode only if all of these hold:
- Distinctive: line 179
no codemap output was requested
- Distinctive: line 192
Avoid these common documentation-update failures:
- Distinctive: line 213
Every changed section maps to concrete file evidence with a path and line.
- Distinctive: line 264
avoid dumping complete tree for each package
- Distinctive: line 275
Do not remove a useful table of contents just to shorten the file.
- Distinctive: line 279
Create only evidence-backed codemap files:
- Distinctive: line 299
When applicable, recommend/maintain:
- Distinctive: line 306
If repo has no doc CI, mark as gap and provide minimal next-step commands.
- Very specific: line 312
Add or update regression tests under scripts/tests/ when changing output contracts, routing rules, or agent-facing behavior.
- Very specific: line 313
Run bash "${CLAUDE_SKILL_DIR}/scripts/run_regression.sh" after editing the skill.
- Distinctive: line 314
Keep tests focused on durable contract checks and behavior, not incidental wording.
- Distinctive: line 398
All major claims are traceable to repo evidence.
- Very specific: line 409
No fabricated claims; unknowns marked Not found in repo.
- Very specific: line 439
When gathering code evidence for a specific language, or working in a polyglot repo: → Load references/evidence-commands.md for …
- Very specific: line 442
When determining the appropriate README/docs structure for a project type (service, library, CLI, monorepo): → Load …
- Very specific: line 445
When synchronizing README or docs after code changes, or applying drift-safe update rules: → Load references/update-doc.md for drift-safe …
- Very specific: line 448
When adding CI guardrails for docs drift detection, or reviewing CI pipelines for doc coverage: → Load references/ci-drift.md for …
“Common” is measured: kept by at least 6 in 10 of the 3 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
Update Docs
Synchronize documentation with repository evidence and avoid stale or speculative content.
Quick Reference
| 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 |
Hard Rules
- Use repository files as the only source of truth.
- Mark missing information as
Not found in repo. - Do not invent APIs, routes, env vars, ports, jobs, or dependencies.
- Prefer minimal patches by default; preserve existing doc structure unless user requests restructure.
- Use diff-scoped updates first; avoid unrelated bulk rewrites.
- Keep output scannable: headings + concise bullets + short runnable command blocks.
- Keep internal workflow markers out of user-facing docs by default. Verification labels, scorecards, and evidence tables belong in the assistant response unless the user explicitly wants them in the document.
- Do not add self-explanatory audience labels or author commentary to top-level docs unless they materially help readers.
Pre-Update Gates (Mandatory)
1) Scope Discovery
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.
2) Audience and Language Gate
Before editing docs, determine:
- target readers (contributors/operators/API consumers/end users)
- output language (Chinese/English/bilingual)
If user did not specify:
- follow current repository doc language
- keep assumptions in the assistant response; only add them to docs when they materially help readers
3) Project Type Routing
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.
- Service/backend app
- Library/SDK
- CLI tool
- Monorepo
If uncertain, state the assumption and proceed with the best-fit template.
4) Command Source Resolution
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:
- When a wrapper exists for that command, document the wrapper.
make testsurviving an internal refactor is the entire point of the wrapper. - When only CI defines a command, document it and cite the workflow file so readers can see where it is authoritative.
- When a kind resolves to
NOT_FOUND, mark itNot 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.
5) Command Verifiability Gate
Never fabricate command validation.
- Commands are documented from their authoritative source (gate 4), not from executing them.
- If commands were executed, report that in the assistant response.
- If commands were not executed, do not inject
Not verified in this environmentinto user-facing docs by default. - Only add explicit verification wording to docs when the user requests it or the repo clearly uses internal verification notes as part of its style.
Output Mode Routing
Resolve in order. The first rule that fires wins — do not evaluate later rules.
Rule 1 — Full mode (escalation triggers)
Use full mode if any of these hold:
- codemap creation or restructure was requested
- README or docs were substantially reorganized
- a new API surface, runtime mode, deployment path, or config/env key is being documented
- more than one module is affected
- the user explicitly asked for an audit or scorecard
Rule 2 — Lightweight mode
Use lightweight mode only if all of these hold:
- at most 2 doc files change
- no codemap output was requested
- the change is confined to wording, a command refresh, a link fix, or a single section
- discovery reports
NEW_SOURCE: 0(do not infer this fromTOTAL_UNIQUE— a modified file and an added file look the same there)
Rule 3 — Default
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.
Anti-Patterns
Avoid these common documentation-update failures:
- Copying assistant-side reporting into docs, such as verification-state labels, evidence tables, or scorecards.
- Making README more "complete" while making it worse as a homepage, for example by pushing install and quick start below contributor-only workflows.
- Deleting useful navigation from a long README in the name of simplification.
- Adding author-explanatory prose (
target readers,this document is for...) when the document already self-explains through title and opening value proposition. - Updating only isolated output examples for generator-style tools without preserving the input -> result -> output-shape reader path.
- Scoping the update from unstaged changes alone, so a newly added module is documented nowhere.
Standard Workflow
- Run scope discovery
- Union of the four diff sources; record
NEW_SOURCE,DOMINANT,RESOLVED,LIKELY. PRIMARYis a repo-level summary only. Never document a command from it.
- Union of the four diff sources; record
- Confirm scope
- Identify target docs (
README.md,docs/*,docs/CODEMAPS/*, module READMEs). - Apply §Output Mode Routing to decide patch vs full rewrite.
- Identify target docs (
- Gather evidence from code
- Load
references/evidence-commands.mdand run the block matchingDOMINANT. - Entrypoints, business layers, config/env, runtime/deploy/quality scripts, CI workflows.
- Load
- Build doc-evidence map
- Every changed section maps to concrete file evidence with a path and line.
- Unknowns remain
Not found in repo.
- Apply project-type template rules
- Service/library/CLI/monorepo structure rules.
- Update docs
- Edit only impacted sections unless broader restructure was requested.
- Preserve the primary reader path (for README: homepage first, reference second) unless the user asked for a deeper restructure.
- Validate consistency
- Mentioned paths exist.
- Commands come from the resolved source and are syntactically valid.
- Links/anchors resolve.
- Terminology/path style is consistent.
- Navigation was preserved or improved for long docs.
- Add drift guardrails
- Recommend or update CI checks for docs drift/link validity/lint where applicable.
- Deliver result in the routed output mode.
Project-Type Guidance
Service / Backend
Prioritize:
- runtime modes (api/worker/cron)
- environment/config behavior
- ops run commands
Library / SDK
Prioritize:
- install and usage examples
- public API surface
- compatibility/version notes
CLI Tool
Prioritize:
- install and invocation examples
- flag/options behavior
- exit/error behavior (if evidence exists)
- an end-to-end usage example that shows input -> resulting file/output -> output shape when evidence exists
Monorepo
Prioritize:
- root overview + module index table
- links to submodule docs
- per-module language and command source when the repo is polyglot
- avoid dumping complete tree for each package
README UX Rules
For top-level README updates, optimize for reader flow:
- value proposition before implementation detail
- install and quick start before maintainer workflows
- a compact table of contents for long docs
- end-to-end examples before deep reference sections
Do not remove a useful table of contents just to shorten the file. Compress it to major sections if needed.
Codemap Output Contract (When Requested)
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:
- Last updated date
- Entry points
- Key modules table (module/purpose/dependencies)
- Evidence-backed data flow
- External dependencies
- Cross-links to related docs
CI Drift Guardrails
When applicable, recommend/maintain:
- markdown lint checks
- link checker
- docs drift check tied to changed code paths
- README/codemap ownership note (who updates and when)
If repo has no doc CI, mark as gap and provide minimal next-step commands.
Self-Validation
This skill keeps its own contract test coverage for major workflow rules.
- Add or update regression tests under
scripts/tests/when changing output contracts, routing rules, or agent-facing behavior. - Run
bash "${CLAUDE_SKILL_DIR}/scripts/run_regression.sh"after editing the skill. - Keep tests focused on durable contract checks and behavior, not incidental wording.
Output Examples
The examples below show the expected shape of each output mode. Adapt field values to the actual project.
Lightweight Output Example
Scenario: user updated a Go CLI's flag parsing; only
README.mdneeds a command refresh.
Changed files
README.md— updatedUsagesection, refreshed--timeoutflag description
Evidence 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: 0- Command source —
RESOLVEDgivesrun: NOT_FOUND(no Makefile target, no main package at the module root), so the invocation is documented fromcmd/root.goand markedNot found in repofor a run wrapper
Full Output Example
Scenario: user added a background worker and a new
REDIS_URLenv var; README and codemaps need updating.
Changed files
README.md— addedWorkerruntime mode, addedREDIS_URLto env tabledocs/CODEMAPS/workers.md— created; documents new queue consumer
Evidence 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.goappeared only in the untracked setrg -n "os\.Getenv" --glob '*.go'— executed; foundREDIS_URL,DATABASE_URL- Worker startup command — not executed;
RESOLVEDgivesrun: makefile (make run-worker), sourced fromMakefile:run-worker
Scorecard
| # | 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 docs
Quality Scorecard (12 Checks)
Mark 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.
- All major claims are traceable to repo evidence.
- Audience/language assumptions are explicit.
- Project type routing is explicit.
- Diff scope was reconciled across working tree, staged, untracked, and base range (or the unavailable sources were named).
- Quick start/run path is accurate for project type.
- Config and environment behavior is documented accurately.
- Command source priority is respected (see §4 Command Source Resolution).
- Command claims are honest without leaking internal verification labels into user-facing docs by default.
- Structure and links/paths are valid and non-contradictory.
- Optional sections are included only when evidence exists.
- Drift guardrails/maintenance checks are documented.
- No fabricated claims; unknowns marked
Not found in repo.
Decision rule:
PASSif score >= 10/12 and no fabricated claims.- Otherwise
FAILand list required follow-up fixes.
Output Format
Report these in the assistant response, not inside the edited docs unless the user explicitly asks for them in-document:
Lightweight output
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.
Full output
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 labeledNot found in repo.
Load References Selectively
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.
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.

