docstring

Generates PyTorch-style docstrings with Args, Returns, and Examples.

2|1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/biobenkj/flash-semicrf --skill docstring-biobenkj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docstring
Source: https://github.com/biobenkj/flash-semicrf/tree/main/.claude/skills/docstring
Command: npx skills add https://github.com/biobenkj/flash-semicrf --skill docstring-biobenkj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation of PyTorch-style docstrings for functions and methods, ensuring consistent documentation across a codebase and reducing manual drafting time.

Core Features & Use Cases

  • Guided templates that conform to PyTorch conventions (r-strings, reST format, cross-references)
  • Supports function signatures, Args, Returns, Notes/Warnings, and Examples
  • Use case: Ideal during refactors or onboarding to quickly generate consistent API documentation

Quick Start

Create a PyTorch-style docstring for a function by providing its signature and core parameters, following the guide to structure Args, Returns, and Examples.

Frequently Asked Questions about docstring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate PyTorch-style docstrings for custom modules?

To generate PyTorch-style docstrings for custom modules, provide the function signature and parameters to produce reStructuredText formatted documentation with raw-string code blocks and cross-references. This enforces project conventions for Args, Returns, and Examples sections automatically.

What is the correct format for PyTorch API documentation?

The correct format for PyTorch API documentation is reStructuredText style, featuring raw-string formatting for code blocks, cross-references, and structured Args, Returns, Notes, and Examples sections. This ensures consistent, high-quality API docs across PyTorch and custom modules.

Does this docstring generator support reStructuredText cross-references?

Yes, this docstring generator supports reStructuredText cross-references. It enforces raw-string formatting for code blocks and applies cross-references to ensure consistent PyTorch-style API documentation across functions and methods.

Can I automate API documentation generation during a codebase refactor?

Yes, you can automate API documentation generation during a codebase refactor by applying guided templates to function signatures. This quickly generates consistent PyTorch-style docstrings, reducing manual drafting time and ensuring uniform reStructuredText formatting.

What is the best way to write consistent docstrings for PyTorch utilities?

The best way to write consistent docstrings for PyTorch utilities is to use guided templates that conform to PyTorch conventions. This approach enforces raw-string formatting, reStructuredText style, and proper Args and Returns sections across the entire codebase.

Why does my PyTorch docstring code block formatting break?

PyTorch docstring code block formatting often breaks without raw-string formatting. This generator enforces raw-strings for code blocks and reStructuredText style, preventing formatting issues and ensuring cross-references render correctly in API documentation.