agentleFS
artefactopartefactop/skills/update-docs/SKILL.md

update-docs

Skill0 starsChanged 4 months agoMITView on GitHub

Keep the docs/ directory of a repository small and true after a change. Find the docs that a change makes wrong, update the docs that earn their place, and delete the docs that only repeat the code. Use this skill when a feature or a behavior change is complete, before you commit or open a pull request, and when the user says "update the docs", "check the docs", "are the docs still accurate", "the docs are stale", or "document this change". Also use it when the user asks what to do with a docs/ directory that no longer agrees with the code, or when you changed a file that the related_files frontmatter of a doc lists. Do NOT use it for refactors that change no behavior, for test-only changes, or for config and dependency updates, because no doc can be wrong if no behavior changed. Do NOT use it to write new documentation from nothing, to rewrite a README, or to generate API reference text.

92 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use get-pr-reviews, push-everything and 10 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.
  • saffron-healthSkill

    get-pr-reviews

    Get nicely formatted output of the last review comments on a PR. Used internally by other skills.

    Also in 3 projects that use this

  • saffron-healthSkill

    push-everything

    Stage ALL changes in the repository (not just session changes), commit, and push. Use when you need to commit all pending changes.

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-export

    Export instincts from project/global scope to a file

    Also in 3 projects that use this

  • TheKREATORSSkill

    instinct-import

    Import instincts from file or URL into project/global scope

    Also in 3 projects that use this

  • NVIDIASkill

    generate-spec

    Produce a feature specification covering API changes, backward compatibility, cross-language impact, performance, and a file-level change plan. Use when designing a new feature, planning a significant change, or the user asks to spec something out.

    Also in 3 projects that use this

  • GoogleSkill

    pr-creator

    Also in 6 projects that use this

  • +1 more from TheKREATORS
  • +1 more from saffron-health
  • Other versions92 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 92

    1. vercel/next.js★ 144ksame name
    2. pipecat-ai/pipecat★ 18ksame name
    3. anyproto/anytype-ts★ 9.2ksame name
    4. vladmandic/sdnext★ 7.4ksame name
    5. dotnet/sdk★ 3.3ksame name
    6. meta-pytorch/OpenEnv★ 2.9ksame name
    7. huggingface/OpenEnv★ 2.9ksame name
    8. man-group/ArcticDB★ 2.7ksame name
    9. fabro-sh/fabro★ 1.9ksame name
    10. peteonrails/voxtype★ 1.8ksame name

    82 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 repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 87 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the change. Then keep docs/ small: update what earns its place, delete what repeats the code.

    line 8
  2. Distinctive:

    Only three kinds of doc survive.

    line 18
  3. Distinctive:

    Every other doc is a second copy of the code, and no test protects it.

    line 27
  4. Distinctive:

    Ask these questions about each doc, in this order:

    line 33
  5. Very specific:

    Every sentence repeats auth/login.py, and the expiry is already wrong.

    line 47
  6. Distinctive:

    Changed files: Run both commands. The usual case for this skill is a complete feature that nobody committed yet, and git diff alone finds …

    line 62
  7. Very specific:

    Affected docs: Read the frontmatter of each docs//*.md file in full, from the opening --- to the closing ---.

    line 74
  8. Very specific:

    Search the repository for links to the doc, docs/CLAUDE.md included.

    line 108
  9. Distinctive:

    Delete the file, or delete the section.

    line 109
  10. Very specific:

    Delete the entry in docs/CLAUDE.md.

    line 110
  11. Distinctive:

    Read the full doc and the changed code.

    line 113
  12. Distinctive:

    Delete what a reader can get from the source.

    line 114
  13. Distinctive:

    Keep the style of the doc.

    line 116
  14. Very specific:

    Backfill: Add name, description, kind, and related_files from the content of the doc.

    line 118
  15. Very specific:

    Create: Write the frontmatter below, then add an entry to docs/CLAUDE.md.

    line 122

“Common” is measured: kept by at least 6 in 10 of the 87 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update Docs

Read the change. Then keep docs/ small: update what earns its place, delete what repeats the code.

Why deletion is the default

A doc is not executable and no test covers it, so it drifts. If a doc and the code disagree, the next reader has two sources of truth and no way to find the stale one. This reader can be a person or an agent. A deleted doc costs the reader nothing. A wrong doc sends the reader to a wrong decision.

Only three kinds of doc survive. Only these three say something that the code cannot say:

