Agent skill

Docstring

by pytorch in pytorch/pytorch

Write docstrings for PyTorch functions and methods following PyTorch conventions.

Custom licenceAuto-check passedAI & LLM Engineering

Install Docstring

skills CLI
$ npx skills add pytorch/pytorch --skill docstring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pytorch/pytorch docstring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pytorch/pytorch.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/docstring .claude/skills/docstring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docstring
GitHub stars
104k
Used in
2 other repos
Token cost
~2.6k tokens
SKILL.md length
567 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Custom licence

At a glance

Write docstrings for PyTorch functions and methods following PyTorch conventions.

  • Works in 10 steps: Function Signature (First Line) → Brief Description → Mathematical Formulas (if applicable) → …
  • Updating docstrings in PyTorch code
  • SKILL.md covers General Principles, Docstring Structure, Method Types and Common Patterns, plus 4 more sections
  • Reaches arxiv.org

What it does

Docstring is an agent skill from pytorch/pytorch. Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Technical documentation and Deep learning. It works with PyTorch. The repository describes itself as: Tensors and Dynamic neural networks in Python with strong GPU acceleration.

When your agent uses it

  • Updating docstrings in PyTorch code
  • Tasks that involve Technical documentation
  • Tasks that involve Deep learning

Example prompts

  • “/docstring”

Requirements

  • Python 3

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Function Signature (First Line)
  2. Brief Description
  3. Mathematical Formulas (if applicable)
  4. Cross-References
  5. Notes and Warnings
  6. Args Section
  7. Keyword Args Section (if applicable)
  8. Returns Section (if needed)
  9. Examples Section
  10. External References

What it can do on your machine

Read from SKILL.md and the folder at commit 84af535. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • arxiv.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Docstring loads about 2.6k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 567 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 567 words (~2,555 tokens).

“This skill describes how to write docstrings for functions and methods in the PyTorch project, following the conventions in torch/_tensor_docs.py and torch/nn/functional.py.”

— opening of SKILL.md by pytorch, Custom licence
name
docstring

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/docstring of pytorch/pytorch.

Open the folder on GitHubat commit 84af535

Used in 2 other repositories

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in pytorch/pytorch, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Docstring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Docstring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Docstring this skillpytorch/pytorch104k2 repos~2.6kAutomated safety check: PassCustom licence
Ascendcascend-ai-coding/awesome-ascend-skills174—~3.5kAutomated safety check: PassNone
AI Research Reproductionlllllllama/RigorPilot-Skills4971 repos~1.8kAutomated safety check: PassMIT
ExecuTorch Cortex-M Backendpytorch/executorch5.1k—~872Automated safety check: PassCustom licence
Qualcomm QNN Backend Developmentpytorch/executorch5.1k—~1.8kAutomated safety check: PassCustom licence
Formattingbrendanhasz/probflow175—~381Automated safety check: PassMIT

Similar skills

  • Ascendc

    ascend-ai-coding/awesome-ascend-skills

    End-to-end AscendC custom operator development for Ascend NPU in an ascend-kernel (csrc/ops + build.sh + torchnpu PyTorch custom op) project.

    174 GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • AI Research Reproduction

    lllllllama/RigorPilot-Skills

    Rigor Reproduce compatible skill slug for README-first deep learning repository reproduction.

    497 GitHub starsUsed in 1 repo~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • ExecuTorch Cortex-M Backend

    pytorch/executorch

    Developer guide for the Cortex-M (CMSIS-NN) backend in ExecuTorch: quantization pipeline, pass manager, tests and adding new ops.

    5.1k GitHub stars~872 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Helps build, test and extend the Qualcomm AI Engine Direct (QNN) backend in ExecuTorch, with routes for new ops, model export, Buck-vs-CMake parity fixes and per-layer accuracy debugging.

    5.1k GitHub stars~1.8k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Formatting

    brendanhasz/probflow

    Ensure consistent code formatting using the uv package manager and pre-commit.

    175 GitHub stars~381 tokensUpdated 11 days ago
    AI & LLM EngineeringAuto-check passed
  • Xpu CI Health Check

    intel/torch-xpu-ops

    Official

    Check PyTorch ciflow/xpu (xpu.yml) on the main branch, collect the failing XPU test cases from the most recent completed run(s), analyze the ROOT CAUSE of each failure with AI, and produce a list…

    115 GitHub stars~1.5k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from pytorch/pytorch

All 16 skills in this repo
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • CI Metrics

    pytorch/pytorch

    Query PyTorch CI, GitHub Actions, HUD, Grafana, and infrastructure metrics.

    104k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Cuda Index Width

    pytorch/pytorch

    Choose 32-bit vs 64-bit index math in PyTorch CUDA kernels. An agent skill from pytorch/pytorch.

    104k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Document Public APIs

    pytorch/pytorch

    Document undocumented public APIs in PyTorch by removing functions from coverageignorefunctions and coverageignoreclasses in docs/source/conf.py, running Sphinx coverage, and adding the appropriate…

    104k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Fix Issue

    pytorch/pytorch

    Fix bugs reported in PyTorch GitHub issues by reproducing, root-causing, and implementing a fix in the local working tree.

    104k GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Works with

Questions about Docstring

What does Docstring do?

Write docstrings for PyTorch functions and methods following PyTorch conventions. Docstring is an agent skill from pytorch/pytorch. Write docstrings for PyTorch functions and methods following PyTorch conventions.

When should I use Docstring?

Docstring fits situations like: updating docstrings in PyTorch code; tasks that involve Technical documentation; tasks that involve Deep learning.

How do I install Docstring in Claude Code?

Run `npx skills add pytorch/pytorch --skill docstring -a claude-code`. Or copy the skill folder (.agents/skills/docstring in pytorch/pytorch) into .claude/skills/docstring in your project. Claude Code loads it when a task matches its description.

How do I install Docstring in Codex?

Run `npx skills add pytorch/pytorch --skill docstring -a codex`. Or copy the skill folder (.agents/skills/docstring in pytorch/pytorch) into .agents/skills/docstring in your project. Codex loads it when a task matches its description.

Can I use Docstring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pytorch/pytorch --skill docstring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docstring, .gemini/skills/docstring, .github/skills/docstring and .opencode/skills/docstring in your project.

What does Docstring need to run?

SKILL.md names no scripts, command-line tools or credentials: Docstring is instructions for the agent only. Our summary lists: Python 3.

Does Docstring access the network?

SKILL.md names 1 domain. In commands or code: arxiv.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Docstring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Docstring use?

Docstring has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Docstring use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Docstring?

Skills that share tags, products or a category with Docstring: Ascendc (ascend-ai-coding/awesome-ascend-skills, 174 stars), AI Research Reproduction (lllllllama/RigorPilot-Skills, 497 stars), ExecuTorch Cortex-M Backend (pytorch/executorch, 5.1k stars) and Qualcomm QNN Backend Development (pytorch/executorch, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Docstring?

pytorch (a GitHub organization) maintains it in pytorch/pytorch, which has 103,819 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 7, 2026.

Source: pytorch/pytorch on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.