0
—
In review
Synced today
What it does
--- ## 2.1 Skill 的本质 Skill 是一段**有名字的提示词(Prompt)**,通过 `/skill-name` 触发。 ``` /commit → 展开为一段精心设计的提示词 → Claude 按这个提示词执行 ``` 你可以把 Skill 理解为:**给 Claude 的工作说明书**。 --- ## 2.2 为什么需要 Skill? **没有 Skill 时**: ``` 你每次都要说:"帮我写一个规范的 git commit,要用 conventional commit 格式, 中英文都要有,要分析改动内容..." ``` **有了 /commit Skill**: ``` 你只需要说:/commit ``` Skill 的价值: - 把重复的指令封装起来 - 保持输出质量的一致性 - 降低使用门槛 --- ## 2.3 Skill 文件结构 ``` ~/.claude/skills/ ← 全局:所有项目都能用 项目根目录/.claude/skills/ ← 项目级:只在这个项目生效 ``` 每个 Skill 是一个 Markdown 文件: ```mark
Skill profile
Keep exploring
More options in Dev Tools.
Claude Code · Codex · OpenClaw
HTML
Updated 3/2/2026
Agent compatibility
Compatibility has not been reviewed for this listing yet. Check the publisher documentation before installing.
Installation
npx skills add https://github.com/Tlanhan/agent-lessons --skill module2-what-is-skill.mdReview source code and installation permissions before adding third-party tools to an agent.
Module 2:什么是 Skill? is organized in the Dev Tools category. Compare its source, install method, and compatibility before adding it to your workflow.
Third-party agent tools may access source code, credentials, or browser sessions. Read the source documentation and use the minimum permissions needed.
npx skills add https://github.com/Tlanhan/agent-lessons --skill module2-what-is-skill.mdSKILL.md
---
marp: true
theme: agent-course
paginate: true
---
<!-- _class: title-slide -->
# Module 2:什么是 Skill?
---
## 2.1 Skill 的本质
Skill 是一段**有名字的提示词(Prompt)**,通过 `/skill-name` 触发。
```
/commit → 展开为一段精心设计的提示词 → Claude 按这个提示词执行
```
你可以把 Skill 理解为:**给 Claude 的工作说明书**。
---
## 2.2 为什么需要 Skill?
**没有 Skill 时**:
```
你每次都要说:"帮我写一个规范的 git commit,要用 conventional commit 格式,
中英文都要有,要分析改动内容..."
```
**有了 /commit Skill**:
```
你只需要说:/commit
```
Skill 的价值:
- 把重复的指令封装起来
- 保持输出质量的一致性
- 降低使用门槛
---
## 2.3 Skill 文件结构
```
~/.claude/skills/ ← 全局:所有项目都能用
项目根目录/.claude/skills/ ← 项目级:只在这个项目生效
```
每个 Skill 是一个 Markdown 文件:
```markdown
---
name: "skill-name"
description: "触发条件描述"
---
# 正文:给 Claude 的工作说明书
```
---
## 2.4 两种触发方式
| 类型 | 触发方式 | 谁决定用 |
|------|---------|---------|
| 用户调用型 | `/commit`、`/simplify` | 你主动输入 |
| 自动识别型 | 说"帮我审查代码",Claude 自动判断 | Claude 匹配 description |
---
## 2.5 Skill 和 Agent 的关系
```
Skill ──触发──→ Claude(LLM)──使用──→ 工具(Bash/Read/Write...)
↑
这个整体 = Agent
```
Skill 是 **给 Agent 的任务说明**。
> **核心认知**:SKILL.md 不是给人看的文档,是和 Claude 的对话。
> 写 Skill = 用自然语言说服 Claude 按你的方式做事。
skill
mattpocock
A tool that automates setting up Husky pre-commit hooks with lint-staged, Prettier formatting, type checking, and tests in a code repository.