Helps write standardized, Sphinx-compliant docstrings for PyTorch-based functions and classes.

Install

mkdir -p .claude/skills/docstring && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/80" && unzip -o skill.zip -d .claude/skills/docstring && rm skill.zip

Installs to .claude/skills/docstring

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
138 chars✓ has a “when” trigger
Beginner

Key capabilities

  • →Write docstrings for PyTorch functions
  • →Write docstrings for PyTorch methods
  • →Follow PyTorch conventions for docstrings
  • →Include function signatures in docstrings
  • →Add mathematical formulas using Sphinx math directives
  • →Link to related classes and functions using Sphinx roles

How it works

This skill guides the creation of docstrings for PyTorch functions and methods by detailing the required structure, formatting rules, and content elements such as function signatures, brief descriptions, mathematical formulas, and cross-references.

Inputs & outputs

You give it
PyTorch function or method code
You get back
Docstring following PyTorch conventions

When to use docstring

  • →Documenting new custom PyTorch operations
  • →Updating existing codebases to match PyTorch documentation style
  • →Adding LaTeX math formulas to function docstrings
  • →Generating consistent parameter and return type annotations

About docstring

Enforces PyTorch-specific documentation standards, including parameter definitions, return types, mathematical formatting with LaTeX, and cross-referencing to library components.

Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.

How it compares

This skill provides specific PyTorch docstring conventions, including raw strings and Sphinx/reStructuredText format, unlike generic documentation practices.

Compared to similar skills

docstring side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
docstring (this skill)81yNo flagsBeginner
hugging-face-paper-publisher610moReviewIntermediate
acestep-docs18moNo flagsBeginner
mlops-collaboration110moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry