skill-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Management

技能管理

IMPORTANT: This skill should be activated BEFORE modifying any skill files!
You are an expert at creating and maintaining high-quality Claude Code skills. This skill helps you follow best practices and remember to commit changes to the skills repository.
重要提示:在修改任何技能文件之前,必须先激活本技能!
你是创建和维护高质量Claude Code技能的专家。本技能可帮助你遵循最佳实践,并提醒你将变更提交到技能仓库。

When to Use This Skill (Read This First!)

何时使用本技能(请先阅读!)

✅ CORRECT Workflow

✅ 正确工作流程

ALWAYS activate this skill FIRST when:
  1. Creating a new skill in
    ~/.claude/skills/
  2. Editing any existing SKILL.md file
  3. Modifying skill-related files (EXAMPLES.md, REFERENCE.md, scripts, etc.)
  4. User requests to create, improve, update, review, or refactor a skill
  5. Discussing skill quality or effectiveness
The correct order is:
1. User asks to modify a skill (or you identify need to update one)
2. YOU ACTIVATE THIS SKILL IMMEDIATELY
3. You review best practices and quality checklist
4. You make changes following the guidelines
5. You commit changes to the skills git repository
在以下场景中,请始终先激活本技能:
  1. ~/.claude/skills/
    中创建新技能时
  2. 编辑任何现有的SKILL.md文件时
  3. 修改与技能相关的文件(EXAMPLES.md、REFERENCE.md、脚本等)时
  4. 用户要求创建、改进、更新、审查或重构技能时
  5. 讨论技能质量或有效性时
正确顺序:
1. 用户要求修改技能(或你发现有更新需求)
2. 立即激活本技能
3. 查阅最佳实践和质量检查清单
4. 按照指南进行修改
5. 将变更提交到技能git仓库

❌ INCORRECT Workflow (Anti-pattern)

❌ 错误工作流程(反模式)

NEVER do this:
1. User asks to modify a skill
2. You directly edit the SKILL.md file
3. You commit the changes
4. Later realize you didn't follow best practices
5. You have to redo the changes
绝对不要这样做:
1. 用户要求修改技能
2. 直接编辑SKILL.md文件
3. 提交变更
4. 之后才发现未遵循最佳实践
5. 不得不重新修改

Examples of When to Activate

激活场景示例

✅ "Can you update the literate-programming skill to be more emphatic?" → ACTIVATE THIS SKILL IMMEDIATELY, then plan changes
✅ "Create a new skill for handling API documentation" → ACTIVATE THIS SKILL IMMEDIATELY, then design skill
✅ "The code-review skill isn't triggering when it should" → ACTIVATE THIS SKILL IMMEDIATELY to review triggers
✅ Any task involving files in ~/.claude/skills/ → ACTIVATE THIS SKILL IMMEDIATELY
✅ "你能更新literate-programming技能,使其更强调重点吗?" → 立即激活本技能,然后规划变更
✅ "创建一个处理API文档的新技能" → 立即激活本技能,然后设计技能
✅ "code-review技能没有在应该触发的时候触发" → 立即激活本技能,审查触发条件
✅ 任何涉及~/.claude/skills/中文件的任务 → 立即激活本技能

Remember

注意事项

  • Skills have specific quality requirements and best practices
  • Following the checklist prevents having to redo work
  • Git commits are REQUIRED after any skill modification
  • Skill quality directly affects Claude Code effectiveness
  • 技能有特定的质量要求和最佳实践
  • 遵循检查清单可避免重复工作
  • 任何技能修改后都必须提交Git
  • 技能质量直接影响Claude Code的有效性

Original "When to Use" Section

原始「何时使用」部分

Invoke this skill proactively when:
  1. Creating new skills - User requests a new skill or you identify a need for one
  2. Modifying existing skills - Any edit to SKILL.md or related files in
    ~/.claude/skills/
  3. Reviewing skills - User asks to review, improve, or refactor a skill
  4. Skill quality questions - Discussing skill effectiveness, structure, or best practices
  5. After skill changes - To verify git commit was performed
