docstring

Generate reStructuredText docstrings for PyTorch functions and methods.

Updated Jan 13, 2026
One-click install
npx skills add https://github.com/shinnytech/caiwenqiang-member-rank --skill docstring-shinnytech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docstring
Source: https://github.com/shinnytech/caiwenqiang-member-rank/tree/main/.cursor/skills/docstring
Command: npx skills add https://github.com/shinnytech/caiwenqiang-member-rank --skill docstring-shinnytech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of high-quality docstrings for PyTorch functions and methods, ensuring consistency and adherence to project conventions.

Core Features & Use Cases

  • Standardized Docstrings: Generates docstrings following PyTorch's reStructuredText format.
  • Comprehensive Guidance: Covers function signatures, parameter descriptions, mathematical formulas, cross-references, notes, and examples.
  • Use Case: When developing a new PyTorch layer, use this Skill to quickly generate a well-formatted docstring that includes all necessary details about its parameters, return values, and usage examples.

Quick Start

Write a docstring for the provided PyTorch function, including its signature, arguments, and a brief description.

Frequently Asked Questions about docstring

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

FAQPage Schema
How do I generate PyTorch docstrings for custom functions?

Generate PyTorch docstrings by providing your function to automatically create standardized documentation. This includes function signatures, parameter descriptions, return types, mathematical formulas, cross-references, notes, and examples.

What is the standard format for PyTorch docstrings?

The standard format for PyTorch docstrings is reStructuredText. It uses raw strings for clarity and compatibility, ensuring comprehensive coverage of signatures, parameters, mathematical formulas, and examples.

How to document mathematical formulas and examples in PyTorch layers?

Document mathematical formulas and examples in PyTorch layers by generating a docstring that explicitly includes these sections. The generated reStructuredText ensures all necessary details about parameters and usage are covered.

Does this docstring generator support cross-references and notes?

Yes, this docstring generator supports cross-references and notes. It automates the creation of comprehensive documentation that covers signatures, parameters, return types, mathematical formulas, and examples.

Can I use reStructuredText for PyTorch function signatures and return types?

Yes, you can use reStructuredText for PyTorch function signatures and return types. The generated docstrings adhere to established PyTorch conventions using reStructuredText format and raw strings.

Why use raw strings in PyTorch docstrings?

Raw strings are used in PyTorch docstrings for clarity and compatibility. They ensure the reStructuredText format renders correctly without escaping issues across signatures, parameters, and examples.