example-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Example Skill

示例Skill

This skill demonstrates the structure and format for Claude Code plugin skills.
此Skill展示了Claude Code插件Skills的结构和格式。

Overview

概述

Skills are model-invoked capabilities that Claude autonomously uses based on task context. Unlike commands (user-invoked) or agents (spawned by Claude), skills provide contextual guidance that Claude incorporates into its responses.
Skills是模型调用的能力,Claude会根据任务上下文自主使用。与命令(用户调用)或Agent(由Claude生成)不同,Skills提供上下文指导,Claude会将其融入响应中。

When This Skill Applies

此Skill的适用场景

This skill activates when the user's request involves:
  • Creating or understanding plugin skills
  • Skill template or reference needs
  • Skill development patterns
当用户的请求涉及以下内容时,将激活此Skill:
  • 创建或理解插件Skills
  • 需要Skill模板或参考示例
  • 讨论技能开发模式

Skill Structure

Skill结构

Required Files

必需文件

skills/
└── skill-name/
    └── SKILL.md          # Main skill definition (required)
skills/
└── skill-name/
    └── SKILL.md          # 主要Skill定义(必需)

Optional Supporting Files

可选支持文件

skills/
└── skill-name/
    ├── SKILL.md          # Main skill definition
    ├── README.md         # Additional documentation
    ├── references/       # Reference materials
    │   └── patterns.md
    ├── examples/         # Example files
    │   └── sample.md
    └── scripts/          # Helper scripts
        └── helper.sh
skills/
└── skill-name/
    ├── SKILL.md          # 主要Skill定义
    ├── README.md         # 附加文档
    ├── references/       # 参考资料
    │   └── patterns.md
    ├── examples/         # 示例文件
    │   └── sample.md
    └── scripts/          # 辅助脚本
        └── helper.sh

Frontmatter Options

前置元数据选项

Skills support these frontmatter fields:
  • name (required): Skill identifier
  • description (required): Trigger conditions - describe when Claude should use this skill
  • version (optional): Semantic version number
  • license (optional): License information or reference
Skills支持以下前置元数据字段:
  • name(必需):Skill标识符
  • description(必需):触发条件 - 描述Claude应何时使用此Skill
  • version(可选):语义化版本号
  • license(可选):许可证信息或参考

Writing Effective Descriptions

编写有效描述的方法

The description field is crucial - it tells Claude when to invoke the skill.
Good description patterns:
yaml
description: This skill should be used when the user asks to "specific phrase", "another phrase", mentions "keyword", or discusses topic-area.
Include:
  • Specific trigger phrases users might say
  • Keywords that indicate relevance
  • Topic areas the skill covers
描述字段至关重要——它告诉Claude何时调用此Skill。
良好的描述模式:
yaml
description: This skill should be used when the user asks to "specific phrase", "another phrase", mentions "keyword", or discusses topic-area.
应包含:
  • 用户可能会说的特定触发短语
  • 表明相关性的关键词
  • Skill涵盖的主题领域

Skill Content Guidelines

Skill内容指南

  1. Clear purpose: State what the skill helps with
  2. When to use: Define activation conditions
  3. Structured guidance: Organize information logically
  4. Actionable instructions: Provide concrete steps
  5. Examples: Include practical examples when helpful
  1. 明确用途:说明此Skill能提供什么帮助
  2. 使用场景:定义激活条件
  3. 结构化指导:逻辑组织信息
  4. 可操作说明:提供具体步骤
  5. 示例:如有帮助,包含实用示例

Best Practices

最佳实践

  • Keep skills focused on a single domain
  • Write descriptions that clearly indicate when to activate
  • Include reference materials in subdirectories for complex skills
  • Test that the skill activates for expected queries
  • Avoid overlap with other skills' trigger conditions
  • 保持Skills专注于单一领域
  • 编写能明确指示激活时机的描述
  • 对于复杂Skills,在子目录中包含参考资料
  • 测试Skill是否能对预期查询做出响应
  • 避免与其他Skills的触发条件重叠