agentleFS
LWaetzigLWaetzig/claude-code-skills/skills/python-documentation/SKILL.md

code-documentation

Skill0 starsChanged 8 months agoMITView on GitHub

Generates and improves code documentation for Python projects. Use this skill whenever the user asks to document code, add docstrings, add type hints,

13 other projects use a version of this.

Adopted by

Most recently taken up by

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.
  • shanggqmSkill

    data-analysis

    数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。

    Also in 3 projects that use this

  • ArogyaReddySkill

    changelog-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

  • VercelSkill

    web-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

  • GoogleSkill

    code-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

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create clear, concise, and informative, accurate, idiomatic, and useful documentation — not boilerplate.

    line 12
  2. Distinctive:

    Before writing anything, scan the existing code and any existing docs to detect:

    line 18
  3. Distinctive:

    If no style exists, default to Google style docstrings.

    line 25
  4. Distinctive:

    Ask or infer which documentation type(s) are needed.

    line 34
  5. Very specific:

    Document intent, not mechanics: If the code says i += 1, don't write # increment i.

    line 51
  6. Distinctive:

    Keep it current: If you see a comment that contradicts the code, fix the comment.

    line 52
  7. Distinctive:

    Be consistent: Use the same style, tense, and voice throughout a file.

    line 55
  8. Very specific:

    Only include sections that apply — don't add empty Raises: if nothing is raised.

    line 68
  9. Distinctive:

    Never output just the docstring in isolation — always show it in context.

    line 75
  10. Distinctive:

    After completing documentation, offer at least one relevant next step, e.g.:

    line 82

“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.

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

Code Documentation Skill

Create clear, concise, and informative, accurate, idiomatic, and useful documentation — not boilerplate. Every piece of documentation you write should help the next developer understand why, not just what.


Step 1: Detect Context and Scope

Before writing anything, scan the existing code and any existing docs to detect:

  1. Style already in use — check for: Google style, NumPy/Sphinx style, reStructuredText, or no style
  2. Existing doc coverage — are some things documented? Mimic that style exactly.
  3. Project type — library/package, application, CLI tool, API server, etc.
  4. Audience — internal tool vs public-facing API (affects verbosity)

If no style exists, default to Google style docstrings.

Always announce your detected style to the user before writing, e.g.:

"I can see you're using Google-style docstrings — I'll match that throughout."


Step 2: Determine Scope

Ask or infer which documentation type(s) are needed. See the full guidance in:

  • references/inline-docs.md — docstrings and inline comments
  • references/readme-and-api.md — README files and API reference docs
  • references/architecture.md — high-level architecture and design docs

For multi-type requests (e.g. "document this whole project"), tackle in this order:

  1. Inline docs first (they inform everything else)
  2. API reference
  3. README
  4. Architecture doc

Step 3: Write Documentation

Universal rules (apply to all doc types)

  • Document intent, not mechanics. If the code says i += 1, don't write # increment i.
  • Keep it current. If you see a comment that contradicts the code, fix the comment.
  • Don't over-document. Private helpers and obvious one-liners rarely need docs. Focus effort on: public APIs, complex logic, non-obvious side effects, error conditions.
  • Be consistent. Use the same style, tense, and voice throughout a file.
  • Examples > prose for complex APIs. A 3-line usage example beats a paragraph of explanation.

What to always include in function/method docs

ElementPython (Google)
One-line summaryFirst line of docstring
ParametersArgs: block
Return valueReturns: block
Exceptions/errorsRaises: block
Usage exampleExample: block

Only include sections that apply — don't add empty Raises: if nothing is raised.


Step 4: Output Format

  • Inline docs: Output the full modified file (or clearly-delimited diff if file is large). Never output just the docstring in isolation — always show it in context.
  • README: Output as Markdown. See references/readme-and-api.md for structure.
  • API reference: Output as Markdown table or structured Markdown. See references/readme-and-api.md.
  • Architecture doc: Output as Markdown with diagrams (Mermaid) where helpful. See references/architecture.md.

Step 5: Offer Follow-ups

After completing documentation, offer at least one relevant next step, e.g.:

  • "Want me to generate an API reference from these docstrings?"
  • "Should I write a README for this module next?"
  • "Want me to add usage examples to the more complex functions?"

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.