最近 Claude 在 github 上有一个比较火的项目:https://github.com/anthropics/skills,项目是围绕新概念 Skills,我觉得实际上是:通过工程化结构来实现智能体,用一种工程范式来完成子功能,就像C++代码中提出一种更好的设计模式来解决通用问题。
SkillsSkills 是一组由说明文档、脚本与资源组成的 “技能包”,Claude 会在需要时动态加载,用于提升在特定任务上的一致性与表现,借助 Skills,Claude 能以可复用的方式完成某类任务,例如:按公司品牌规范创作文档、按组织特定流程分析数据,或自动化个人工作流。

Skills 如何工作Skills 通过 “逐步迭代” 的方式工作:当你发起任务时,Claude 会审视可用 Skills,自动挑选相关的技能并只加载完成任务所需的指令与资源,这样既能提升速度与效果,也能避免将无关内容塞满上下文窗口,从而保持对话与计算的高效与稳定。
核心机制:
Skills 中进行匹配与选择优势:
Skills,如需更高级功能,可为自定义技能附加可执行脚本Skills 组合迭代处理SKILL.md 模版文件:
---
name: my-skill-name
description: A clear description of what this skill does and when to use it
---
# My Skill Name
[Add your instructions here that Claude will follow when this skill is active]
## Examples
- Example usage 1
- Example usage 2
## Guidelines
- Guideline 1
- Guideline 2
Skills vs. Projects:
Skills vs. MCP(Model Context Protocol):
Skills:提供 “如何完成任务” 的流程性知识与操作步骤Skills 负责教会 Claude 如何有效使用这些工具Skills vs. Prompt
Skills:面向特定任务,仅在相关时加载,更适合专业工作流与场景化流程Skills 目录结构Skills 目录结构如下:
my-skill/
├── SKILL.md (required)
├── reference.md (optional documentation)
├── examples.md (optional examples)
├── scripts/
│ └── helper.py (optional utility)
└── templates/
└── template.txt (optional template)
Skills 目录与 SKILL.md 文件Skills 至少包含一个目录和其中的 SKILL.md 文件SKILL.md 顶部必须以 YAML frontmatter 开始,至少包含 name 与 description 两个必填元数据字段SKILL.md 的正文SKILL.md样例:
---
name: Brand Guidelines
description: Apply Acme Corp brand guidelines to all presentations and documents, including official colors, fonts, and logo usage.
version: 1.0.0
dependencies: []
---
# Overview
This Skill provides Acme Corp's official brand guidelines for creating consistent, professional materials. When creating presentations, documents, or marketing materials, apply these standards to ensure all outputs match Acme's visual identity. Claude should reference these guidelines whenever creating external-facing materials or documents that represent Acme Corp.
## Brand Colors
- Primary: #FF6B35 (Coral)
- Secondary: #004E89 (Navy Blue)
- Accent: #F7B801 (Gold)
- Neutral: #2E2E2E (Charcoal)
## Typography
- Headers: Montserrat Bold
- Body text: Open Sans Regular
- Size guidelines:
- H1: 32pt
- H2: 24pt
- Body: 11pt
## Logo Usage
- Use the full-color logo on light backgrounds; use the white logo on dark backgrounds.
- Maintain minimum spacing of 0.5 inches around the logo.
## When to Apply
Apply these guidelines when creating:
- PowerPoint presentations
- Word documents for external sharing
- Marketing materials
- Client-facing reports
## Examples
- Input: “Create a 10-slide pitch deck for Acme Corp’s new product.”
- Output: A PPT with the above colors, fonts, logo rules, and spacing applied consistently.
## Resources
See the resources folder for logo files and font downloads.
Skill 涉及的资源SKILL.md 需要引入的资源文件
SKILL.md 中引用这些文件,Claude 将按需加载,减少无关内容占用可执行脚本
Skill 可附带可执行代码文件,供 Claude 调用以完成复杂任务(例如文档批量处理、数据清洗、可视化等)Skill 时可从标准仓库安装依赖(Python PyPI、JavaScript npm)
上传前:
SKILL.md,确保指令清晰、步骤完备上传到 Claude 后:
Skills 才是好 “Skill”Claude Skills 官方示例Claude 官方提供 https://github.com/anthropics/skills 20+个样例,本文就拆解其中一个比较常用的,自动执行 Web 应用程序测试 ,目录结构如下:
webapp-testing/
├── SKILL.md
├── scripts/
│ └── with_server.py
└── examples/
└── console_logging.py
└── element_discovery.py
└── static_html_automation.py
根据 description 介绍当前功能,用于使用 Playwright 交互和测试本地 Web 应用程序的工具包,支持验证前端功能、调试 UI 行为、捕获浏览器截图以及查看浏览器日志。
---
name: webapp-testing
description: Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
license: Complete terms in LICENSE.txt
---
这部分是正文重点的部分,介绍当前决策树的工作流,不过我觉得用时序图,EARS等也可以,只要能介绍清楚每个步骤需要做什么。
## Decision Tree: Choosing Your Approach
User task → Is it static HTML?
├─ Yes → Read HTML file directly to identify selectors
│ ├─ Success → Write Playwright script using selectors
│ └─ Fails/Incomplete → Treat as dynamic (below)
│
└─ No (dynamic webapp) → Is the server already running?
├─ No → Run: python scripts/with_server.py --help
│ Then use the helper + write simplified Playwright script
│
└─ Yes → Reconnaissance-then-action:
1. Navigate and waitfor networkidle
2. Take screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectors
这部分主要是介绍脚本怎么使用,脚本执行前需要做什么,脚本执行后需要做什么等,如下:
## Example: Using with_server.py
To start a server, run `--help` first, then use the helper:
...
其他部分就是包括一些流程需要的细节,注意事项,涉及的一些文件是做什么的等介绍,如下:
## Reconnaissance-Then-Action Pattern
...
## Common Pitfall
...
## Best Practices
...
## Reference Files
...
Claude Skills 是提供了一种工程范式,以前大家通过各种 MCP,Agent 等将功能组合起来,中间层通过 Prompt 粘合,一方面不容易维护和继承,另一方面没有规范会导致不稳定,但是 Skills 通过工程范式约束很大程度上解决 AI 项目的工程化问题;
同时每一个 Skills 文件夹就是小的 Agent,这些 Skills 又可以组合为一个复杂的 Agent,就像我们写代码一样,先有基础库,然后通过基础库再组合复杂工程逻辑,这个大概是就是从混沌到规范化的历程。
(1)https://github.com/anthropics/skills (2)https://docs.claude.com/zh-CN/docs/claude-code/skills