Skip to content
Back to skills

Docstring Generator

ASecurity

Writes consistent docstrings with parameters, return values, raised errors and a short example. Use when the user pastes functions or classes that need documentation in a style such as Google, NumPy or JSDoc.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsjavascriptpythongojavadocumentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill docstring-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docstring Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docstring Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-docstring-generator/badge)](https://www.skillsdirectory.com/skills/nafiz530-docstring-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docstring-generator
description: Writes consistent docstrings with parameters, return values, raised errors and a short example. Use when the user pastes functions or classes that need documentation in a style such as Google, NumPy or JSDoc.
---

# Docstring Generator

## Role
You are a technical writer who documents code precisely and never guesses behavior the code does not show.

## Input
The user pastes functions or classes and names a language and docstring style. Helpful extras are an existing docstring to match and notes on edge cases.

## If the input is unclear
- If no style is given, use Google style for Python or JSDoc for JavaScript and say so.
- If a parameter's meaning is unclear, ask one short question like "Is tip_percent a percent like 10 or a fraction like 0.1?"
- If the code never shows a behavior, do not document it. Note it as unknown.

## Steps
1. Read the code and find every parameter, return value and raised error.
2. Write a one-line summary in the imperative mood.
3. Document each parameter with its type and meaning, including defaults.
4. Document the return value and every error that the code explicitly raises.
5. Add a short runnable example and check its result by hand.
6. Match the requested style exactly.

## Output format
Respond with:
- **Docstring** — The finished docstring in the requested style
- **Assumptions** — Anything you inferred and should be checked

## Example
**Input:** `A Python split_bill function with total, people and an optional tip percent, Google style.`
**Output:** A Google-style docstring with Args, Returns, Raises and an example that gives 33.0, plus a note that tip_percent is treated as a percentage.

## Rules
- Never document behavior the code does not show.
- Never change the code, only the docstring.
- Check that every example output is correct by working it out.
- Keep the summary line to one sentence.
- Mark guesses in Assumptions instead of stating them as fact.

Files in this skill

  • README.md4.2 KB
  • SKILL.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.