writing-docs
Skill1 starsChanged 3 days agoMITView on GitHub
Write, audit or update a project's docs from its source code. User docs (quickstart, install, configuration, a page per feature) and maintainer docs (architecture, data model, invariants), as plain Markdown or for a docs framework such as Starlight or MkDocs. Use for "write the docs", "document this repo", "user docs", "user guide", "docs site", "website docs", "architecture docs", "audit the docs", "update the docs", "the docs are out of date". Not for creating or hosting a docs site.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- sourcehawk/feature-dev-workflowtheir own version, first seen Nov 15, 2026
- grgrwlkr/claude-dashboard-vscodetheir own version, first seen Nov 8, 2026
- johannschopplich/skillstheir own version, first seen Nov 8, 2026
- The-Vibe-Company/quivrtheir own version, first seen Nov 8, 2026
- Wade-DevCode/awesome-coding-skills-cntheir own version, first seen Nov 8, 2026
- gabrielbauman/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use pr-description, implement and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillpr-description
Draft Nacelle PR titles, pull request descriptions, commit titles, commit descriptions, and squash commit messages. Use when asked for PR or commit wording, a branch summary, or a PR description that can be used in a commit. Omit validation sections from commit bodies and remove filler.
Also in 3 projects that use this
Hugging FaceSkillimplement
Make tests pass. Invoke after /write-tests produces failing tests.
Also in 5 projects that use this
GoogleSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 3 projects that use this
GoogleSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 3 projects that use this
- +1 more from google
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- remotion-dev/remotion★ 72ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- medusajs/medusa★ 37ksame name
- Nagi-ovo/gemini-voyager★ 21ksame name
- nukeop/nuclear★ 19ksame name
- ngrx/platform★ 8.3ksame name
- cuthbertLab/music21★ 2.6ksame name
- c15t/c15t★ 2ksame name
- NVIDIA/Megatron-Energon★ 388same name
14 more not listed
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
- code-auditSkill
- comment-auditSkill
- coordinatorSkill
- correctSkill
- deliverSkill
- handoffSkill
- publishing-a-repoSkill
- releaseSkill
- repo-setupSkill
- shared-skillsSkill
- test-auditSkill
- triageSkill
- verification-skillSkill
- writing-readmesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 12 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
12
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 30
Mode: write, audit, or update for a diff.
- Distinctive: line 63
Write the pages by the rules below and the reference files for your scope and format.
- Very specific: line 65
Write docs-map.txt, update the index, and report.
- Very specific: line 71
If a map exists, run <skill>/scripts/docs-scope --coverage.
- Very specific: line 74
Run <skill>/scripts/check-links as in Verify.
- Very specific: line 78
Run <skill>/scripts/docs-scope (add --to <rev> for a specific change).
- Distinctive: line 81
Verify the pages you changed.
- Distinctive: line 85
Use this when a scheduled job or a coordinator runs the update with nobody present.
- Very specific: line 88
If <skill>/scripts/docs-scope prints no STALE page and no UNMAPPED path, the outcome is clean.
- Very specific: line 89
Put the page edits on the branch docs/update and open one pull request.
- Very specific: line 90
Do not write a new page. List each UNMAPPED path in the pull request description with the choice it needs: a new page, an existing page …
- Distinctive: line 91
When the code looks wrong and the page right, leave the page and describe the disagreement in the pull request description, with the …
- Very specific: line 92
Do not move verified-at while an UNMAPPED path or a disagreement is unresolved.
- Distinctive: line 94
Never merge the pull request.
- Distinctive: line 111
Check each concrete claim against its defining line as you write it.
- Distinctive: line 125
No hand-written per-function reference: the code already says it, and a copy drifts.
- Distinctive: line 127
Every invariant names what enforces it (a type, a test, a lint, a constraint).
- Distinctive: line 128
Never invent an owner decision: the security reporting channel, the licence, the code of conduct, changelog history that tags or releases …
- Distinctive: line 129
Treat existing docs as claims to check, not as a source.
- Distinctive: line 136
No placeholders: no "TBD", "TODO", "coming soon" or empty section.
“Common” is measured: kept by at least 6 in 10 of the 23 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
writing-docs
The code is the source of truth. A page states only what you confirmed in the line of code that defines it, and it records which source paths it covers, so that a later run can tell which pages a change made stale.
This skill edits docs and the docs map. It never edits product code.
When a write or an update starts while you are in the repo's main checkout (git rev-parse --path-format=absolute --git-dir --git-common-dir prints the same path twice), do not edit there: another session may be working in it. Do the whole run on a new branch in a worktree of your own (from the repo root, git worktree add -b docs-write ../<repo>-docs-write; if that branch or folder exists, pick another name, never reuse or delete it) and give its path and branch in the report. Work in place when the repo has no commits, or when the docs or the change being documented are not committed yet, because a worktree does not hold them. The unattended update uses a worktree on docs/update and reuses that branch and worktree when they exist.
Choose three things first
Scope, from the repo type. Ask when it is unclear. The scope decides who a page is written for.
- User docs: quickstart, install, configuration, one page per feature. For people who run, install or call the project and never open the source. Read
reference/user-docs.md. - Maintainer docs: architecture and why, data model, invariants per subsystem, security model, dev setup and contributing. For the people and agents who modify the code. Read
reference/maintainer-docs.md. - Both, when asked to document everything. Do user docs first.
Format. Look for docs tooling before you decide: mkdocs.yml, docusaurus.config.*, an Astro config that loads Starlight, .vitepress/, conf.py, book.toml. It may sit in a subfolder such as site/ or website/. Follow what exists. The format decides the layout, the navigation and the build check. It does not change the reader: user docs are written for people in either format.
- Plain Markdown:
.mdfiles read as they are, on the code host or in an editor. The default when the repo has no docs tooling. Readreference/plain-markdown.md. - Docs framework: pages that a tool such as Starlight, MkDocs or Docusaurus builds. Read
reference/docs-framework.md. Setting up or hosting a framework is out of scope. - One source: when a framework holds the user docs, they live there only. The maintainer docs stay plain Markdown in a folder the framework does not publish:
docs/, ormaintainers/at the repo root when the framework ownsdocs/. In the second case pass--map maintainers/docs-map.txtto<skill>/scripts/docs-scope, and point the docs-index line inAGENTS.mdatmaintainers/README.md. The README links to both.
The docs usually live in the source repo. When they are in a separate repo, take the source-repo path and the docs-repo path as two inputs (reference/docs-framework.md).
Mode: write, audit, or update for a diff. An update can also run unattended.
The docs map
<skill> in a command is this skill's folder, the one that holds this file. Run those scripts by that path, with the target repo as the working directory.
Each docs tree has one docs-map.txt at its root: docs/docs-map.txt for plain Markdown, and beside the framework's config (site/docs-map.txt) for a docs framework. A repo with both has two maps; pass --map <file> to <skill>/scripts/docs-scope to pick one.
source .
verified-at 4f2a9c1e
ledger mytool --help
page usage/add.md src/cli/add.rs src/store/
page ../README.md src/cli/ install.sh
exclude src/vendor/ vendoredsourceis.or the source repo's remote URL. Never a local path.verified-atis the source commit the pages were last checked against.ledgeris the command or file that enumerates the feature list.- Each
pageline names a page and the source paths it covers. A page that covers no source, such as the index, is listed with no paths. - Each
excludeline names a path that needs no page, with the reason.--coveragereports every tracked file that no line covers, so exclude the non-source files too (exclude .github/ CI). In a repo with two maps, each map excludes the other docs tree.
<skill>/scripts/docs-scope reads the map and prints STALE pages, UNMAPPED source paths, MISSING-PAGE, UNLISTED and DEAD-SOURCE. Pass --source <path> when the code is in another repo.
Move verified-at forward only when every page the map lists was checked against that commit in this run, or was not made stale by the commits in between. After a partial or blocked run, leave it and report which pages were checked. When the source change is not committed yet, there is no commit to record: leave it and say so.
Write
- Build the ledger from a mechanical source, never from an old doc or from memory: the command registrations or
--helpoutput, the route table, the public exports, the settings definition, the schema files. Rows for user docs are user-facing features. Rows for maintainer docs are modules, data models, entry points and invariants. List every exclusion with its reason (vendored, generated, deprecated and marked). If the ledger is empty because there is no code yet, stop and say so. - Plan the pages: for each, its path, its kind (
reference/style.md), the ledger rows it closes and the source paths it covers. - Checkpoint. Show the owner the ledger and the planned file list, and wait for a yes before you write the tree.
- Read the source. For more than a few rows, start one read-only subagent per subsystem or feature, in parallel. Each returns a summary and edits nothing: what it does, entry points with paths, settings with defaults and the lines that define them, invariants and what enforces each, any evidence of rationale, open questions.
- Write the pages by the rules below and the reference files for your scope and format.
- Verify.
- Write
docs-map.txt, update the index, and report.
Audit
Change nothing; report findings.
- If a map exists, run
<skill>/scripts/docs-scope --coverage. If none exists, say so and build the ledger as in Write step 1. - Coverage: compare the ledger with the pages. Report each feature with no page, and each page whose feature is gone.
- Drift: check each page's claims against the code,
STALEpages first. Report each wrong claim with the page line, the source line, and what the code does. - Run
<skill>/scripts/check-linksas in Verify.
Update for a diff
- Run
<skill>/scripts/docs-scope(add--to <rev>for a specific change). Without a map, list the changed paths withgit diff --name-only <base>..<head>and find the pages that name them. - Edit only the
STALEpages, and in them only the claims the changed paths touch. - For each
UNMAPPEDpath decide: a new feature gets a page and a map line, other source gets added to apageorexcludeline. - Verify the pages you changed.
Unattended update
Use this when a scheduled job or a coordinator runs the update with nobody present. Run Update for a diff with these changes:
- With no docs map, the outcome is blocked: the docs need a first write with the owner present. Open nothing.
- If
<skill>/scripts/docs-scopeprints noSTALEpage and noUNMAPPEDpath, the outcome is clean. Stop, and open nothing. - Put the page edits on the branch
docs/updateand open one pull request. If a pull request from that branch is still open, update it; do not open a second one. - Do not write a new page. List each
UNMAPPEDpath in the pull request description with the choice it needs: a new page, an existingpageline, or anexcludeline. - When the code looks wrong and the page right, leave the page and describe the disagreement in the pull request description, with the evidence.
- Do not move
verified-atwhile anUNMAPPEDpath or a disagreement is unresolved. A later run then reports it again. - A blocked run with page edits still opens the pull request and states blocked first. With no edits it opens nothing.
- Never merge the pull request. Ask no questions; record what you could not decide in the description.
The description starts with the outcome, then lists the pages edited, the items left for the owner, and what was not checked.
Outcomes
An audit or an update ends with one outcome, stated first in the report.
- clean: the docs match the source. Nothing to change.
- findings, for an audit: each finding and the edit proposed for it.
- changed, for an update: the pages edited.
- blocked: the run could not finish. Say what blocked it and what was covered.
When the docs and the code disagree, decide which one is wrong before you touch the page. If the code changed on purpose (a commit, a test or a changelog entry says so), the page is stale: fix the page. If the page describes the intended behaviour and the code no longer does it, that is a product regression: report it with the evidence and leave the page as it is. When you cannot tell, report both readings.
Rules for every page
Check each concrete claim against its defining line as you write it.
| Claim | Check against |
| Default, constant, limit | its definition in code, not a comment or the README |
| Name of a function, type, module, file | the symbol or path itself |
| Setting or environment variable | the code that reads it |
| Command, subcommand, flag | the command registration |
| Route and method | the route registration |
| Behaviour ("does X when Y") | the code path |
| Data shape | the schema or migration |
- CI is the ground truth for commands. Take build, test and run commands from the CI config and the package scripts, not from an older doc.
- Run every dev and test command and every usage example before it goes on a page. Trace deploy and operations sequences against the scripts; never run them. Report each dev command, test command and usage example you did not run, with the reason. A note or a doc that says one of them fails is not a reason: run it and see.
- No hand-written per-function reference: the code already says it, and a copy drifts. The exception is a library whose API is called from outside the repo. It gets a public reference, generated where a generator exists.
- Rationale comes only from evidence: an ADR, a commit message, a pull request, a code comment, or the owner. Cite it. Where there is none, write "rationale unknown" and list it in the report.
- Every invariant names what enforces it (a type, a test, a lint, a constraint). One that nothing enforces is marked "unenforced" and reported as a candidate for a check.
- Never invent an owner decision: the security reporting channel, the licence, the code of conduct, changelog history that tags or releases do not show. Report it as open.
- Treat existing docs as claims to check, not as a source.
Verify
<skill>/scripts/check-linksreports 0 broken. Pass it the docs folder plus each ofREADME.md,CONTRIBUTING.mdandAGENTS.mdthat exists; it stops on a path that does not exist.- Fact-check by an independent subagent, as the default. Give it the pages and the source, and none of your notes or reasoning: "Find every statement in these pages that the code contradicts: values, names, paths, commands, behaviour. Cite the source line for each. Report facts only, not style." Fix each confirmed error. With no subagent available, re-read every page against the source yourself and say the check was not independent.
- Coverage: every ledger row has a page or a listed exclusion.
<skill>/scripts/docs-scope --coverageprints noUNMAPPED. - No placeholders: no "TBD", "TODO", "coming soon" or empty section.
- For a docs framework: the build check in
reference/docs-framework.md.
Report
The outcome, the ledger (documented, excluded and why, still open), the pages written or changed, what was run and what was only traced, every "rationale unknown", every unenforced invariant, every disagreement between docs and code, and the owner decisions still open.
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.

