用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/shader-slang/slang-skills --skill slangpy-docs命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | slangpy-docs |
| license | MIT |
| description | Read and write SlangPy documentation. |
| provides | ["doc.read","doc.write"] |
| allowed-tools | Read, Grep, Glob, Edit, Write, Bash(git add:*), Bash(git commit:*), Bash(python:*), Bash(sphinx:*), Bash(pre-commit:*) |
docs/ -- Sphinx documentation (published at slangpy.shader-slang.org)docs/src/ -- Source pages for the developer guide and user documentationdocs/generated/ -- Auto-generated API referencedocs/generate_api.py -- Script to regenerate API docsdocs/conf.py -- Sphinx configurationREADME.md -- Project overview and quick startCONTRIBUTING.md -- Contribution guideDEVELOP.md -- Developer setup (links to online docs)def myfunc(x: int, y: int) -> int:
"""
Description.
:param x: Some parameter.
:param y: Some parameter.
:return: Some return value.
"""
/// Pack two float values to 8-bit snorm.
/// @param v Float values in [-1,1].
/// @param options Packing options.
/// @return 8-bit snorm values in low bits, high bits all zero.
uint32_t pack_snorm2x8(float2 v, const PackOptions options = PackOptions::safe);
.slang files in tests and examples serve as living documentation. Key patterns:
[shader("compute")] entry pointsStructuredBuffer<T> / RWStructuredBuffer<T> typed GPU arrays[Differentiable] functions with bwd_diff() for automatic differentiationcd docs
pip install -r requirements.txt
python generate_api.py # Regenerate API reference
sphinx-build -b html . _build/html # Build HTML docs
Online docs: https://slangpy.shader-slang.org/en/latest/
The functional API is the primary user-facing feature. Key concepts to document:
spy.Module.load_from_file(device, "shader.slang")module.func(arg1, arg2) with automatic type marshallingspy.Tensor.from_numpy(device, array).map() for explicit dimension/type mappings[Differentiable] Slang functions with PyTorch integration:param:, :return: tags; build with sphinx-build -b html . _build/html/// @param @return triple-slash styledocs/src/, run python generate_api.py to refresh generated API referenceWhen a new type is added to the functional API:
docs/AGENTS.md -- functional API overview, type resolution reference, vectorization reference, doc style conventionsCLAUDE.md -- doc style (Doxygen for C++, Sphinx for Python)docs/ -- existing Sphinx documentation structureREADME.md -- project overview and quick start examples