Token导航 LogoToken导航

Agent Skill · 研究检索

document-public-apis(记录公共 API)

document-public-apis 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

document-public-apis 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 35,455。

总安装 2,081周安装 85GitHub Stars 99,535下载 666核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:document-public-apis(记录公共 API)
来源仓库:https://github.com/pytorch/pytorch
仓库路径:skills/document-public-apis
安装命令:
npx skills add https://github.com/pytorch/pytorch --skill document-public-apis
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pytorch/pytorch --skill document-public-apis

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

为 PyTorch 项目补充未记录公共 API 文档。通过 Sphinx autodoc 指令扩展文档覆盖率。仅修改文档源文件,不触碰 Python 源码。添加前必须验证函数是否在 doctree 白名单中。document-public-apis 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/document-public-apis

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/pytorch/pytorch --skill document-public-apis;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

document-public-apis 怎么安装?

在终端执行 npx skills add https://github.com/pytorch/pytorch --skill document-public-apis。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

document-public-apis 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

document-public-apis 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/pytorch/pytorch --skill document-public-apis 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

document-public-apis 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

document-public-apis 用的人多吗?

公开数据是累计安装 2,081 次,近一周安装 85 次,下载 666 次,GitHub 99,535 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

document-public-apis 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 99,535 星,维护活跃度相对可查。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
document-public-apis

记录公共 API · 本页

2,08199,535执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Document Public APIs

This skill documents undocumented public APIs in PyTorch by removing entries from the coverage ignore lists in docs/source/conf.py and adding Sphinx autodoc directives (e.g., autosummary, currentmodule, autoclass, automodule) to the corresponding .md or .rst doc source files in docs/source/.

"Documenting" means adding autodoc directives to doc source files — NEVER modifying Python source code. Do not add or edit docstrings in .py files. Your only job is to add the correct directive to the correct doc file.

IMPORTANT: Before adding any function to the sphinx doctree, verify it has a real docstring. Use a quick Python check (e.g., python -c "from torch.module import func; print(bool(func.__doc__))") to confirm the function has actual documentation content — not just an empty docstring or a bare .. warning:: This API is experimental stub. Functions without meaningful docstrings should be left in the coverage_ignore_functions/coverage_ignore_classes lists. Adding undocumented functions to the doctree creates empty or near-empty pages that degrade documentation quality.

Overview

docs/source/conf.py contains two lists that suppress Sphinx coverage warnings for undocumented APIs:

  • coverage_ignore_functions: undocumented functions
  • coverage_ignore_classes: undocumented classes

Entries are organized by module comment groups. Each group has a module label comment followed by the function/class names that belong to that module:

coverage_ignore_functions = [
    # torch.ao.quantization.fx.convert              <-- module label comment
    "convert",                                       # <-- entries belonging to this module
    "convert_custom_module",
    "convert_standalone_module",
    "convert_weighted_module",
    # torch.ao.quantization.fx.fuse                 <-- next module group
    "fuse",
    # torch.nn.functional
    "assert_int_or_pair",  # looks unintentionally public   <-- entry with inline comment
    "constant",  # deprecated                                <-- entry with inline comment
]

