返回播客Claude
Claude Code skills
什么是 skill?
Every time you explain your team's coding standards to Claude, you're repeating yourself.
每次向 Claude 解释团队编码规范,你都在重复自己。
Every PR review, you redescribe how you want feedback [music] structured.
每次 PR review,你都要重新描述想要的反馈 [音乐] 格式。
Every commit message, you remind Claude of your preferred format.
每条 commit message,你都在提醒 Claude 格式。
And skills fix this.
技能解决了这个问题。
A skill is a markdown file that teaches Claude how [music] to do something once, and Claude applies that knowledge automatically whenever it's relevant.
技能是个 markdown 文件,[音乐] 教 Claude 做一件事,之后在相关场景自动应用。
Agent skills are folders of instructions, scripts, and resources that agents can discover and use to do things more accurately and efficiently.
Agent 技能是指令、脚本和资源的集合,agent 可以发现并使用它们,从而更准确、高效地完成任务。
With Claude Code, we have the skill.md file.
Claude Code 中的技能配置文件是 skill.md。
The description is how Claude decides whether to use the skill.
描述字段决定 Claude 是否调用该技能。
When you ask Claude to review this PR, it matches your request against available skill descriptions and finds this one.
当你让 Claude review 这个 PR 时,它会将请求与可用技能的描述进行匹配,找到对应的技能。
Claude reads your request, compares it to all available skill descriptions, and activates the ones that match.
Claude 读取请求,与所有可用技能描述对比,并激活匹配的技能。
You can store skills in a few places depending on who needs them.
你可以根据使用者的需要,将技能存放在不同位置。
Personal skills go in the home directory .claude/skills and follow you across all your project.
个人技能存放在主目录 .claude/skills 下,在所有项目中跟随你。
These are your preferences, your commit message style, your documentation format, how you like code explained.
这里存放你的偏好:commit message 风格、文档格式、代码解释方式。
Project skills go in the .claude/skills inside of the root directory of your repository.
项目技能存放在仓库根目录下的 .claude/skills 中。
Anyone who clones the repository gets these skills automatically.
克隆仓库的任何人都会自动获得这些技能。
This is where team standards live, like your company's brand guidelines, preferred fonts, and colors that you use for web design.
团队规范存放在这里,例如公司品牌指南、首选字体和网页设计配色。
Claude Code has several ways to customize behavior.
Claude Code 有多种自定义行为的方式。
Skills are unique because they're automatic and task-specific.
技能的独特之处在于它是自动触发且任务专属的。
Claude.md files load into every conversation.
Claude.md 文件会加载到每次对话中。
If you want Claude to always use TypeScript strict mode, that goes in your claw.md file.
始终使用 TypeScript strict 模式?在 Claude.md 中设置即可。
Skills, on the other hand, load on demand when they match your request.
而技能则按需加载,在匹配你的请求时才会激活。
It only loads in the name and description, so it doesn't fill up your entire context window.
技能只加载名称和描述,不会填满整个上下文窗口。
Your PR review checklist doesn't need to be in the context when you're debugging.
调试时,PR review 清单不需要出现在上下文中。
It loads when you actually ask for a review.
只有当你真正要求 review 时,它才会加载。
Slash commands require you to type them.
Slash 命令需要你手动输入。
Skills don't.
技能不需要。
Claude applies them when it recognizes the situation.
Claude 识别场景后会自动应用技能。
Skills work best for specialized knowledge that applies to specific tasks.
技能最适合用于特定任务的专业知识。
Code review standards your team follows, commit message formats that you prefer, brand guidelines of your organization.
团队的代码 review 规范、你偏好的 commit message 格式、组织的品牌指南。
If you find yourself explaining the same thing [music] to Claude repeatedly, well, that's a skill waiting to be written.
如果你发现自己反复向 Claude 解释同一件事,[音乐] 那就是一个等待被编写的技能。