Loading...
Loading...
Compare original and translation side by side
⚠️ Scope: Claude Code CLI Agent Skills (), not Claude.ai API skills~/.claude/skills/
⚠️ 适用范围:Claude Code CLI Agent技能(存储于),而非Claude.ai API技能~/.claude/skills/
For detailed context on each step, see Skill Creation Process (Detailed Tutorial) below.
如需了解每个步骤的详细背景,请参阅下方的【技能创建流程(详细教程)】。
1. Gather requirements (ask user for functionality, examples, triggers)
2. Identify reusable resources (scripts, references, assets needed)
3. Run init script to create skill directory structure
4. Create bundled resources first (scripts/, references/, assets/)
5. Write SKILL.md with YAML frontmatter (name, description with triggers)
6. Add TodoWrite task templates section to SKILL.md
7. Add Post-Change Checklist section to SKILL.md
8. Validate with quick_validate.py
9. Validate links (relative paths only): bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
10. Test skill on real example
11. Register skill in project CLAUDE.md
12. Verify against Skill Quality Checklist below1. 收集需求(向用户询问功能、示例、触发词)
2. 识别可复用资源(所需的脚本、参考资料、资产)
3. 运行初始化脚本创建技能目录结构
4. 先创建捆绑资源(scripts/、references/、assets/)
5. 编写带有YAML前置元数据的SKILL.md(包含名称、带触发词的描述)
6. 在SKILL.md中添加TodoWrite任务模板章节
7. 在SKILL.md中添加变更后检查清单章节
8. 使用quick_validate.py进行验证
9. 验证链接(仅使用相对路径):bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
10. 在真实示例上测试技能
11. 在项目CLAUDE.md中注册技能
12. 根据下方的技能质量检查清单进行验证1. Read current SKILL.md and understand structure
2. Identify what needs changing (triggers, workflow, resources)
3. Make targeted changes to SKILL.md
4. Update any affected references/ or scripts/
5. Validate with quick_validate.py
6. Validate links (relative paths only): bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
7. Test updated behavior
8. Update project CLAUDE.md if description changed
9. Verify against Skill Quality Checklist below1. 阅读当前SKILL.md并理解其结构
2. 确定需要修改的内容(触发词、工作流、资源)
3. 对SKILL.md进行针对性修改
4. 更新所有受影响的references/或scripts/内容
5. 使用quick_validate.py进行验证
6. 验证链接(仅使用相对路径):bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
7. 测试更新后的行为
8. 若描述有变更,更新项目CLAUDE.md
9. 根据下方的技能质量检查清单进行验证1. Read current SKILL.md to understand skill purpose
2. Determine resource type (script, reference, or asset)
3. Create resource in appropriate directory
4. Update SKILL.md to document new resource
5. Validate with quick_validate.py
6. Validate links (relative paths only): bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
7. Test resource integration
8. Verify against Skill Quality Checklist below1. 阅读当前SKILL.md以理解技能用途
2. 确定资源类型(脚本、参考资料或资产)
3. 在对应目录中创建资源
4. 更新SKILL.md以记录新资源
5. 使用quick_validate.py进行验证
6. 验证链接(仅使用相对路径):bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
7. 测试资源集成效果
8. 根据下方的技能质量检查清单进行验证1. Read current SKILL.md structure
2. Add TodoWrite Task Templates section (scenario-specific)
3. Add Post-Change Checklist section
4. Create references/evolution-log.md (reverse chronological - newest on top)
5. Create references/config-reference.md (if skill manages external config)
6. Update description with self-evolution triggers
7. Validate with quick_validate.py
8. Validate links (relative paths only): bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
9. Test self-documentation on sample change
10. Verify against Skill Quality Checklist below1. 阅读当前SKILL.md结构
2. 添加TodoWrite任务模板章节(按场景划分)
3. 添加变更后检查清单章节
4. 创建references/evolution-log.md(按逆时间顺序排列 - 最新内容在顶部)
5. 创建references/config-reference.md(若技能管理外部配置)
6. 更新描述以包含自演进触发词
7. 使用quick_validate.py进行验证
8. 验证链接(仅使用相对路径):bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
9. 在示例变更上测试自文档功能
10. 根据下方的技能质量检查清单进行验证1. Check YAML frontmatter syntax (no colons in description)
2. Verify trigger keywords in description match user queries
3. Check skill location (~/.claude/skills/ or project .claude/skills/)
4. Validate with quick_validate.py for errors
5. Validate links: bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
6. Test with explicit trigger phrase
7. Document findings in skill if new issue discovered
8. Verify against Skill Quality Checklist below1. 检查YAML前置元数据语法(描述中不能有冒号)
2. 验证描述中的触发词是否匹配用户查询
3. 检查技能位置(~/.claude/skills/ 或项目的.claude/skills/)
4. 使用quick_validate.py验证是否存在错误
5. 验证链接:bun run plugins/plugin-dev/scripts/validate-links.ts <skill-path>
6. 使用明确的触发短语进行测试
7. 若发现新问题,在技能中记录相关发现
8. 根据下方的技能质量检查清单进行验证/Users/<user>/home/<user>$HOME/tmptempfile.TemporaryDirectorycommand -v/usr/bin/env bash << 'NAME_EOF'declare -Agrep -Pgrep -E\!=!=PREFLIGHT_EOF/Users/<user>/home/<user>$HOME/tmptempfile.TemporaryDirectorycommand -v/usr/bin/env bash << 'NAME_EOF'declare -Agrep -Pgrep -E\!=!=PREFLIGHT_EOF| Signal | Example | Action |
|---|---|---|
| Friction | Step feels awkward or unclear | Rewrite for clarity |
| Missing edge case | Workflow fails on valid input | Add handling + document |
| Better pattern | Discover more elegant approach | Update + log why |
| User confusion | Same question asked repeatedly | Add clarification or FAQ |
| Tool evolution | Underlying tool gains features | Update to leverage them |
| Repeated manual steps | Same code written each time | Create script in |
| 信号 | 示例 | 操作 |
|---|---|---|
| 操作阻力 | 步骤感觉生硬或不清晰 | 重写以提升清晰度 |
| 缺失边缘场景处理 | 工作流在有效输入下失败 | 添加处理逻辑并记录 |
| 更优模式 | 发现更简洁的实现方式 | 更新并记录原因 |
| 用户困惑 | 重复被问到相同问题 | 添加说明或FAQ |
| 工具演进 | 底层工具新增功能 | 更新以利用新功能 |
| 重复手动步骤 | 每次都要编写相同代码 | 在 |
Rationale: Small immediate updates compound. Waiting means insights are forgotten. 30 seconds now saves 5 minutes later.
原理:小的即时更新会不断积累。等待会导致见解被遗忘。现在花30秒,以后能节省5分钟。
"Did anything about this skill feel suboptimal? If I encountered this again, what would help?"
"本技能的某些部分是否感觉不够理想?如果再次遇到这种情况,什么会有所帮助?"
Note: Use TodoWrite templates above for execution. This section provides detailed context for each phase.
注意:执行时请使用上方的TodoWrite模板。本节为每个阶段提供详细背景信息。
scripts/rotate_pdf.pyassets/hello-world/references/schema.mdscripts/rotate_pdf.pyassets/hello-world/references/schema.mduv run plugins/plugin-dev/scripts/skill-creator/init_skill.py <skill-name> --path <target-path>uv run plugins/plugin-dev/scripts/skill-creator/init_skill.py <skill-name> --path <target-path>scripts/references/assets/scripts/references/assets/uv run plugins/plugin-dev/scripts/skill-creator/quick_validate.py <path/to/skill-folder>uv run plugins/plugin-dev/scripts/skill-creator/package_skill.py <path/to/skill-folder>quick_validate.pypackage_skill.pyuv run plugins/plugin-dev/scripts/skill-creator/quick_validate.py <path/to/skill-folder>uv run plugins/plugin-dev/scripts/skill-creator/package_skill.py <path/to/skill-folder>quick_validate.pypackage_skill.pyskill-name/
├── SKILL.md # Required: YAML frontmatter + instructions
├── scripts/ # Optional: Executable code (Python/Bash)
├── references/ # Optional: Documentation loaded as needed
│ └── evolution-log.md # Recommended: Change history (self-evolving)
└── assets/ # Optional: Files used in outputskill-name/
├── SKILL.md # 必填:YAML前置元数据 + 说明文档
├── scripts/ # 可选:可执行代码(Python/Bash)
├── references/ # 可选:按需加载的文档
│ └── evolution-log.md # 推荐:变更历史(支持自演进)
└── assets/ # 可选:输出中使用的文件---
name: skill-name-here
description: What this does and when to use it (max 1024 chars for CLI)
allowed-tools: Read, Grep, Bash # Optional, CLI-only feature
---| Field | Rules |
|---|---|
| Lowercase, hyphens, numbers. Max 64 chars. Unique. |
| WHAT it does + WHEN to use. Max 1024 chars (CLI) / 200 (API). Include triggers! |
| CLI-only. Comma-separated list restricts tools. Optional. |
| Pitfall | Problem | Fix |
|---|---|---|
| Multiline syntax | | Single line only |
| Colons in text | | Use |
| Quoted strings | Valid but not idiomatic | Unquoted preferred (match anthropics/skills) |
undefined---
name: skill-name-here
description: 技能用途与使用场景(CLI版本最多1024字符)
allowed-tools: Read, Grep, Bash # 可选,仅CLI支持
---| 字段 | 规则 |
|---|---|
| 小写、连字符、数字。最多64字符。唯一标识。 |
| 功能 + 使用场景。CLI版本最多1024字符 / API版本最多200字符。必须包含触发词! |
| 仅CLI支持。逗号分隔的工具限制列表。可选。 |
| 陷阱 | 问题 | 修复方案 |
|---|---|---|
| 多行语法 | 不支持 | 仅使用单行 |
| 文本中的冒号 | | 使用 |
| 带引号的字符串 | 合法但不符合惯例 | 首选无引号格式(匹配anthropics/skills) |
undefined
**Validation**: GitHub renders frontmatter - invalid YAML shows red error banner.
**验证方式**:GitHub会渲染前置元数据 - 无效YAML会显示红色错误横幅。scripts/references/assets/scripts/references/assets/allowed-toolsallowed-toolsuv run script.pyuv run script.py| Issue | Cause | Solution |
|---|---|---|
| Skill not triggering | Missing trigger keywords | Add trigger phrases to description field |
| YAML parse error | Colon in description | Replace colons with dashes in description |
| Skill not found | Wrong location | Place in |
| validate script fails | Invalid frontmatter | Check name format (lowercase-hyphen only) |
| Resources not loading | Wrong path in SKILL.md | Use relative paths from skill directory |
| Script execution fails | Missing shebang or permissions | Add |
| allowed-tools ignored | API skill (not CLI) | allowed-tools only works in CLI skills |
| Description too long | Over 1024 chars | Shorten description, move details to SKILL.md body |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 技能未触发 | 缺少触发关键词 | 在描述字段中添加触发短语 |
| YAML解析错误 | 描述中包含冒号 | 将描述中的冒号替换为破折号 |
| 技能未找到 | 位置错误 | 放置在 |
| 验证脚本执行失败 | 前置元数据无效 | 检查名称格式(仅小写连字符) |
| 资源无法加载 | SKILL.md中的路径错误 | 使用相对于技能目录的相对路径 |
| 脚本执行失败 | 缺少shebang或权限 | 添加 |
| allowed-tools设置被忽略 | API技能(非CLI) | allowed-tools仅在CLI技能中生效 |
| 描述过长 | 超过1024字符 | 缩短描述,将详细内容移至SKILL.md主体 |