There are two kinds of comments:

  • Module label comments (# torch.ao.quantization.fx.convert): these label which module the entries below belong to. They appear on their own line before a group of entries.
  • Inline comments (# deprecated, # documented as adaptive_max_pool1d): these appear after a string entry on the same line and explain *why* the entry is in the ignore list.

The module label comment directly tells you:

  1. Which module the functions belong to
  2. Where to add them in the docs (e.g., # torch.ao.quantization.fx.convert → the functions go under torch.ao.quantization.fx.convert in the doc file)

Instructions

Each invocation of this skill processes one batch of module groups. Pick one or more complete module groups from the ignore lists, document their functions, and verify.

Step 1: Select module groups to document

Read docs/source/conf.py and select one or more complete module groups to document. A module group is a module label comment and all entries beneath it up to the next module label comment. Process entire groups — never split a group across batches.

For example, selecting the torch.ao.quantization.fx.convert group means taking all of:

# torch.ao.quantization.fx.convert
"convert",
"convert_custom_module",
"convert_standalone_module",
"convert_weighted_module",

Work through the lists top-to-bottom. Choose enough groups to make meaningful progress (aim for 5–15 functions total, but always include complete groups even if that means going slightly over).

Check inline comments before including an entry. Some entries have inline comments that indicate they should not be documented:

  • # deprecated — The function is deprecated. Leave it in the ignore list.
  • # documented as <other_name> — Already documented under a different name. Leave it.
  • # looks unintentionally public — Probably not meant to be public API. Leave it.
  • # legacy helper for... — Same as deprecated. Leave it.
  • # utility function - Leave it.

If a module group has a mix of regular entries and entries with inline comments, still process the group — but only comment out the regular entries. Leave entries with inline comments untouched in the ignore list.

Step 1b: Verify functions have actual docstrings

For each function selected in Step 1, check that it has a meaningful docstring by running:

python -c "from torch.module.path import func_name; doc = func_name.__doc__; print('HAS DOC' if doc and len(doc.strip()) > 80 else 'NO DOC'); print(repr(doc[:120]) if doc else 'None')"

A function has a meaningful docstring if it has real descriptive content — not just:

  • None or empty string
  • Only a .. warning:: This API is experimental stub with no description
  • Only a one-line auto-generated signature

Functions without meaningful docstrings must stay in the ignore list. Remove them from your batch. If an entire module group has no functions with docstrings, skip the whole group.

Step 2: Present the batch to the user

Before making any edits, present the selected module groups and their functions to the user. Indicate which functions passed the docstring check and which were excluded. Show them organized by module:

Module: torch.ao.quantization.fx.convert
  - convert
  - convert_custom_module
  - convert_standalone_module
  - convert_weighted_module

Module: torch.ao.quantization.fx.fuse
  - fuse

Then use the AskUserQuestion tool to let the user confirm, with options like:

  • "Proceed with this batch"
  • "Skip some entries" (user can specify which to remove)
  • "Pick a different batch"

Step 3: Comment out entries in conf.py

After the user confirms, edit docs/source/conf.py and comment out (do not delete) the selected entries. Use a # prefix on each string entry line:

# torch.ao.quantization.fx.convert
# "convert",
# "convert_custom_module",
# "convert_standalone_module",
# "convert_weighted_module",

This preserves the original entries so they can be restored if verification fails.

Step 4: Run Sphinx coverage

cd docs && make coverage

Ignore the terminal output of make coverage. It often contains unrelated tracebacks and errors from Sphinx extensions (e.g., onnx_ir, katex, sphinxcontrib) that have nothing to do with coverage. The only thing that matters is whether docs/build/coverage/python.txt was generated. Read that file to see the specific undocumented APIs.

The format of python.txt lists each undocumented API as:

torch.ao.quantization.fx.convert
   * convert
   * convert_custom_module
   * convert_standalone_module
   * convert_weighted_module

Not all commented-out functions will appear in python.txt. Some may already be documented elsewhere. This is fine — only add directives for functions that actually appear in python.txt.

If make coverage fails due to missing dependencies, first run:

cd docs && pip install -r requirements.txt

Step 5: Add documentation directives

For each function listed in python.txt, use the module label comment from conf.py to determine where it should be added. The module comment gives you the full module path, which maps to a doc source file and a section within that file.

Finding the correct doc file

The module comment maps to a doc source file in docs/source/. When unsure, search for other functions from the same module:

grep -rn "torch.module_name" docs/source/*.md docs/source/*.rst

Or list candidate files:

ls docs/source/*module_name*

If no doc file exists for a submodule, check whether a parent module's doc file has a section for it (e.g., backends.md has sections for torch.backends.cuda, torch.backends.cudnn, etc.). If not, add a new section to the parent file following existing patterns.

Adding the directives

Read the target doc file first and match the exact patterns already used there. Do not invent new patterns or use bare autofunction with fully qualified names — always use the proper hierarchical structure with automodule, currentmodule, and short names. Do not use . py:module:: since that just suppresses errors and doesn't actually document the function. Look at other files that match the target file's format (e.g., .md vs. .rst) under docs/source/ to see examples.

There are two file formats. Match the one used in the target file.

Pattern A — MyST Markdown files (.md): Used in files like accelerator.md, backends.md, cuda.md.

The hierarchical structure uses automodule to register the module, currentmodule to set context, then short names:

## torch.ao.quantization.fx.convert

.. automodule:: torch.ao.quantization.fx.convert

.. currentmodule:: torch.ao.quantization.fx.convert

.. autofunction:: convert

.. autofunction:: convert_custom_module

For autosummary blocks (used in some files instead of individual directives):

.. autosummary:: :toctree: generated :nosignatures:

existing_function your_new_function `


For classes:
.. autoclass:: YourClass
    :members:
`` `

Pattern B — reStructuredText files (.rst): Used in files like torch.rst, nn.rst.

Same hierarchical structure without the markdown fences:

torch.ao.quantization.fx.convert
---------------------------------

.. automodule:: torch.ao.quantization.fx.convert

.. currentmodule:: torch.ao.quantization.fx.convert

.. autosummary::
    :toctree: generated
    :nosignatures:

    convert
    convert_custom_module
    convert_standalone_module
    convert_weighted_module

For individual directives:

.. automodule:: torch.submodule

.. currentmodule:: torch.submodule

.. autofunction:: function_name

.. autoclass:: ClassName
    :members:

Key rules:

  • The module label comment from conf.py (e.g., # torch.ao.quantization.fx.convert) tells you exactly which automodule and currentmodule to use.
  • Always set .. automodule:: and .. currentmodule:: before documenting functions from a module.
  • Use short names (e.g., convert, not torch.ao.quantization.fx.convert.convert) after currentmodule is set.
  • If the module already has an automodule/currentmodule in the file, don't add another — just add your function under the existing one.
  • Match whichever style the file already uses (autosummary blocks vs. individual autofunction directives).
Placing in the right section

Read the target doc file and find the appropriate section. If the module already has a section (e.g., ## torch.backends.cuda in backends.md), add the functions there. If no section exists yet, create one following the existing section patterns in the file. Group all functions from the same module group together.

Step 6: Verify with coverage

Run coverage again:

cd docs && make coverage

Ignore the terminal output — only read docs/build/coverage/python.txt. Verification passes when python.txt contains zero undocumented functions across ALL modules. It should only have the statistics table with 100% coverage and 0 undocumented for every module. For example:

Undocumented Python objects
===========================

Statistics
----------

+---------------------------+----------+--------------+
| Module                    | Coverage | Undocumented |
+===========================+==========+==============+
| torch                     | 100.00%  | 0            |
+---------------------------+----------+--------------+
| torch.accelerator         | 100.00%  | 0            |
+---------------------------+----------+--------------+

If any module shows undocumented functions (coverage below 100% or undocumented count > 0), verification has failed.

If verification succeeds (zero undocumented across all modules): Go to Step 7.

If verification fails (any undocumented functions remain): Read docs/build/coverage/python.txt to see which functions are still listed as undocumented. Common issues include:

  • Wrong doc file: the function was added to the wrong .md/.rst file. Move the directive to the correct file.
  • Wrong directive type: e.g., used autofunction for a class, or autoclass for a function. Fix the directive.
  • Wrong module path in the directive: e.g., torch.foo.bar should be torch.foo.baz.bar. Correct the qualified name.
  • Function added to an autosummary block with the wrong currentmodule: make sure the .. currentmodule:: directive above the block matches.
  • Missing automodule for a submodule that hasn't been registered yet. Add a .. automodule:: torch.submodule directive before documenting functions from that submodule.

Fix the doc directive based on the error, then re-run make coverage. Repeat until verification passes.

If a function still fails after multiple attempts, stop and show the error to the user. Present the function name and the error, then use the AskUserQuestion tool with options like:

  • "Uncomment it to restore to ignore list (skip for now)"
  • "Try a different approach"
  • "Investigate further"

Step 7: Report progress

Present a progress summary to the user showing:

  • Which module groups were processed and how many functions were documented
  • Which functions were skipped or restored to the ignore list (and why)
  • How many entries remain in coverage_ignore_functions and coverage_ignore_classes

Step 8: Clean up commented-out entries in conf.py

Now that verification has passed, delete the commented-out string entries from Step 3. These are lines that start with # " inside coverage_ignore_functions and coverage_ignore_classes. Commented-out string entries always contain quotes — that's how you distinguish them from module label comments:

# "disable_global_flags",       <-- commented-out string entry (has quotes) → DELETE
# torch.backends                <-- module label comment (no quotes) → KEEP if it has active entries

Also delete any module label comments that no longer have active entries beneath them (i.e., all their entries were either commented out and now deleted, or had inline comments and were left in place but the module label is otherwise empty).

Important notes

  • Follow the steps exactly as written. The make coverage step is the primary verification for correct Sphinx directives, and Step 1b's docstring check ensures you only document functions that have real content.
  • Never modify Python source files (.py). This skill only edits docs/source/conf.py and doc source files (.md/.rst) in docs/source/. Do not add or edit docstrings. The only reason to inspect Python modules is in Step 1b to check whether a docstring exists — never to modify source code.
  • Entries are commented out in Step 3, verified in Step 6, and cleaned up in Step 8 after verification passes. Never delete uncommented entries directly.
  • Read inline comments on entries before deciding to document them. Entries marked # deprecated, # documented as..., # looks unintentionally public, or # legacy helper should stay in the ignore list.
  • The coverage_ignore_functions list uses bare function names (not fully qualified), so the same name can appear multiple times for different modules. Use the module label comment above each entry to identify which module it belongs to. Be careful during Step 8 cleanup to only delete the correct commented-out lines — commented-out string entries have quotes (# "func_name",), module label comments do not.
  • Always match the existing style of the target doc file — don't mix .md style directives into .rst files or vice versa.
  • Use the module label comment (e.g., # torch.ao.quantization.fx.convert) as the primary guide for both the automodule/currentmodule directives and for finding the right section in the doc file.
  • Always process complete module groups — never split a group across invocations.

平台分布

Codex

34.41%
按下载量换算229

Claude

32.84%
按下载量换算219

Cursor

17.75%
按下载量换算118

Gemini CLI

10.52%
按下载量换算70

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/pytorch/pytorch --skill document-public-apis 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills