Skills Basic Structure |
\\n\\nThe core essence of Skills is to provide standardized execution process guidelines for AI. Once written, rules can be repeatedly invoked and directly reused, just like program functions.
\\n\\nSkills are stored as Markdown text and do not execute functionality directly.
\\n\\nWith their on-demand loading and progressive invocation characteristics, Skills efficiently accumulate work experience, enabling rapid reuse and precise transfer of capabilities.
\\n\\n\\n\\n
Skill Core Structure
\\n\\nThe core of Skills is: one folder + one SKILL.md file.
\\n\\nThe SKILL.md file contains:
\\n\\n- \\n
- Metadata (must include at least name and description) \\n
- Instructions telling the AI how to complete a specific task \\n
A Skill is essentially a Markdown file (filename fixed as SKILL.md)
\\n\\nmy-skill/\\nβββ SKILL.md (the only required file)\\n\\n\\nSKILL.md Basic Template:
\\n\\n---\\nname: your-skill-name\\ndescription: Describe the capabilities and use scenarios of This Skill in one sentence\\n---\\n# Skill Name\\n## UseGuidelines\\n\\n## Example\\n\\n\\n\\nThe entire SKILL.md is divided into two parts: the YAML frontmatter (header configuration) wrapped by ---, and the Markdown body below (execution instructions).
| Field | \\nRequired | \\nDescription | \\nExample | \\n
|---|---|---|---|
name | \\n Yes | \\nUnique identifier for the Skill, using kebab-case naming. Referenced by the / command and critical for system Skill recognition. | \\n web-design-guidelines | \\n
description | \\n Yes | \\nOne-sentence description of functionality and trigger scenarios. More specific content leads to more accurate triggering. | \\nUI/UX design review for web pages | \\n
Next, we break down each part individually:
\\n\\nFrontmatter: Two Required Fields
\\n\\nFrontmatter is the YAML configuration block wrapped by --- at the top of SKILL.md, representing the Skillβs identity information.
The official specification defines only two required fields:
\\n\\nField 1: name (Skill Name)
\\n\\nThe name field can be up to 64 characters long and may only contain lowercase letters, digits, and hyphens.
name: processing-pdfs # Good: gerund form, clearly describes functionality\\nname: analyzing-spreadsheets # Good: purpose is immediately clear\\nname: my-brand-guidelines # Good: organization-specific knowledge\\nname: helper # Bad: too vague\\nname: MySkill # Bad: contains uppercase letters (non-compliant)\\nname: data files # Bad: contains spaces (non-compliant)\\n\\n\\nIt is recommended to use gerund forms (verb + -ing) for naming, such as processing-pdfs and analyzing-spreadsheets, to clearly describe the activity or capability provided by the Skill.
| Recommended | \\nNot Recommended | \\nReason | \\n
|---|---|---|
code-reviewer | \\n CodeReviewer | \\n Use lowercase and hyphens consistently to avoid cross-platform compatibility issues | \\n
sql-optimizer | \\n sql_optimizer | \\n Kebab-case is the conventional format and aligns with directory naming | \\n
deploy-check | \\n deploy-check-tool-v2 | \\n Names should be concise; version info belongs in internal documentation | \\n
Field 2: description (Trigger Condition Description)
\\n\\nThis is the most important field. During startup, the system only preloads all Skillsβ name and description into the system prompt.
Only when the description is judged by the AI to be relevant to the current task will the full SKILL.md content be loaded.
The description should include two parts: what this Skill does and when Claude should use it.
description: |\\n Use when the user needs to create, read, edit, or generate Word documents (.docx). Triggers include: 'Word doc', 'word document', '.docx', 'report', 'letter', 'memo', or any request to produce a formatted document for sharing or printing.\\n\\n\\nMarkdown Body: Internal Structure of Execution Instructions
\\n\\n| Recommended | \\nNot Recommended | \\nReason | \\n
|---|---|---|
| γScan Python code for SQL injection risks and provide remediation suggestionsγ | \\nγA security toolγ | \\nDescription too vague to trigger accurately | \\n
| γConvert Markdown into brand-compliant HTML emailsγ | \\nγConvert file formatsγ | \\nLacks specific context; may be mistakenly triggered in other tasks | \\n
After the frontmatter comes the Markdown body, which tells the AI how to perform the task.
\\n\\nIt must contain at least two sections:
\\n\\nSKILL.md Example
\\n\\nSKILL.md Basic Template:
\\n\\n---\\nname: pdf-processing\\ndescription: From PDF Extract text and tables, fill out forms, and merge documents\\n---\\n# PDF Handle.\\n## UseScenarios\\nUse when operations on PDF files are required, for example:\\n- Extract text or table data from PDFs\\n- Fill out PDF forms\\n- Merge multiple PDF files\\n\\n## Extract text\\n- Use `pdfplumber` Extract content from text-based PDFs\\n- Scanned PDFs require OCR tools\\n\\n## Fill out forms\\n- Read PDF form fields\\n- Populate and generate new files based on input data\\n\\n\\nMinimum Required Example:
\\n\\n---\\nname: skill-name\\ndescription: Describe the capabilities of This Skill and applicable scenarios\\n---\\n\\n\\nExample with Optional Fields:
\\n\\n---\\nname: pdf-processing\\ndescription: From PDF Extract text and tables, fill out forms, and merge documents\\nlicense: Apache-2.0\\nmetadata:\\n author: example-org\\n version: "1.0"\\n---\\n\\n\\nField Descriptions:
\\n\\n| Field | \\nRequired | \\nDescription | \\n
|---|---|---|
name | \\n Yes | \\nSkill name, up to 64 characters, only lowercase letters, digits, and - allowed; cannot start or end with - | \\n
description | \\n Yes | \\nFunctionality and usage scenario description, up to 1024 characters, cannot be empty | \\n
license | \\n No | \\nLicense name or path to the license file bundled with the Skill | \\n
compatibility | \\n No | \\nEnvironment and dependency description (products, system packages, network permissions, etc.), up to 500 characters | \\n
metadata | \\n No | \\nCustom key-value pairs for extending metadata (e.g., author, version number) | \\n
allowed-tools | \\n No | \\nList of allowed tools (space-separated; experimental feature) | \\n
\\n\\n
Skill File Directory Structure
\\n\\nEach Skill is a folder containing at least one SKILL.md file. Additional directories and files may be added as needed.
To avoid context bloat:
\\n\\n- \\n
- Core rules β
SKILL.md\\n - Detailed materials β separate files \\n
- Practical logic β script execution (not loaded) \\n
Recommended Structure:
\\n\\nmy-skill/\\nβββ SKILL.md # Required: metadata + instructions\\nβββ scripts/ # Optional: executable code\\nβ βββ helper.py\\nβββ references/ # Optional: reference documents\\nβββ assets/ # Optional: templates, resources\\nβββ ... # Other files or directories\\n\\n\\nDirectory purposes:
\\n\\n- \\n
- SKILL.md: Required file containing the Skillβs metadata and execution instructions \\n
- scripts/: Optional directory containing executable code the agent can run \\n
- references/: Optional directory containing detailed reference materials \\n
- assets/: Optional directory containing static resources such as templates and images \\n
YouTip