KindWhy code cannot express it
Decision record (ADR)The context, the constraints, and the alternatives you rejected. Code shows the choice. Code never shows the reason.
GlossaryDomain terms — what "bow", "cohort", and "IC" mean in this repository.
Navigation guideA thin map of the repository: which application owns what, and where to start to read. Pointers only, no behavior.

Every other doc is a second copy of the code, and no test protects it. This includes API walkthroughs, step-by-step flows, field-by-field tables, and code copied from the source.

Delete-first checklist

Ask these questions about each doc, in this order:

  1. Can a reader get this from the code? → Delete the doc, or delete the section.
  2. Is this an ADR, a glossary, or a navigation guide? → Keep it and update it.
  3. Does this doc exist because the code is unclear? → The correct fix is a better name, a smaller module, or a docstring. Recommend that fix in the summary. Do not change unrelated source code in a docs pass.
  4. Does this doc repeat CLAUDE.md? → CLAUDE.md wins. Delete the doc.

Judge a doc by its content, never by its metadata. A doc with no kind field needs a kind value. The doc does not need deletion.

Two examples

Deleted. docs/auth-flow.md says: "The login endpoint accepts email and password, calls verify_password(), then issues a JWT with a 24h expiry." Every sentence repeats auth/login.py, and the expiry is already wrong. The expiry is 1h now. The doc holds no decision, no term, and no pointer. Delete the file. The code is the documentation.

Kept and trimmed. docs/adr-004-sessions.md covers the same subject with different content: "We chose stateless JWTs and not server-side sessions, because the API runs on ephemeral workers with no shared store. The cost: we cannot revoke a token before it expires, so the expiry is short." That reason is in no source file. Keep the doc. If the ADR also shows the token payload as code, delete the code and keep the argument.

Phase 1: Detect

First find what changed. Then find what the change makes wrong.

Changed files. Run both commands. The usual case for this skill is a complete feature that nobody committed yet, and git diff alone finds nothing:

git diff origin/main...HEAD --name-only   # committed on this branch
git status --porcelain                    # staged, unstaged, untracked

On main, or if origin/main does not exist, run git diff HEAD~5 --name-only instead. Tell the user, because 5 commits is a guess. Use a wider range if the work is older.

Affected docs. Read the frontmatter of each docs/**/*.md file in full, from the opening --- to the closing ---. A related_files list often holds 20 paths or more. A truncated read misses matches and gives no warning. Match the changed paths against related_files. Match the directory entries also.

Most repositories do not use this frontmatter yet. If a doc has no related_files, or if no doc in the repository has it, do not report that there is no work. Read the docs and match them by content: module names, symbol names, paths, and commands in the prose. A first run on a repository with no frontmatter gives a long backfill list. This result is correct. The skill adds the convention on the first run.

Then apply the delete-first checklist to each matched doc.

Scale the work to the size of the repository. For 20 docs or fewer, read them yourself. For more, give each subagent one part of docs/ and ask for the same four lists. The docs are independent, and you do not need their content in your context.

Report four lists. Omit an empty list. If all four lists are empty, tell the user and stop.

  • update — the path, and one line on why the change made the doc wrong
  • delete — the path (or the path and the section), and which checklist question the doc failed
  • create — only for a real decision, a new term, or a gap in the navigation guide. Never to describe behavior.
  • backfill — the path, and which frontmatter fields are absent or invalid

Phase 2: Apply

Warning: A deletion is the one step that the user cannot undo from your summary. Show the delete list and get confirmation before you delete anything.

Delete:

  1. Search the repository for links to the doc, docs/CLAUDE.md included.
  2. Delete the file, or delete the section.
  3. Delete the entry in docs/CLAUDE.md.

Update:

  1. Read the full doc and the changed code.
  2. Delete what a reader can get from the source. Keep the decisions, the terms, and the pointers.
  3. Update related_files.
  4. Keep the style of the doc.

Backfill: Add name, description, kind, and related_files from the content of the doc. kind must be adr, glossary, or navigation. A doc that fits none of the three goes on the delete list.

Create: Write the frontmatter below, then add an entry to docs/CLAUDE.md.

---
name: Short name
description: One line on what this doc covers and when to read it.
kind: adr | glossary | navigation
related_files:
  - path/to/file.py
  - path/to/directory/
---

End with a summary: what you deleted, what you updated, what you created, and why. A deleted stale doc is a better result than an updated one. Say this, so the user sees that docs/ gets smaller on purpose.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.