Skills 系统(Claude Code)

Skills 是 Claude Code 的可复用能力包。它通过 progressive loading 把复杂领域知识拆成多层级,让 Claude 在需要时自动加载相关说明与资源。
Skills 是什么
- Skills 是一组 指令 + 资源 + 脚本 的组合
- 不需要显式调用,Claude 会根据任务自动触发
- 适合沉淀团队最佳实践或内部流程
核心机制(Key Capabilities)
- Automatic Activation(自动触发)
- Progressive Context Loading(分层加载:metadata → SKILL.md → resources/scripts)
- Domain Expertise Packaging(领域知识与流程打包)
- Filesystem-Based(以目录方式存在)
- Executable Scripts Support(可直接执行脚本)
安装示例(Installation)
npx claude-code-templates@latest --skill=development/skill-creator
安装后目录结构:
your-project/
├── .claude/
│ └── skills/
│ └── my-skill/
│ ├── SKILL.md
│ └── scripts/
│ └── helper.py
使用方式(How Skills Work)
claude
> Review this code for security vulnerabilities
如果安装了 code-review 相关 Skill,Claude 会自动加载对应的 SKILL.md 与资源文件,不需要手动点名。
示例(Usage Examples)
PDF 处理
claude
> Extract text from this PDF and create a summary
数据库 Schema
claude
> Write a query to get all users with pending orders
API 集成
claude
> Show me how to authenticate with the Stripe API