AgentSkillsCN

skill-development

当用户询问“创建技能”、“编写 SKILL.md”、“技能前言”、“技能描述”、“触发短语”,或需要关于以渐进式披露方式编写技能的指导时,应使用此技能。

SKILL.md
--- frontmatter
name: skill-development
description: This skill should be used when the user asks to "create a skill",
  "write SKILL.md", "skill frontmatter", "skill description", "trigger phrases",
  or needs guidance on writing skills with progressive disclosure.
version: 0.3.1

Skill Development

Guide for writing effective SKILL.md files with proper structure and triggers.

Skill Structure

code
skill-name/
├── SKILL.md           # Required: main instructions
├── references/        # Detailed docs (loaded as needed)
├── examples/          # Working code samples
└── scripts/           # Utility scripts

SKILL.md Format

yaml
---
name: skill-name
description: This skill should be used when the user asks to "action X",
  "do Y", "configure Z", or needs guidance on [topic].
version: 1.0.0
---

# Skill Title

Skill body content here (markdown).

Frontmatter Fields

FieldPurpose
nameDisplay name (defaults to directory)
descriptionTrigger phrases for auto-loading
versionSkill version
disable-model-invocationManual only (no auto-load)
user-invocableSet false for Claude-only
allowed-toolsAuto-approved tools
context: forkRun in subagent
modelModel override

Description Format (Critical)

Always use third-person with specific trigger phrases:

Good:

yaml
description: This skill should be used when the user asks to "create a hook",
  "add a PreToolUse hook", "validate tool use", or mentions hook events
  (PreToolUse, PostToolUse, Stop).

Bad:

yaml
description: Use this skill for hooks.  # Not third person
description: Helps with hook development.  # No triggers

Progressive Disclosure

LocationContentTarget
DescriptionTrigger phrases~100 words
SKILL.md bodyCore concepts1,000-1,500 words
references/Details, API docs2,000-5,000+ words
examples/Working codeAs needed

Best practice: Keep SKILL.md concise. Move details to references/.

Quality Review

After creating a skill, use the skill-reviewer agent:

code
Review my skill at ./skills/my-skill

It checks:

  • Description quality and triggers
  • Word count and progressive disclosure
  • Writing style and structure
  • Reference file existence

String Substitutions

VariableDescription
$ARGUMENTSAll arguments
$NArgument by position
${CLAUDE_SESSION_ID}Current session

Writing Style

  • Imperative: "Create the hook" not "You should create"
  • Third-person in description
  • Specific trigger phrases
  • Concrete examples

Linking Skills

markdown
For related topics:
- **/plugin-name:other-skill** - Description

Checklist

  • Description is third-person
  • Description has trigger phrases
  • SKILL.md < 1,500 words
  • Details in references/
  • Imperative writing style
  • Name matches directory