请在以下场景主动调用本技能:
  1. 创建新技能 - 用户请求新技能,或你发现有创建需求时
  2. 修改现有技能 - 对
    ~/.claude/skills/
    中的SKILL.md或相关文件进行任何编辑时
  3. 审查技能 - 用户要求审查、改进或重构技能时
  4. 技能质量问题 - 讨论技能有效性、结构或最佳实践时
  5. 技能变更后 - 验证是否已执行git提交时

Core Principles (from Claude Code Documentation)

核心原则(来自Claude Code文档)

1. Conciseness

1. 简洁性

  • Assume Claude is already intelligent
  • Only include context Claude doesn't already possess
  • Challenge each piece of information for necessity
  • Keep SKILL.md under 500 lines
  • Split additional content into separate files (REFERENCE.md, EXAMPLES.md, etc.)
  • 假设Claude已具备智能
  • 仅包含Claude尚不了解的上下文信息
  • 对每条信息的必要性进行验证
  • 保持SKILL.md在500行以内
  • 将额外内容拆分到单独文件中(REFERENCE.md、EXAMPLES.md等)

2. Degrees of Freedom

2. 自由度等级

Match instruction specificity to task fragility:
  • High freedom (text instructions): Multiple valid approaches exist
  • Medium freedom (pseudocode/patterns): Preferred patterns with acceptable variation
  • Low freedom (specific scripts): Operations are fragile, exact sequences required
根据任务的脆弱性匹配指令的具体程度:
  • 高自由度(文本指令):存在多种有效实现方式
  • 中等自由度(伪代码/模式):有首选模式,允许一定变化
  • 低自由度(特定脚本):操作脆弱,需要严格遵循精确步骤

3. Progressive Disclosure

3. 渐进式披露

Use referenced files to load content on-demand:
  • Keep direct references one level deep from SKILL.md
  • Use separate reference files for different domains/features
  • Structure long references with table of contents
使用参考文件按需加载内容:
  • 保持从SKILL.md出发的直接引用不超过一层
  • 为不同领域/功能使用单独的参考文件
  • 为长篇参考内容添加目录结构

Skill Structure Requirements

技能结构要求

YAML Frontmatter (Required)

YAML前置元数据(必填)

yaml
---
name: skill-name-here
description: What this skill does and when to use it. Max 1024 characters.
---
Name requirements:
  • Maximum 64 characters
  • Lowercase letters, numbers, and hyphens only
  • No reserved words ("anthropic", "claude")
Description requirements:
  • Maximum 1024 characters
  • Non-empty, no XML tags
  • Use third-person perspective
  • State BOTH what the skill does AND when to use it
  • Include specific trigger terms and contexts
  • Be explicit about proactive invocation if applicable
  • Avoid vague language ("helps with documents")
yaml
---
name: skill-name-here
description: 本技能的功能及使用场景。最多1024个字符。
---
名称要求:
  • 最多64个字符
  • 仅使用小写字母、数字和连字符
  • 不得使用保留词("anthropic"、"claude")
描述要求:
  • 最多1024个字符
  • 非空,无XML标签
  • 使用第三人称视角
  • 同时说明技能的功能和使用场景
  • 包含特定触发词和上下文
  • 如有需要,明确说明主动调用方式
  • 避免模糊表述(如"帮助处理文档")

Effective Description Pattern

有效描述模板

yaml
description: [What it does]. Use [proactively/when]: (1) [trigger condition],
(2) [keyword/phrase triggers], (3) [context triggers]. [Special instructions].
Example:
yaml
description: Write and analyze literate programs using noweb. Use proactively
when: (1) creating, editing, or reviewing .nw files, (2) user mentions
"literate quality" or "noweb", (3) requests to improve documentation.
This skill should be invoked BEFORE making changes to .nw files.
yaml
description: [功能描述]。请在以下场景[主动/使用]:(1) [触发条件],
(2) [关键词/短语触发], (3) [上下文触发][特殊说明]
示例:
yaml
description: 使用noweb编写和分析文学式程序。请在以下场景主动使用:(1) 创建、编辑或审查.nw文件时,(2) 用户提及"literate quality"或"noweb"时,(3) 请求改进文档时。
修改.nw文件前应调用本技能。

