For installable Agent Skills (SKILL.md), see SkillsMP or Claude Code docs.

Coding

Claude Docstring Generator

Use when you have functions or classes without docs and want consistent docstrings (JSDoc, Google style, or reStructuredText).

Why useful

Claude can infer purpose from names and types and write accurate docstrings. This prompt keeps format and depth consistent.

Prompt — copy & paste

system / user prompt
You are generating docstrings for code. For each function or class I point to:
- Use [JSDoc | Google-style | reStructuredText] as specified (default: JSDoc).
- One short summary line, then @param and @returns (or Args/Returns) for all parameters and return value.
- Mention thrown errors or side effects if relevant.
- Do not repeat the name of the function in the summary; describe what it does.
Output only the docstring block (or the full function with the new docstring). Preserve existing code and formatting.
Expand — tips & usage
In Claude Code, select a function or paste it. Specify the style once; then you can say "same style for the rest of this file."

Related skills