Skip to content
Back to skills

Document Function

ASecurity

Writes a docstring for the selected function in your language and style: inputs, return value, errors raised and a working example.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentspythonrustgojava

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill document-function --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Document Function?

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

Security grade badge for Document Function
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-document-function/badge)](https://www.skillsdirectory.com/skills/workspace-templates-document-function)

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: document-function
description: "Writes a docstring for the selected function in your language and style: inputs, return value, errors raised and a working example."
argument-hint: "[function name or file:line]"
user-invocable: true
disable-model-invocation: true
---

Write a docstring for the function: $ARGUMENTS (a name, or the code selected in the editor).

1. Find the function and read its full body. Then search for two or three callers to see how it is really used and what values are passed.
2. Detect the comment style from the surrounding files: JSDoc or TSDoc, Python Google or NumPy style, Javadoc, Rust `///`, Go doc comments. Copy that format exactly.
3. Write a first line that says what the function does in one imperative sentence, not its name repeated.
4. Document every parameter with its type, units and allowed range, and mention defaults and whether null or empty values are accepted.
5. Document the return value, including shape when it is an object, and side effects such as writes, network calls or mutation of arguments.
6. List each error or exception it can raise or return, and the condition that causes it. Read the body to find them; do not guess.
7. Add a short example that really works with the current signature.

Change comments only, never code. Show the new docstring and ask before inserting it.

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.