Three-Level Loading Architecture

三级加载架构

Level 1 - Metadata (~100 tokens, always loaded):
  • YAML frontmatter for discovery
Level 2 - Instructions (<5k tokens, loaded when triggered):
  • Main SKILL.md body with procedures and best practices
Level 3 - Resources (unlimited, accessed as needed):
  • Additional files: REFERENCE.md, EXAMPLES.md, FORMS.md
  • Python scripts (executed via bash, output only enters context)
  • Database schemas, templates, etc.
一级 - 元数据(约100个token,始终加载):
  • 用于发现技能的YAML前置元数据
二级 - 指令(少于5k个token,触发时加载):
  • SKILL.md主体内容,包含流程和最佳实践
三级 - 资源(无限制,按需访问):
  • 附加文件:REFERENCE.md、EXAMPLES.md、FORMS.md
  • Python脚本(通过bash执行,仅输出进入上下文)
  • 数据库架构、模板等

Content Guidelines

内容指南

Organization Patterns

组织模式

Templates: Provide strict format for critical outputs, flexible guidance for context-dependent work
Examples: Show input/output pairs demonstrating desired style and detail level
Workflows: Break complex operations into clear sequential steps with checklists
Feedback loops: Implement validate-fix-repeat cycles for quality-critical tasks
模板:为关键输出提供严格格式,为上下文相关工作提供灵活指导
示例:展示输入/输出对,演示期望的风格和详细程度
工作流程:将复杂操作拆分为清晰的连续步骤和检查清单
反馈循环:为质量关键任务实施验证-修复-重复的循环

Writing Guidelines

写作指南

  • Use imperative/infinitive form - Write instructions using verb-first format (e.g., "To accomplish X, do Y" rather than "You should do X"). Maintain objective, instructional language for AI consumption
  • Avoid time-sensitive information or use "Old Patterns" sections with details tags
  • Maintain consistent terminology - select one term and use exclusively
  • Use forward slashes in all paths (never Windows-style backslashes)
  • Provide defaults for all options rather than excessive choices
  • Justify configuration parameters - no "magic numbers"
  • Include error handling in scripts with helpful messages
  • List required packages and verify availability
  • 使用祈使/不定式形式 - 以动词开头编写指令(例如,"要完成X,请执行Y"而非"你应该做X")。保持客观、指导性的语言,供AI使用
  • 避免时效性信息,或使用带有详情标签的「旧模式」部分
  • 保持术语一致性 - 选择一个术语并统一使用
  • 所有路径使用正斜杠(绝不要使用Windows风格的反斜杠)
  • 为所有选项提供默认值,而非过多选择
  • 说明配置参数的理由 - 不要使用「魔法数字」
  • 在脚本中包含错误处理,并提供有用的提示信息
  • 列出所需包并验证其可用性

Anti-Patterns to Avoid

需避免的反模式

  • Windows-style paths
  • Excessive options without defaults
  • Deeply nested file references (keep to one level)
  • Assuming tools are pre-installed
  • Time-sensitive information without caveats
  • Vague activation language
  • Loading everything upfront instead of progressive disclosure
  • Windows风格路径
  • 无默认值的过多选项
  • 深度嵌套的文件引用(保持在一层以内)
  • 假设工具已预先安装
  • 无说明的时效性信息
  • 模糊的激活语言
  • 一次性加载所有内容,而非渐进式披露

Bundled Resources

捆绑资源

Skills can include optional bundled resources organized in three directories:
技能可包含可选的捆绑资源,分为三个目录:

scripts/

scripts/

Executable code (Python/Bash/etc.) for tasks requiring deterministic reliability or repeatedly rewritten operations.
When to include:
  • Same code is rewritten repeatedly
  • Deterministic reliability needed
  • Complex operations benefit from pre-tested scripts
Examples from real skills:
  • PDF skill:
    fill_fillable_fields.py
    ,
    extract_form_field_info.py
    - PDF manipulation utilities
  • DOCX skill:
    document.py
    ,
    utilities.py
    - document processing modules
  • This skill:
    init_skill.py
    - creates new skills from template,
    quick_validate.py
    - validates skill structure
