> **来源:[研报客](https://pc.yanbaoke.cn)** # Summary of "The Complete Guide to Building Skills for Claude" ## Core Content This guide provides a comprehensive overview of how to build and deploy **skills** for **Claude**, which are specialized folders that teach Claude how to handle specific tasks or workflows. Skills are a powerful way to customize Claude's behavior, allowing for consistent, reliable, and optimized use of workflows and tools. ## Main Points - **Skills** are folders with a specific structure that include: - `SKILL.md` (required): Contains YAML frontmatter and Markdown instructions. - `scripts/` (optional): Executable code for automation. - `references/` (optional): Additional documentation. - `assets/` (optional): Templates, fonts, icons, etc. - **Three-level progressive disclosure**: - Level 1: YAML frontmatter (always loaded in system prompt). - Level 2: `SKILL.md` body (loaded when skill is relevant). - Level 3: Linked files (discovered as needed). - **Composability** and **portability** are key design principles: - Skills can be used alongside other skills. - They work across Claude.ai, Claude Code, and the API. - **Skills + MCP**: - Skills add a **knowledge layer** on top of MCP integrations. - They help turn raw tool access into reliable workflows by embedding domain expertise and best practices. ## Key Use Cases There are three main categories of skills: ### Category 1: Document & Asset Creation - **Purpose**: Create consistent, high-quality output such as documents, presentations, code, etc. - **Techniques**: - Embed style guides and brand standards. - Use template structures. - Include quality checklists. ### Category 2: Workflow Automation - **Purpose**: Multi-step processes that benefit from consistent methodology. - **Techniques**: - Step-by-step workflows with validation gates. - Built-in review and improvement suggestions. - Iterative refinement loops. ### Category 3: MCP Enhancement - **Purpose**: Enhance the tool access provided by an MCP server. - **Techniques**: - Coordinate multiple MCP calls in sequence. - Provide context that users would otherwise need to specify. - Implement error handling for common issues. ## Technical Requirements - **File structure**: ```txt your-skill-name/ - SKILL.md - scripts/ - references/ - assets/ ``` - **SKILL.md naming**: - Must be exactly `SKILL.md` (case-sensitive). - Folder name should be in **kebab-case** (no spaces, capitals, or underscores). - **YAML frontmatter**: - Must include **name** and **description**. - Description should include: - What the skill does. - When to use it (trigger conditions). - Specific tasks users might say. - Mention file types if relevant. - Avoid XML tags and reserved names like "claude" or "anthropic". - **Other optional fields**: - `license` (e.g., MIT, Apache-2.0). - `compatibility` (environment requirements). - `metadata` (author, version, etc.). ## Testing and Iteration - **Testing approaches**: - **Manual testing** in Claude.ai. - **Scripted testing** in Claude Code. - **Programmatic testing** via the skills API. - **Recommended testing areas**: 1. **Triggering tests**: Ensure skill loads at the right times. 2. **Functional tests**: Verify correct outputs and error handling. 3. **Performance comparison**: Compare results with and without the skill. - **Iteration based on feedback**: - Use the **skill-creator skill** to help design and refine skills. - Adjust based on under-triggering or over-triggering signals. - Improve instructions and add error handling for execution issues. ## Distribution and Sharing - **How to distribute**: - Host on **GitHub** with a public repo and clear README. - Add a section to your **MCP documentation** linking to the skill. - Provide an **installation guide** for users to upload the skill. - **When to use API vs. Claude.ai**: - **Claude.ai / Claude Code**: For end users, manual testing, and ad-hoc workflows. - **API**: For applications, production deployments, and automated pipelines. - **Skill-creator tool**: - Helps generate skills from natural language. - Suggests trigger phrases and structure. - Does not execute automated test suites or provide quantitative results. ## Patterns and Troubleshooting - **Common patterns**: 1. **Sequential workflow orchestration**: For multi-step processes. 2. **Multi-MCP coordination**: For workflows spanning multiple services. 3. **Iterative refinement**: For improving output quality through multiple passes. 4. **Context-aware tool selection**: Choose the best tool based on context. 5. **Domain-specific intelligence**: Add specialized knowledge beyond tool access. - **Troubleshooting tips**: - **Skill won't upload**: Ensure `SKILL.md` is named correctly. - **Invalid frontmatter**: Check YAML formatting and use delimiters. - **Skill doesn't trigger**: Revise the description to include specific trigger phrases. - **Skill triggers too often**: Add negative triggers to the description. ## Conclusion This guide emphasizes the importance of **clear, actionable descriptions**, **well-structured instructions**, and **effective testing and iteration** in building skills for Claude. It also highlights the benefits of combining skills with MCP integrations to enhance functionality and user experience. The guide is structured for both **standalone skill creators** and **MCP builders**, with practical examples and a focus on real-world use cases.