code-docs
Skill2 starsChanged 4 days agoMITView on GitHub
Documents a codebase so people and coding agents can find their way around it - a file map, how the parts fit together, the logic that is not obvious from the code, reference docstrings, and comments that are short, correct and useful. Learns the project's existing documentation system first and extends it; never imposes a template. Moves long comment blocks into doc files and leaves a pointer; never deletes information. Use when the user asks to document code, write or update docs, add a file map or architecture notes, fix or organise comments or docstrings, check whether docs are out of date, or types /code-docs or /anti-slopware docs.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- rupertsworld/skillstheir own version, first seen Oct 13, 2026
- codyrao/agent-skillstheir own version, first seen Jan 31, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- codyrao/agent-skills★ 1same name
- rupertsworld/skills★ 1same 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 repository9 other files it gives its agents.
- anti-slopwareSkill
- dep-checkSkill
- error-slopSkill
- junk-sweepSkill
- organizeSkill
- review-mapSkill
- slim-prSkill
- split-prSkill
- test-slopSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Do this before judging anything.
- Distinctive: line 64
Keep: every comment that carries something the code does not: why, a constraint, a unit, a warning, an example, a link to an issue.
- Distinctive: line 66
Wrong or stale comment: check it against the code.
- Distinctive: line 80
Verify every statement against the code: Read the function before describing it.
- Distinctive: line 81
Never invent the why: If nothing states the reason for a decision (code, comments, commit messages, issues, existing docs), write what the …
- Distinctive: line 82
Document what is not obvious: Do not restate code in prose.
- Distinctive: line 87
Docs for agents: if the project keeps a file for coding agents, keep it short and make it point to the file map and the key docs.
- Distinctive: line 111
Run the project's tests and its docs build if it has one.
- Distinctive: line 113
Check every new pointer and link resolves, and every new page is in the navigation.
- Very specific: line 117
After organize moves files, update the file map and any doc that names the old path.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
code-docs
Code says what happens. Documentation says where things are, how they fit together and why they are the way they are. Without it, every reader, human or agent, has to rebuild that understanding from scratch, and a reviewer cannot tell an intended change from an accident.
Two rules shape everything here:
- The project's own documentation system is the standard. Learn it, extend it, improve it where it falls short. Never drop in a template.
- Never lose information. A comment is removed only when what it said now lives somewhere a reader will find it.
1. Read the request
| Argument | Meaning | Default |
report | Audit: what exists, what is missing, what is wrong. Change nothing. | on |
write | Make the changes, after showing the plan | off |
| a path | Folder, file or doc to work on | the code in the current changes |
all | The whole project, one area at a time | off |
This skill changes comments, docstrings and documentation files. It never changes what the code does.
2. Learn how this project documents itself
Do this before judging anything. Record what you find at the top of the plan.
- Where docs live:
README, adocs/folder, a wiki, a docs site, files beside the code. Which tool builds them (MkDocs, Sphinx, Docusaurus, TypeDoc, rustdoc, dartdoc) and its navigation file. - What kinds exist: overview, setup, file map or project layout, architecture, per-feature docs, decision records, how-to guides, reference, changelog, files written for coding agents (
AGENTS.md,CLAUDE.mdand similar). - Docstring and comment style: the convention in use (Google, NumPy, reST, JSDoc, Javadoc, XML docs, doc comments), how much the project comments, which language it writes in, its tone.
- Formats and names: heading style, file naming, how docs link to code and to each other, any front matter.
- How current it is: which docs match the code and which have drifted.
Then decide, for each thing you want to add, where this project would put it. A new page goes in the existing docs folder and into its navigation. A file map goes where the project already keeps one. Use the existing docstring style even if you prefer another.
No system at all: propose the smallest one that fits the project's size, and get agreement before creating it. A ten-file project needs a good README, not a docs site.
A system that falls short: say what is missing and propose the improvement inside the existing system.
3. The layers
Good documentation answers different questions at different depths. Check each layer; add only what is missing and worth having for this project.
| Layer | Answers | Typical home |
| File map | What lives where? Where do I start? | A "project layout" section or page |
| How it fits together | What are the main parts and how does data move between them? | An architecture or overview page |
| Logic | How does this non-obvious piece work, and why this way? | A page per feature or module, a decision record, or a docstring when a few lines cover it |
| Reference | What does this function, class or endpoint take and return? | Docstrings in the project's style |
| Comments | What must I know right here, on this line? | Short comments in the code |
| Running it | How do I set up, run and test? | README or a setup page |
A file map lists folders and important files with one line each on what they are for, names the entry points, and says where to add new things. It is not a directory listing.
4. Comments
Comments are part of the documentation. Organise them; do not strip them.
- Keep every comment that carries something the code does not: why, a constraint, a unit, a warning, an example, a link to an issue.
- Long explanation in the code (more than about ten lines): move the full text to a doc file in the project's docs, and leave a short comment that states the key point and points to it:
# Proration uses actual days in the year. See docs/billing.md#proration.Everything the long comment said must be in the doc. - Wrong or stale comment: check it against the code. If the code is clearly the truth, correct the comment. If you cannot tell which is right, do not guess: report it as a question.
- Comment that only repeats the code: improve it to say why, or fold it into the function's docstring. Remove it only if nothing would be lost.
- Scattered comments on one topic: gather them into one comment or docstring where the reader meets the topic first.
- Edit narration ("changed this to use the new API", "removed the old check"): that is history, and history belongs in the commit message. Remove it once you have checked it says nothing about the code as it is now.
Never touch:
- Directives a tool reads:
noqa,type: ignore,eslint-disable,pragma,fmt: off,go:generate,go:embed, build tags, shebang lines, encoding lines. - Licence and copyright headers.
TODO,FIXME,HACKandXXXnotes. List them in the report.- Commented-out code. That is dead code, not documentation; the
anti-slopwareskill handles it.
5. Rules for what you write
- Verify every statement against the code. Read the function before describing it. Documentation that is wrong is worse than none.
- Never invent the why. If nothing states the reason for a decision (code, comments, commit messages, issues, existing docs), write what the code does and list the missing reason as a question for the user.
- Document what is not obvious. Do not restate code in prose. A page that says nothing a reader could not see in ten seconds should not exist.
- Point to code by path and name, never by line number. Line numbers rot.
- Every pointer must resolve. A comment that names a doc file or section must name one that exists.
- Historical records stay as written: decision records, changelog entries, release notes. Add a new one; do not rewrite an old one.
- Docstrings can be behaviour. A docstring used as command-line help, shown by an API, or containing a doctest is read by the program. Change it only with care, and run the doctests and the help output afterwards.
- Docs for agents: if the project keeps a file for coding agents, keep it short and make it point to the file map and the key docs. Create one only if the user asks.
6. Plan
code-docs: <project's system in one or two lines>
Missing:
- <layer>: <what>, to go in <where this project would put it>
Wrong or stale:
- <file>: says <x>, code does <y>
Comments to organise:
- <file>: <long block to move | scattered | repeats the code>
Questions (reasons nobody wrote down, or doc and code disagree and it is unclear which is right):
- <question>
Left alone: <what looks odd but follows the project's convention>With report, stop here.
7. Write (only with write, after the plan is shown)
Work one area at a time. After each:
- Run the project's tests and its docs build if it has one.
- Confirm no code changed: only comments, docstrings and documentation files differ.
- Check every new pointer and link resolves, and every new page is in the navigation.
8. Working with the other skills
- After
organizemoves files, update the file map and any doc that names the old path. anti-slopwareleaves comments alone. Comment work happens here.- In guard mode, new code is documented in the project's style as it is written, and a new file is added to the file map.
slim-prandreview-mapcan point reviewers to the pages this skill keeps current.
9. Report
code-docs: <files changed> files, <docs added> pages added, <docs updated> updated
Added: <page or docstrings>: <what it covers>
Corrected: <file>: <what was wrong>
Moved to docs: <comment block> -> <doc file>, pointer left at <file>
Questions for you: <list>
TODO and FIXME notes found: <n> (<files>)
Checks: <tests, docs build, doctests> <before> -> <after>
Code unchanged: <how you confirmed it>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.