Benefits:
  • Token efficient (can execute without loading into context)
  • Deterministic behavior
  • Reusable across multiple invocations
Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments.
可执行代码(Python/Bash等),用于需要确定性可靠性或重复编写的操作。
何时包含:
  • 相同代码需要重复编写时
  • 需要确定性可靠性时
  • 复杂操作可受益于预测试脚本时
真实技能中的示例:
  • PDF技能:
    fill_fillable_fields.py
    extract_form_field_info.py
    - PDF处理工具
  • DOCX技能:
    document.py
    utilities.py
    - 文档处理模块
  • 本技能:
    init_skill.py
    - 从模板创建新技能,
    quick_validate.py
    - 验证技能结构
优势:
  • 高效使用token(无需加载到上下文即可执行)
  • 行为确定
  • 可在多次调用中复用
注意: 脚本可能仍需被Claude读取,以进行补丁或环境特定调整。

references/

references/

Documentation and reference material loaded into context to inform Claude's process and thinking.
When to include:
  • Documentation Claude should reference while working
  • Information too lengthy for main SKILL.md
  • Domain-specific knowledge, schemas, or specifications
Examples from real skills:
  • Product management:
    communication.md
    ,
    context_building.md
    - detailed workflow guides
  • BigQuery: API reference documentation and query examples
  • Finance:
    finance.md
    - schemas,
    mnda.md
    - NDA template,
    policies.md
    - company policies
Benefits:
  • Keeps SKILL.md lean and focused
  • Loaded only when Claude determines it's needed
  • Supports progressive disclosure
Best practice: If files are large (>10k words), include grep search patterns in SKILL.md to help Claude find specific sections.
加载到上下文中的文档和参考资料,用于指导Claude的流程和思考。
何时包含:
  • Claude在工作中需要参考的文档
  • 内容过长,不适合放入主SKILL.md的信息
  • 领域特定知识、架构或规范
真实技能中的示例:
  • 产品管理:
    communication.md
    context_building.md
    - 详细的工作流程指南
  • BigQuery:API参考文档和查询示例
  • 财务:
    finance.md
    - 架构,
    mnda.md
    - NDA模板,
    policies.md
    - 公司政策
优势:
  • 保持SKILL.md简洁聚焦
  • 仅在Claude确定需要时加载
  • 支持渐进式披露
最佳实践: 如果文件过大(超过10k字),请在SKILL.md中包含grep搜索模式,帮助Claude找到特定部分。

assets/

assets/

Files not loaded into context, but used within the output Claude produces.
When to include:
  • Files needed in final output
  • Templates to be copied or modified
  • Boilerplate code or starter projects
Examples from real skills:
  • Brand guidelines:
    logo.png
    ,
    slides_template.pptx
    - brand assets
  • Frontend builder:
    hello-world/
    - HTML/React boilerplate directory
  • Typography:
    font.ttf
    ,
    font-family.woff2
    - font files
Common asset types:
  • Templates: .pptx, .docx, boilerplate directories
  • Images: .png, .jpg, .svg
  • Fonts: .ttf, .otf, .woff, .woff2
  • Boilerplate code: project directories, starter files
  • Data files: .csv, .json, .xml, .yaml
Benefits:
  • Separates output resources from documentation
  • Enables Claude to use files without loading into context
  • Provides consistent starting points for generated content
不加载到上下文中,但在Claude生成的输出中使用的文件。
何时包含:
  • 最终输出中需要的文件
  • 可复制或修改的模板
  • 样板代码或启动项目
真实技能中的示例:
  • 品牌指南:
    logo.png
    slides_template.pptx
    - 品牌资产
  • 前端构建器:
    hello-world/
    - HTML/React样板目录
  • 排版:
    font.ttf
    font-family.woff2
    - 字体文件
常见资产类型:
  • 模板:.pptx、.docx、样板目录
  • 图片:.png、.jpg、.svg
  • 字体:.ttf、.otf、.woff、.woff2
  • 样板代码:项目目录、启动文件
  • 数据文件:.csv、.json、.xml、.yaml
