skill-writer by pytorch/pytorch
npx skills add https://github.com/pytorch/pytorch --skill skill-writer此 Skill 可帮助您为 Claude Code 创建结构良好、遵循最佳实践和验证要求的 Agent Skill。
在以下情况下使用此 Skill:
首先,理解 Skill 应具备的功能:
提出澄清性问题:
保持专注:一个 Skill = 一项能力
确定在何处创建 Skill:
个人 Skill (~/.claude/skills/):
项目 Skill (.claude/skills/):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
创建目录和文件:
# 个人
mkdir -p ~/.claude/skills/skill-name
# 项目
mkdir -p .claude/skills/skill-name
对于多文件 Skill:
skill-name/
├── SKILL.md (必需)
├── reference.md (可选)
├── examples.md (可选)
├── scripts/
│ └── helper.py (可选)
└── templates/
└── template.txt (可选)
创建包含必需字段的 YAML 前置元数据:
---
name: skill-name
description: 简要描述此技能的功能及使用时机
---
字段要求:
name:
pdf-processor、git-commit-helperPDF_Processor、Git Commits!description:
可选前置元数据字段:
allowed-tools: Read, Grep, Glob
适用于:
描述对于 Claude 发现您的 Skill 至关重要。
公式:[功能描述] + [使用时机] + [关键触发词]
示例:
✅ 好的示例:
description: 从 PDF 文件中提取文本和表格、填写表单、合并文档。在处理 PDF 文件或用户提及 PDF、表单或文档提取时使用。
✅ 好的示例:
description: 分析 Excel 电子表格、创建数据透视表并生成图表。在处理 Excel 文件、电子表格或以 .xlsx 格式分析表格数据时使用。
❌ 过于模糊:
description: 帮助处理文档
description: 用于数据分析
技巧:
使用清晰的 Markdown 章节:
# Skill 名称
简要概述此 Skill 的功能。
## 快速开始
提供一个简单的示例以便立即开始使用。
## 使用说明
为 Claude 提供分步指导:
1. 第一步,明确操作
2. 第二步,预期结果
3. 处理边界情况
## 示例
展示包含代码或命令的具体使用示例。
## 最佳实践
- 需遵循的关键约定
- 需避免的常见陷阱
- 何时使用与何时不使用
## 要求
列出任何依赖项或先决条件:
```bash
pip install package-name
对于复杂场景,请参阅 reference.md。
创建附加文件以实现渐进式披露:
reference.md:详细的 API 文档、高级选项 examples.md:扩展示例和用例 scripts/:辅助脚本和实用工具 templates/:文件模板或样板代码
在 SKILL.md 中引用它们:
关于高级用法,请参阅 [reference.md](reference.md)。
运行辅助脚本:
```bash
python scripts/helper.py input.txt
### 步骤 8:验证 Skill
检查以下要求:
✅ **文件结构**:
* SKILL.md 存在于正确位置
* 目录名与前置元数据 `name` 匹配
✅ **YAML 前置元数据**:
* 第 1 行有开头的 `---`
* 内容前有结尾的 `---`
* 有效的 YAML(无制表符,缩进正确)
* `name` 遵循命名规则
* `description` 具体且 < 1024 字符
✅ **内容质量**:
* 为 Claude 提供清晰的说明
* 提供具体示例
* 处理了边界情况
* 列出了依赖项(如果有)
✅ **测试**:
* 描述与用户问题匹配
* Skill 在相关查询时激活
* 说明清晰且可操作
### 步骤 9:测试 Skill
1. **重启 Claude Code**(如果正在运行)以加载 Skill
2. **提出与描述匹配的相关问题**:
```
Can you help me extract text from this PDF?
```
3. **验证激活**:Claude 应自动使用该 Skill
4. **检查行为**:确认 Claude 正确遵循说明
### 步骤 10:如有需要,进行调试
如果 Claude 不使用该 Skill:
1. **使描述更具体**:
* 添加触发词
* 包含文件类型
* 提及常见的用户短语
2. **检查文件位置**:
```bash
ls ~/.claude/skills/skill-name/SKILL.md
ls .claude/skills/skill-name/SKILL.md
```
3. **验证 YAML**:
```bash
cat SKILL.md | head -n 10
```
4. **运行调试模式**:
```bash
claude --debug
```
## 常见模式
### 只读 Skill
```yaml
---
name: code-reader
description: 在不做更改的情况下读取和分析代码。用于代码审查、理解代码库或编写文档。
allowed-tools: Read, Grep, Glob
---
---
name: data-processor
description: 使用 Python 脚本处理 CSV 和 JSON 数据文件。在分析数据文件或转换数据集时使用。
---
# 数据处理器
## 使用说明
1. 使用处理脚本:
```bash
python scripts/process.py input.csv --output results.json
python scripts/validate.py results.json
### 采用渐进式披露的多文件 Skill
```yaml
---
name: api-designer
description: 遵循最佳实践设计 REST API。在创建 API 端点、设计路由或规划 API 架构时使用。
---
# API 设计器
快速开始:请参阅 [examples.md](examples.md)
详细参考:请参阅 [reference.md](reference.md)
## 使用说明
1. 收集需求
2. 设计端点(参见 examples.md)
3. 使用 OpenAPI 规范进行文档编写
4. 根据最佳实践进行审查(参见 reference.md)
在最终确定 Skill 之前,请验证:
Skill 未激活:
多个 Skill 冲突:
Skill 存在错误:
请参阅文档以获取完整示例:
创建 Skill 时,我将:
结果将是一个完整、可工作的 Skill,遵循所有最佳实践和验证规则。
每周安装量
476
代码仓库
GitHub 星标数
98.5K
首次出现
Jan 20, 2026
安全审计
安装于
claude-code402
opencode359
codex353
gemini-cli343
cursor333
github-copilot319
This Skill helps you create well-structured Agent Skills for Claude Code that follow best practices and validation requirements.
Use this Skill when:
First, understand what the Skill should do:
Ask clarifying questions :
Keep it focused : One Skill = one capability
Determine where to create the Skill:
Personal Skills (~/.claude/skills/):
Project Skills (.claude/skills/):
Create the directory and files:
# Personal
mkdir -p ~/.claude/skills/skill-name
# Project
mkdir -p .claude/skills/skill-name
For multi-file Skills:
skill-name/
├── SKILL.md (required)
├── reference.md (optional)
├── examples.md (optional)
├── scripts/
│ └── helper.py (optional)
└── templates/
└── template.txt (optional)
Create YAML frontmatter with required fields:
---
name: skill-name
description: Brief description of what this does and when to use it
---
Field requirements :
name :
pdf-processor, git-commit-helperPDF_Processor, Git Commits!description :
Optional frontmatter fields :
allowed-tools : Restrict tool access (comma-separated list)
allowed-tools: Read, Grep, Glob
Use for: * Read-only Skills * Security-sensitive workflows * Limited-scope operations
The description is critical for Claude to discover your Skill.
Formula : [What it does] + [When to use it] + [Key triggers]
Examples :
✅ Good :
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
✅ Good :
description: Analyze Excel spreadsheets, create pivot tables, and generate charts. Use when working with Excel files, spreadsheets, or analyzing tabular data in .xlsx format.
❌ Too vague :
description: Helps with documents
description: For data analysis
Tips :
Use clear Markdown sections:
# Skill Name
Brief overview of what this Skill does.
## Quick start
Provide a simple example to get started immediately.
## Instructions
Step-by-step guidance for Claude:
1. First step with clear action
2. Second step with expected outcome
3. Handle edge cases
## Examples
Show concrete usage examples with code or commands.
## Best practices
- Key conventions to follow
- Common pitfalls to avoid
- When to use vs. not use
## Requirements
List any dependencies or prerequisites:
```bash
pip install package-name
For complex scenarios, see reference.md.
### Step 7: Add supporting files (optional)
Create additional files for progressive disclosure:
**reference.md**: Detailed API docs, advanced options
**examples.md**: Extended examples and use cases
**scripts/**: Helper scripts and utilities
**templates/**: File templates or boilerplate
Reference them from SKILL.md:
```markdown
For advanced usage, see [reference.md](reference.md).
Run the helper script:
\`\`\`bash
python scripts/helper.py input.txt
\`\`\`
Check these requirements:
✅ File structure :
name✅ YAML frontmatter :
--- on line 1--- before contentname follows naming rulesdescription is specific and < 1024 chars✅ Content quality :
✅ Testing :
Restart Claude Code (if running) to load the Skill
Ask relevant questions that match the description:
Can you help me extract text from this PDF?
Verify activation : Claude should use the Skill automatically
Check behavior : Confirm Claude follows the instructions correctly
If Claude doesn't use the Skill:
Make description more specific :
Check file location :
ls ~/.claude/skills/skill-name/SKILL.md
ls .claude/skills/skill-name/SKILL.md
Validate YAML :
cat SKILL.md | head -n 10
Run debug mode :
claude --debug
---
name: code-reader
description: Read and analyze code without making changes. Use for code review, understanding codebases, or documentation.
allowed-tools: Read, Grep, Glob
---
---
name: data-processor
description: Process CSV and JSON data files with Python scripts. Use when analyzing data files or transforming datasets.
---
# Data Processor
## Instructions
1. Use the processing script:
\`\`\`bash
python scripts/process.py input.csv --output results.json
\`\`\`
2. Validate output with:
\`\`\`bash
python scripts/validate.py results.json
\`\`\`
---
name: api-designer
description: Design REST APIs following best practices. Use when creating API endpoints, designing routes, or planning API architecture.
---
# API Designer
Quick start: See [examples.md](examples.md)
Detailed reference: See [reference.md](reference.md)
## Instructions
1. Gather requirements
2. Design endpoints (see examples.md)
3. Document with OpenAPI spec
4. Review against best practices (see reference.md)
Before finalizing a Skill, verify:
Skill doesn't activate :
Multiple Skills conflict :
Skill has errors :
See the documentation for complete examples:
When creating a Skill, I will:
The result will be a complete, working Skill that follows all best practices and validation rules.
Weekly Installs
476
Repository
GitHub Stars
98.5K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code402
opencode359
codex353
gemini-cli343
cursor333
github-copilot319
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
103,800 周安装