code-documentation
Skill9 starsChanged 5 months agoMITView on GitHub
How to explain source code, generate inline comments, write Markdown documentation, summarize a file, or improve variable/function names — for JavaScript, TypeScript, Python, Java, C++, and Dart. Use this skill whenever the user asks what code does, wants it explained, wants comments or docs generated, wants a file summarized, or wants naming improved. Always preserve program logic exactly and never invent functionality not present in the code.
13 other projects use a version of this.
Adopted by
Most recently taken up by
- gilsmt/skillstheir own version, first seen Oct 4, 2026
- velonx/agent-skillstheir own version, first seen Sep 24, 2026
- Suuunboy/code-documentation-skilltheir own version, first seen Sep 22, 2026
- gspencergoog/skillstheir own version, first seen Sep 8, 2026
- lexicalninja/my-little-scrum-teamtheir own version, first seen Jul 26, 2026
- CreamyLong/quilltheir own version, first seen Jul 16, 2026
Used with
Projects with it also use data-analysis, changelog-generator and 2 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.
shanggqmSkilldata-analysis
数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。
Also in 3 projects that use this
ArogyaReddySkillchangelog-generator
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Also in 3 projects that use this
VercelSkillweb-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- bytedance/deer-flow★ 83ksame name
- MoizIbnYousaf/ai-agent-skills★ 1.1ksame name
- myths-labs/muse★ 35same name
- Jonathan0823/opencode-config★ 8same name
- CreamyLong/quill★ 2same name
- gilsmt/skills★ 2same name
- gspencergoog/skills★ 2same name
- lexicalninja/my-little-scrum-team★ 2same name
- Suuunboy/code-documentation-skill★ 2same name
- velonx/agent-skills★ 1same name
3 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.
- CLAUDE.mdCLAUDE.md
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
10
Distinctive
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 12
Preserve logic: Never change what the code does.
- Distinctive: line 13
Don't hallucinate: Only describe behavior, parameters, return values, or edge cases that are actually present in the code shown.
- Distinctive: line 15
Keep every response concise — this is reference material for a working developer, not a tutorial.
- Distinctive: line 26
Keep the whole explanation under ~200 words unless the user asks for more detail.
- Distinctive: line 32
Use the target language's normal comment convention:
- Distinctive: line 39
Do not reformat, rename, reorder, or "clean up" the code while adding comments.
- Distinctive: line 46
Use exactly these sections, omitting any that don't apply:
- Distinctive: line 52
If a parameter's type isn't annotated and can't be inferred from usage, write "not specified" rather than guessing.
- Distinctive: line 63
If the file's role in the broader project isn't clear from the file alone, say so rather than inventing a narrative.
- Very specific: line 76
Only include names that are actually ambiguous, misleading, or too generic (data, temp, x, flag, handleClick2).
- Distinctive: line 78
Do not suggest a rename that would require changing the function's public signature/API unless the user has indicated that's acceptable.
“Common” is measured: kept by at least 6 in 10 of the 11 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
Code Documentation
Five related but distinct tasks for helping a developer understand and document their own code. Pick the one the request maps to — don't blend them (e.g. don't add a naming table when the user only asked for an explanation).
Two rules apply to every task below:
- Preserve logic. Never change what the code does. Comments, renames, and docs describe behavior — they don't alter it.
- Don't hallucinate. Only describe behavior, parameters, return values, or edge cases that are actually present in the code shown. If something is ambiguous or determined elsewhere (e.g. an imported function's internals), say it's out of scope rather than guessing.
Keep every response concise — this is reference material for a working developer, not a tutorial.
1. Explain Code
Goal: help someone unfamiliar with the code understand it quickly.
Structure the explanation as:
- Purpose — one to two sentences on what the code is for
- Step-by-step behavior — in the order execution actually happens, not the order it's written if they differ (e.g. hoisted functions, async callbacks)
- Inputs and outputs — parameters, return values, side effects (network calls, file writes, mutations), if any
Keep the whole explanation under ~200 words unless the user asks for more detail. Do not suggest improvements or point out bugs unless asked — this task is descriptive, not evaluative.
2. Generate Comments
Goal: add inline comments that help a future reader, without touching logic.
- Use the target language's normal comment convention:
- JavaScript / TypeScript:
//for lines,/** */(JSDoc) for functions - Python:
#for lines,"""docstring"""for functions/classes - Java:
//for lines,/** */(Javadoc) for methods/classes - C++:
//for lines,/** */for functions/classes - Dart:
//for lines,///(doc comments) for public members
- JavaScript / TypeScript:
- Comment the why or non-obvious what — skip comments on lines that are already self-explanatory (
i++, simple assignments). - Do not reformat, rename, reorder, or "clean up" the code while adding comments. The diff should be comments only.
- Return the full code in one code block, with nothing else around it (no preamble, no explanation) unless the user asks for one.
3. Generate Documentation
Goal: produce Markdown reference documentation for a function, class, or file.
Use exactly these sections, omitting any that don't apply:
- Purpose — what it does and why it exists, briefly
- Parameters — name, type (if determinable), and description for each
- Returns — type and description of the return value
- Example usage — a short, realistic call site
If a parameter's type isn't annotated and can't be inferred from usage, write "not specified" rather than guessing. Don't add a "Throws/Errors" section unless the code actually throws or the language's error handling is visible in the snippet.
4. Summarize File
Goal: a short, high-level orientation to an entire file — not a line-by-line walkthrough.
Write 3–5 sentences covering:
- What the file does overall
- Its key exports, functions, or classes (name-drop the important ones, not every helper)
- How it likely fits into a larger codebase (e.g. "this is a React hook consumed by form components", "this is an Express route handler")
If the file's role in the broader project isn't clear from the file alone, say so rather than inventing a narrative.
5. Improve Variable and Function Names
Goal: flag genuinely unclear names and suggest better ones — without renaming for style preference alone.
Return a Markdown table:
| Original | Suggested | Reason |
d | elapsedDays | Single-letter name gives no indication of what it holds |
Rules:
- Only include names that are actually ambiguous, misleading, or too generic (
data,temp,x,flag,handleClick2). If every name in the snippet is already clear, say so — don't force a table with weak suggestions. - Suggested names must not collide with existing identifiers in the same scope.
- Do not suggest a rename that would require changing the function's public signature/API unless the user has indicated that's acceptable.
- This task never changes logic — it's a table of suggestions, not an edited file, unless the user explicitly asks you to apply the renames.
Language coverage
These instructions apply uniformly across JavaScript, TypeScript, Python, Java, C++, and Dart. Adjust only:
- Comment/docstring syntax (see Task 2)
- Type reporting in documentation — include types for statically-typed languages (TypeScript, Java, C++, Dart) when visible; note "dynamically typed, inferred from usage" for plain JavaScript/Python where no annotation exists
- Idiomatic naming style (e.g.
camelCasefor JS/TS/Java/Dart,snake_casefor Python)
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.