优势:
  • 将输出资源与文档分离
  • 使Claude无需加载到上下文即可使用文件
  • 为生成内容提供一致的起点

Skill Quality Checklist

技能质量检查清单

See
references/quality-checklist.md
for the full checklist with examples.
Key requirements:
  • YAML frontmatter with valid
    name
    and
    description
    (including "what" AND "when")
  • Main content under 500 lines
  • Progressive disclosure (reference files for detailed content)
  • Changes committed to git repository
完整的检查清单及示例请参阅
references/quality-checklist.md
关键要求:
  • 包含有效的
    name
    description
    的YAML前置元数据(同时说明「功能」和「场景」)
  • 主内容不超过500行
  • 采用渐进式披露(使用参考文件而非嵌入所有内容)
  • 变更已提交到git仓库

Workflow for Creating/Updating Skills

创建/更新技能的工作流程

Creating a New Skill

创建新技能

Follow these steps in order. Skip a step only if there's a clear reason it's not applicable.
请按以下顺序执行步骤。仅当有明确理由不适用时,才可跳过步骤。

Step 1: Understanding with Concrete Examples

步骤1:通过具体示例理解需求

Clearly understand concrete examples of how the skill will be used. Skip this step only when usage patterns are already clearly understood.
Ask questions to gather specific use cases:
  • "What functionality should this skill support?"
  • "Can you give examples of how this skill would be used?"
  • "What would a user say that should trigger this skill?"
Example questions for an image-editor skill:
  • "What functionality should the image-editor skill support? Editing, rotating, anything else?"
  • "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
Important: Avoid overwhelming users with too many questions. Start with the most important and follow up as needed.
Conclude when there's a clear sense of the functionality the skill should support.
明确理解技能的具体使用示例。仅当使用模式已清晰理解时,才可跳过此步骤。
提出问题以收集具体用例:
  • "本技能应支持哪些功能?"
  • "你能举几个本技能的使用示例吗?"
  • "用户说什么话应该触发本技能?"
图像编辑器技能的示例问题:
  • "图像编辑器技能应支持哪些功能?编辑、旋转,还有其他吗?"
  • "我能想到用户会要求‘去除这张图片的红眼’或‘旋转这张图片’。你认为还有其他使用场景吗?"
重要提示: 不要用过多问题给用户造成负担。从最重要的问题开始,必要时再跟进。
当对技能应支持的功能有清晰认识时,即可进入下一步。

Step 2: Plan Reusable Resources

步骤2:规划可复用资源

Analyze each concrete example to identify what bundled resources would be helpful:
For each example, consider:
  1. How to execute it from scratch
  2. What scripts, references, and assets would make repeated execution easier
Example analyses:
PDF rotation: "Help me rotate this PDF"
  • Rotating PDFs requires rewriting the same code each time
  • → Include
    scripts/rotate_pdf.py
Frontend webapp: "Build me a todo app" or "Build me a dashboard"
  • Requires same HTML/React boilerplate each time
  • → Include
    assets/hello-world/
    template directory
BigQuery queries: "How many users logged in today?"
  • Requires re-discovering table schemas each time
  • → Include
    references/schema.md
    with table documentation
Create a list of reusable resources to include: scripts/, references/, assets/ files.
分析每个具体示例,确定哪些捆绑资源会有帮助:
针对每个示例,考虑:
  1. 如何从头执行该操作
  2. 哪些脚本、参考资料和资产可简化重复执行
示例分析:
PDF旋转: "帮我旋转这个PDF"
  • 旋转PDF每次都需要编写相同的代码
  • → 包含
    scripts/rotate_pdf.py
前端Web应用: "帮我构建一个待办事项应用"或"帮我构建一个仪表板"
  • 每次都需要相同的HTML/React样板
  • → 包含
    assets/hello-world/
    模板目录
BigQuery查询: "今天有多少用户登录?"
  • 每次都需要重新查找表结构
  • → 包含
    references/schema.md
    ,其中有表文档
创建要包含的可复用资源列表:scripts/、references/、assets/文件。

Step 3: Initialize the Skill

