Skip to content
Skills Library
Programming · Review & audit

writing-docstrings

/writing-docstrings

Use when writing, rewriting, or auditing Python docstrings that a documentation site is generated from, or when docstrings are long, narrate the code, or leave a reader of the generated reference unable to find their way. Triggers - "audit the docstrings", "docstring slop", "docstrings as documentation", "the API reference reads badly", "rewrite these docstrings".

Repository
skills ↗
Licence
CC0-1.0
Last repository change
20.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 20.10.2026, without references to retired models or APIs.

Licence

CC0-1.0, otwarta.

What it does and when to use it

Use when writing, rewriting, or auditing Python docstrings that a documentation site is generated from, or when docstrings are long, narrate the code, or leave a reader of the generated reference unable to find their way. Triggers - "audit the docstrings", "docstring slop", "docstrings as documentation", "the API reference reads badly", "rewrite these docstrings".

Triggers from the description

audit the docstringsdocstring slopdocstrings as documentationthe API reference reads badlyrewrite these docstrings
Original author description

Use when writing, rewriting, or auditing Python docstrings that a documentation site is generated from, or when docstrings are long, narrate the code, or leave a reader of the generated reference unable to find their way. Triggers - "audit the docstrings", "docstring slop", "docstrings as documentation", "the API reference reads badly", "rewrite these docstrings".

How it works

  1. When to Use
  2. When Not to Use
  3. Invocation Notice
  4. Workflow
  5. Output
  6. References
Original SKILL.md headings · 58 lines, 496 words
SKILL.md preview
---
name: writing-docstrings
description: Use when writing, rewriting, or auditing Python docstrings that a documentation site is generated from, or when docstrings are long, narrate the code, or leave a reader of the generated reference unable to find their way. Triggers - "audit the docstrings", "docstring slop", "docstrings as documentation", "the API reference reads badly", "rewrite these docstrings".
---

# Writing Docstrings

Docstrings that a site is generated from are the product's documentation.
Each one states what a reader needs, in a fixed place, in plain language.

## When to Use

- A documentation site (great-docs, quartodoc, mkdocstrings, Sphinx autodoc) renders the package's docstrings.
- An audit of docstrings for length, body narration, rationale, history, or vague wording.
- A rewrite of docstrings after an API change, where the reference must stay accurate.
- A new public function, class, or module needs a docstring that matches the rest.

## When Not to Use

- Comments inside a body, or slop in code: use `simplify`.
- Narrative documentation pages, tutorials, or a docs site built from prose: use `scaffold-docs`.
- Commit messages: use `commit-message`.

## Invocation Notice

- Tell the user when this skill is running: `writing-docstrings`.
  Skip the notice when the user asked for the skill by name or slash command; spelling and spacing need not match.
  A phrase from this skill's own trigger list is not a name — naming the work is not naming the skill.

## Workflow

1. Find what the site renders.
   Read the docs configuration for the parser and for the objects that get pages.
   A docstring of an object without a page is a maintainer note, not documentation.
   When the configuration does not settle it, probe the renderer with a throwaway package (`references/renderer-probe.md`).
2. Classify each docstring by level: landing page, module page, class, function or method, or not rendered.
   The level sets the register and the shape (`references/shape.md`).
3. Calibrate with the user before any bulk edit.
   Bring three docstrings at a time, of different levels or kinds.
   For each, quote it, give a verdict, name what fails, and show the rewrite.
   Use length only as a first filter: a long docstring can be all contract, and a short one can be too dense to read.
   Continue until the user agrees with the verdicts.
4. Write or rewrite to the shape and the register (`references/register.md`).
   Verify every fact against the code before you state it; read the body, the tests, or run it.
   Add a missing contract fact, such as a default or an error, when a reader needs it.
5. For more than about 30 docstrings, run the work in parallel with separate review sweeps (`references/parallel-run.md`).
6. Rebuild the site, or the renderer probe, and check that sections, links, and examples render.

## Output

- Rewritten docstrings, each true against the code and placed in the shape for its level.
- Body comments for rationale that guards against a wrong fix; other rationale deleted.
- Documentation-site configuration changes, when module pages or sections need them.

## References

- `references/shape.md`: the labeled sections and the shape for each level.
- `references/register.md`: reference and explanation registers, plain language, and what to keep and cut.
- `references/examples.md`: calibrated before-and-after examples.
- `references/renderer-probe.md`: how to check what a renderer does with a docstring.
- `references/parallel-run.md`: writer brief, batching, and review sweeps.
Files in this package (6)
  • SKILL.md 3 KB
  • references/examples.md 6 KB
  • references/parallel-run.md 2 KB
  • references/register.md 3 KB
  • references/renderer-probe.md 2 KB
  • references/shape.md 3 KB

Versions

The database has no other skills named writing-docstrings.

Database snapshot: 13.11.2026 · package version d50eb9ab918f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100write-docstrings
    Writes and reviews docstrings in this repo. Use when writing new docstrings, reviewing existing docstrings, or editing docstrings.
  • 95docstring
    Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
  • 100documentation-generation
    Generates project documentation including READMEs, docstrings (JSDoc, JavaDoc, Python docstrings), OpenAPI prose, and CI/CD doc pipelines. Use when asked to generate docs, write docstrings, automate documentation, or create README files.
  • 95documenting-python-libraries
    Creates comprehensive Python library documentation including Google-style docstrings, Sphinx setup, API references, tutorials, and ReadTheDocs configuration. Use when writing docstrings, setting up Sphinx documentation, or creating user guides for Python libraries.
  • 100numpy-docstrings
    Write and review NumPy-style (numpydoc) docstrings for Python public APIs. Covers section order, semantics (what belongs in docstrings vs types vs tests), anti-patterns (comment soup, stub docs, wrong style), Parameters, Returns, Yields, Raises, See Also, Notes, References,…
  • 100document-code
    Apply Google Style documentation standards to Python, Go, TypeScript, and Terraform code. Use when writing or reviewing code that needs docstrings/comments/JSDoc, when asked to "document this code", "add docstrings", "follow Google Style", or when improving code documentation…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.