skill-creator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Creator
Skill Creator
Create modular Agent Skills that extend Claude's capabilities. Skills package expertise into discoverable folders containing instructions, scripts, and resources.
创建可扩展Claude能力的模块化Agent Skills。技能将专业知识打包到包含说明、脚本和资源的可发现文件夹中。
When to Use
适用场景
- "Create a skill for..."
- "Make a new skill"
- "Add a skill that..."
- "How do I create a skill?"
- "Document this workflow as a skill"
- "为……创建技能"
- "创建新技能"
- "添加具备……功能的技能"
- "如何创建技能?"
- "将此工作流记录为技能"
Quick Start: Create a Skill
快速开始:创建技能
1. Choose Location
1. 选择存储位置
bash
undefinedbash
undefinedPersonal skill (all projects)
个人技能(适用于所有项目)
mkdir -p ~/.claude/skills/my-skill
mkdir -p ~/.claude/skills/my-skill
Project skill (shared via git)
项目技能(通过Git共享)
mkdir -p .claude/skills/my-skill
undefinedmkdir -p .claude/skills/my-skill
undefined2. Create SKILL.md
2. 创建SKILL.md文件
markdown
---
name: my-skill
description: Brief description of what it does and when to use it.
---markdown
---
name: my-skill
description: 简要说明技能的功能及适用场景。
---My Skill
我的技能
Instructions
操作说明
Step-by-step guidance for Claude.
给Claude的分步指导。
Examples
示例
Concrete usage examples.
undefined具体使用示例。
undefined3. Test It
3. 测试技能
Ask Claude a question that matches your description. Skills activate automatically based on context.
向Claude提出符合你技能描述的问题。技能会根据上下文自动激活。
SKILL.md Structure
SKILL.md 文件结构
Required: YAML Frontmatter
必填:YAML 头部信息
yaml
---
name: lowercase-with-hyphens # Max 64 chars, [a-z0-9-] only
description: What it does AND when to use it. Include trigger keywords.
---Critical: The field determines when Claude discovers and uses your skill.
descriptionyaml
---
name: lowercase-with-hyphens # 最多64个字符,仅允许[a-z0-9-]
description: 说明技能功能及适用场景,包含触发关键词。
---关键提示:字段决定了Claude何时发现并使用你的技能。
descriptionOptional: Tool Permissions
可选:工具权限
yaml
---
name: safe-reader
description: Read-only file access. Use for code review without modifications.
allowed-tools: Read, Grep, Glob
---When is set, Claude can only use those tools without asking permission.
allowed-toolsyaml
---
name: safe-reader
description: 只读文件访问权限。用于无需修改的代码审查场景。
allowed-tools: Read, Grep, Glob
---当设置后,Claude只能使用指定的工具,无需额外询问权限。
allowed-toolsContent Sections
内容章节
markdown
undefinedmarkdown
undefinedSkill Name
技能名称
Brief overview.
简要概述。
Prerequisites
前置条件
Installation or setup if needed.
所需的安装或设置步骤。
CLI Reference
CLI 参考
Commands with examples.
带示例的命令。
Common Workflows
常见工作流
Step-by-step procedures.
分步操作流程。
Best Practices
最佳实践
Guidelines and tips.
---指南和技巧。
---Skill Types
技能类型
| Type | Location | Scope | Shared |
|---|---|---|---|
| Personal | | All your projects | No |
| Project | | This repo | Yes (git) |
| Plugin | Via installed plugins | Per plugin | Via marketplace |
| 类型 | 存储位置 | 适用范围 | 是否可共享 |
|---|---|---|---|
| 个人技能 | | 所有项目 | 否 |
| 项目技能 | | 当前仓库 | 是(通过Git) |
| 插件技能 | 通过已安装的插件 | 单个插件 | 是(通过市场) |
Supporting Files
支持文件
Add files alongside SKILL.md:
my-skill/
├── SKILL.md # Required
├── reference.md # Optional docs
├── examples/ # Optional examples
├── scripts/ # Optional utilities
│ └── helper.ts
└── templates/ # Optional templatesReference from SKILL.md:
markdown
See [reference.md](reference.md) for details.
Run the helper:
` ` `bash
bun scripts/helper.ts
` ` `Claude reads supporting files only when needed (progressive disclosure).
可在SKILL.md旁添加以下文件:
my-skill/
├── SKILL.md # 必填文件
├── reference.md # 可选文档
├── examples/ # 可选示例
├── scripts/ # 可选工具脚本
│ └── helper.ts
└── templates/ # 可选模板在SKILL.md中引用支持文件:
markdown
详情请查看[reference.md](reference.md)。
运行辅助脚本:
```bash
bun scripts/helper.ts
Claude仅在需要时读取支持文件(渐进式披露)。
---Writing Good Descriptions
撰写优质描述
Bad (too vague):
yaml
description: Helps with dataGood (specific triggers):
yaml
description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when working with Excel files, .xlsx format, or spreadsheet analysis.Include:
- What the skill does
- When to use it
- Key trigger words users might say
反面示例(过于模糊):
yaml
description: 处理数据相关工作正面示例(包含具体触发词):
yaml
description: 分析Excel电子表格、创建数据透视表、生成图表。适用于处理Excel文件、.xlsx格式或电子表格分析场景。描述需包含:
- 技能核心功能
- 具体适用场景
- 用户可能使用的关键触发词
Complete Example
完整示例
Create ~/.claude/skills/api-testing/SKILL.md
~/.claude/skills/api-testing/SKILL.md创建~/.claude/skills/api-testing/SKILL.md
~/.claude/skills/api-testing/SKILL.mdmarkdown
---
name: api-testing
description: Test REST APIs with curl and analyze responses. Use when testing endpoints, debugging APIs, or validating HTTP requests.
---markdown
---
name: api-testing
description: 使用curl测试REST API并分析响应。适用于测试接口、调试API或验证HTTP请求场景。
---API Testing
API 测试
Test and debug REST APIs from the command line.
从命令行测试和调试REST API。
Prerequisites
前置条件
bash
undefinedVerify curl is available
验证curl是否可用
curl --version
`
curl --version
undefinedCLI Reference
CLI 参考
Basic Requests
基础请求
bash curl -X GET "https://api.example.com/users" curl -X POST "https://api.example.com/users" \ -H "Content-Type: application/json" \ -d '{"name": "John"}' bash
curl -X GET "https://api.example.com/users"
curl -X POST "https://api.example.com/users" \
-H "Content-Type: application/json" \
-d '{"name": "John"}'With Authentication
带认证的请求
bash curl -H "Authorization: Bearer $TOKEN" \ "https://api.example.com/protected" bash
curl -H "Authorization: Bearer $TOKEN" \
"https://api.example.com/protected"Save Response
保存响应结果
bash curl -o response.json "https://api.example.com/data" bash
curl -o response.json "https://api.example.com/data"Common Workflows
常见工作流
Test Endpoint Health
测试接口健康状态
bash
undefinedCheck status code
检查状态码
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/health
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/health
Measure response time
测量响应时间
curl -w "Time: %{time_total}s\n" -o /dev/null -s https://api.example.com
`
curl -w "耗时: %{time_total}s\n" -o /dev/null -s https://api.example.com
undefinedBest Practices
最佳实践
- Use -s for scripts - Silent mode hides progress
- Use -f to fail - Exit non-zero on HTTP errors
- Use jq for JSON - Pipe to for pretty output
jq
---- 脚本中使用-s参数 - 静默模式隐藏进度信息
- 使用-f参数触发失败 - HTTP错误时返回非零退出码
- 使用jq处理JSON - 管道输出到实现格式化展示
jq
---Validation Checklist
验证 checklist
Before considering complete:
- SKILL.md has valid YAML frontmatter
- Name is lowercase-with-hyphens (max 64 chars)
- Description includes what AND when (max 1024 chars)
- Instructions are clear and actionable
- CLI commands have explanatory comments
- Tested that Claude discovers and uses the skill
完成前需检查:
- SKILL.md包含有效的YAML头部信息
- 名称为小写连字符格式(最多64个字符)
- 描述包含功能及适用场景(最多1024个字符)
- 操作说明清晰且可执行
- CLI命令带有解释性注释
- 已测试Claude可发现并使用该技能
Troubleshooting
故障排除
Claude doesn't use my skill
Claude未使用我的技能
- Description too vague - Add specific trigger keywords
- Wrong location - Check path exactly matches conventions
- Invalid YAML - Validate frontmatter syntax
- Restart needed - Restart Claude Code after changes
- 描述过于模糊 - 添加具体的触发关键词
- 存储位置错误 - 检查路径是否完全符合规范
- YAML语法无效 - 验证头部信息的语法正确性
- 需要重启 - 修改后重启Claude Code
Check skill loads
检查技能是否加载
bash
undefinedbash
undefinedVerify file exists
验证文件是否存在
cat ~/.claude/skills/my-skill/SKILL.md
cat ~/.claude/skills/my-skill/SKILL.md
List all skills
列出所有技能
ls ~/.claude/skills//SKILL.md
ls .claude/skills//SKILL.md
undefinedls ~/.claude/skills//SKILL.md
ls .claude/skills//SKILL.md
undefinedDebug frontmatter
调试头部信息
bash
undefinedbash
undefinedView first 10 lines
查看前10行内容
head -n 10 ~/.claude/skills/my-skill/SKILL.md
Ensure:
- Opening `---` on line 1
- Closing `---` before content
- No tabs (use spaces)
- Strings with special chars are quoted
---head -n 10 ~/.claude/skills/my-skill/SKILL.md
需确保:
- 开头的`---`在第1行
- 结尾的`---`在内容之前
- 不使用制表符(用空格代替)
- 包含特殊字符的字符串需加引号
---Study Existing Skills
参考现有技能
bash
undefinedbash
undefinedSee all personal skills
查看所有个人技能
ls ~/.claude/skills/*/SKILL.md
ls ~/.claude/skills/*/SKILL.md
Good examples to study
推荐参考的示例
cat ~/.claude/skills/beads/SKILL.md # Task tracking CLI
cat ~/.claude/skills/gemini/SKILL.md # AI research CLI
cat ~/.claude/skills/github/SKILL.md # gh CLI patterns
undefinedcat ~/.claude/skills/beads/SKILL.md # 任务跟踪CLI技能
cat ~/.claude/skills/gemini/SKILL.md # AI研究CLI技能
cat ~/.claude/skills/github/SKILL.md # gh CLI模式技能
undefined