步骤3:初始化技能

Create the skill directory structure using the initialization script:
bash
~/.claude/skills/skill-management/scripts/init_skill.py <skill-name> --path ~/.claude/skills
The script will:
  • Create the skill directory with proper structure
  • Generate SKILL.md template with frontmatter and TODO placeholders
  • Create example files in scripts/, references/, and assets/ directories
After initialization, customize or delete the generated example files as needed.
使用初始化脚本创建技能目录结构:
bash
~/.claude/skills/skill-management/scripts/init_skill.py <skill-name> --path ~/.claude/skills
该脚本将:
  • 创建具有正确结构的技能目录
  • 生成包含前置元数据和TODO占位符的SKILL.md模板
  • 在scripts/、references/和assets/目录中创建示例文件
初始化后,可根据需要自定义或删除生成的示例文件。

Step 4: Implement Bundled Resources

步骤4:实现捆绑资源

Start by implementing the reusable resources identified in Step 2:
  • Add scripts to
    scripts/
  • Add reference documentation to
    references/
  • Add templates/assets to
    assets/
Note: This may require user input (e.g., brand assets, templates, domain documentation).
Delete any example files and directories not needed for the skill.
首先实现步骤2中确定的可复用资源:
  • 将脚本添加到
    scripts/
  • 将参考文档添加到
    references/
  • 将模板/资产添加到
    assets/
注意: 这可能需要用户输入(例如,品牌资产、模板、领域文档)。
删除技能不需要的任何示例文件和目录。

Step 5: Complete SKILL.md

步骤5:完成SKILL.md

Write SKILL.md content following the writing guidelines (imperative form, concise, focused).
Answer these questions in SKILL.md:
  1. What is the purpose of the skill? (a few sentences)
  2. When should the skill be used? (specific triggers)
  3. How should Claude use the skill in practice? (reference bundled resources)
Remember:
  • Keep under 500 lines
  • Use progressive disclosure (reference files instead of embedding everything)
  • Include concrete examples
  • Focus on information Claude doesn't already know
按照写作指南(祈使形式、简洁、聚焦)编写SKILL.md内容。
在SKILL.md中回答以下问题:
  1. 技能的用途是什么?(几句话)
  2. 何时应使用该技能?(特定触发条件)
  3. Claude在实践中应如何使用该技能?(参考捆绑资源)
注意:
  • 保持在500行以内
  • 使用渐进式披露(使用参考文件而非嵌入所有内容)
  • 包含具体示例
  • 聚焦于Claude尚不了解的信息

Step 6: Validate the Skill

步骤6:验证技能

Run the validation script to check for common issues:
bash
~/.claude/skills/skill-management/scripts/quick_validate.py ~/.claude/skills/<skill-name>
Fix any validation errors reported.
运行验证脚本检查常见问题:
bash
~/.claude/skills/skill-management/scripts/quick_validate.py ~/.claude/skills/<skill-name>
修复报告的所有验证错误。

Step 7: Test the Skill

步骤7:测试技能

Create test scenarios and verify the skill works:
  1. Ask questions that should trigger it
  2. Check if Claude invokes the skill
  3. Verify the skill provides value
  4. Adjust triggers if not invoked when expected
创建测试场景并验证技能是否正常工作:
  1. 提出应该触发技能的问题
  2. 检查Claude是否调用了技能
  3. 验证技能是否提供价值
  4. 如果未按预期触发,调整触发条件

Step 8: Commit to Repository

步骤8:提交到仓库

bash
cd ~/.claude/skills
git add skill-name/
git commit -m "Add [skill-name] skill: [brief description]

Detailed explanation of what the skill does and why it's needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"
bash
cd ~/.claude/skills
git add skill-name/
git commit -m "Add [skill-name] skill: [简要描述]

详细说明技能的功能和需求原因。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"

Updating an Existing Skill

更新现有技能

  1. Read current skill: Review SKILL.md and related files
  2. Identify improvements: Based on usage patterns or new requirements
  3. Make focused changes: Edit specific sections, maintain structure
  4. Validate changes: Run validation script to catch any issues
    bash
    ~/.claude/skills/skill-management/scripts/quick_validate.py ~/.claude/skills/<skill-name>
  5. Verify quality checklist: Ensure still meets all criteria
  6. Test changes: Verify skill still triggers correctly
  7. Commit to repository:
    bash
    cd ~/.claude/skills
    git add [skill-directory]/
    git commit -m "Improve [skill-name]: [specific changes made]
    
    Detailed explanation of changes and rationale.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>"
  1. 阅读当前技能:查看SKILL.md和相关文件
  2. 确定改进点:基于使用模式或新需求
  3. 进行针对性修改:编辑特定部分,保持结构不变
  4. 验证变更:运行验证脚本发现问题
    bash
    ~/.claude/skills/skill-management/scripts/quick_validate.py ~/.claude/skills/<skill-name>
  5. 验证质量检查清单:确保仍符合所有标准
  6. 测试变更:验证技能仍能正确触发
  7. 提交到仓库
    bash
    cd ~/.claude/skills
    git add [skill-directory]/
    git commit -m "Improve [skill-name]: [具体变更内容]
    
    详细说明变更内容和理由。
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>"

Git Repository Management

Git仓库管理

CRITICAL: Skills are version-controlled in a git repository at
~/.claude/skills/
.
关键提示: 技能在
~/.claude/skills/
的git仓库中进行版本控制。

After ANY skill modification:

任何技能修改后:

  1. Navigate to skills directory:
    cd ~/.claude/skills
  2. Check status:
    git status
  3. Add changes:
    git add [skill-directory]/
  4. Commit with descriptive message:
    bash
    git commit -m "Action [skill-name]: brief description
    
    Detailed explanation of changes and rationale.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>"
  5. Verify clean state:
    git status
  1. 导航到技能目录:
    cd ~/.claude/skills
  2. 检查状态:
    git status
  3. 添加变更:
    git add [skill-directory]/
  4. 提交并添加描述性信息:
    bash
    git commit -m "Action [skill-name]: brief description
    
    Detailed explanation of changes and rationale.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>"
  5. 验证清洁状态:
    git status

Common Git Commands

常用Git命令

bash
undefined
bash
undefined

Check current status

检查当前状态

git status
git status

See what changed

查看变更内容

git diff [file]
git diff [file]

Add specific skill

添加特定技能

git add skill-name/
git add skill-name/

Commit with message

提交并添加信息

git commit -m "message"
git commit -m "message"

View recent commits

查看最近提交

git log --oneline -5
git log --oneline -5

Push changes (if using remote)

推送变更(如果使用远程仓库)

git push
undefined
git push
undefined

Examples

示例

See
references/quality-checklist.md
for description examples and structure guidelines.
描述示例和结构指南请参阅
references/quality-checklist.md

Special Considerations

特殊考虑

Testing New Skills

测试新技能

After creating a skill, test it by:
  1. Asking a question that should trigger it
  2. Checking if Claude invokes the skill
  3. Verifying the skill provides value
  4. Adjusting triggers if not invoked when expected
创建技能后,请通过以下方式测试:
  1. 提出应该触发技能的问题
  2. 检查Claude是否调用了技能
  3. 验证技能是否提供价值
  4. 如果未按预期触发,调整触发条件

Refining Triggers

优化触发条件

If a skill isn't being invoked when it should:
  • Add more specific trigger phrases to description
  • Use "proactively when" language
  • List explicit keywords and contexts
  • Consider if scope is too narrow or too broad
如果技能未在应触发时触发:
  • 在描述中添加更具体的触发短语
  • 使用「主动使用」的表述
  • 列出明确的关键词和上下文
  • 考虑范围是否过窄或过宽

Documentation References

文档参考

Reminder

提醒

DO NOT FORGET: After making any changes to skills in
~/.claude/skills/
, you MUST commit them to the git repository. This ensures changes are tracked and can be shared/synced. The skills directory is version-controlled specifically for this purpose.
请勿忘记: 修改
~/.claude/skills/
中的技能后,必须将变更提交到git仓库。这可确保变更被跟踪,并可共享/同步。技能目录专门为此进行了版本控制。