收编 · Skills、命令、风格与工位Codify · Skills, Commands, Styles, and Your Workspace.
本章跑通的一件事:把你本周重复三次的那套流程,收编成一个能一键唤起的 skill —— 带触发条件、带预批权限、带动态注入的实时数据。收完流程再收工位:输出风格换掉它整场对话的口吻,statusline 让你一眼看见当前模型与分支,keybindings 改掉那个总按错的键。每项都给可抄的文件和「什么时候用」。The one thing this chapter runs to completion: taking the procedure you repeated three times this week and codifying it into a skill you summon with one word — with its trigger condition, its pre-approved tools, and live data injected at call time. Then, past the procedure, your workspace: an output style changes the voice of the whole conversation, a statusline puts the active model and branch in front of you, keybindings retire the key you keep hitting wrong. Each with a file you can copy and a line on when to use it.
你有几段每周都要重打的提示:发版前那套检查、审 PR 的固定清单、「用我们团队的口吻写 changelog」。每次凭记忆重打,慢,而且每次都略有不同 —— 于是结果也略有不同。这一章讲收编:把你的重复劳动变成两类资产,流程沉成 Skill,说话方式定成输出风格。收编过的东西不再依赖你的记性,也不再吃你的手速。You have prompts you retype weekly: the pre-release checklist, the fixed PR-review list, 'write the changelog in our team's voice.' Retyped from memory, each is slow — and slightly different, so the results differ slightly too. This chapter is about codifying: turning that repetition into two kinds of assets — procedures settle into Skills, manner of speaking into an output style. What's codified no longer depends on your memory, or your typing speed.
— I
Skills:把流程存成一个词Skills: A Procedure Stored as One Word.
一个 skill 就是一个目录加一份 SKILL.md:frontmatter 里一句 description 说清「什么时候该用我」,正文写做法,旁边还能放脚本、模板、示例文件。存好之后有两条入口:你打 /名字 直接唤起,或者 Claude 自己判断相关就加载。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.关键的经济学在加载方式:描述常驻、正文用到才进上下文 —— 一份几百行的发版手册,平时几乎不占地方。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.这也是它和 CLAUDE.md 的分工:每次都要的一句事实住第 3 章,偶尔才用的一套流程住这里。A skill is a directory with a SKILL.md: one description line in the frontmatter says when to use it, the body says how, and scripts, templates, and examples can sit alongside. Once saved, two entrances: type /name to summon it, or Claude loads it when it judges the task relevant.1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17. The key economics is in the loading: the description stays resident, the body enters context only when used — a several-hundred-line release manual costs almost nothing on idle days.1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17. That's also the split with CLAUDE.md: a fact needed every session lives in chapter 3; a procedure needed occasionally lives here.如果你记得「自定义 slash 命令」:它们已经并入 skills —— .claude/commands/deploy.md 和 .claude/skills/deploy/SKILL.md 生成同一个 /deploy,旧文件继续可用,skills 只是多了支撑文件、调用控制这些新能力。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.一份真实形状的 skill 长这样:If you remember 'custom slash commands': they've been merged into skills — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md create the same /deploy, old files keep working, and skills simply add supporting files and invocation control on top.1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17. A real-shaped skill looks like this:
三个 frontmatter 字段值得先认识。disable-model-invocation: true:只许你手动触发 —— 发版、发消息这类有副作用的流程,别让它「觉得代码差不多了」就自己跑。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.allowed-tools:这一轮预批准的工具,让 /release 跑 git 命令不用逐条弹窗。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.context: fork:整个 skill 丢进 subagent 的独立上下文里执行,重活不弄脏主对话(第 5 章的机制)。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.正文里那行 !`git status` 是动态注入:调用瞬间先执行命令、把输出内联进内容 —— 你的 skill 拿到的是活数据,不是你写死的假设。1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.Three frontmatter fields worth meeting first. disable-model-invocation: true: only you can trigger it — release and send-message flows with side effects shouldn't run because it 'felt the code was ready.'1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.allowed-tools: tools pre-approved for that turn, so /release runs git without a prompt per command.1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.context: fork: the whole skill executes in a subagent's separate context, keeping heavy work out of your main conversation (chapter 5's machinery).1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17. And that !`git status` line is dynamic injection: the command runs at invocation and its output is inlined — your skill reads live data, not the assumption you hard-coded.1注 1Note 1Claude Code Docs · Skills —— 一个 skill 是一个目录加一份 SKILL.md:frontmatter 写清何时该用,正文是做法;描述常驻上下文,正文只在被调用或被判定相关时加载;/名字 直接唤起。「自定义命令已并入 skills」—— .claude/commands/deploy.md 与 .claude/skills/deploy/SKILL.md 同样生成 /deploy,旧命令文件继续可用。常用 frontmatter:disable-model-invocation(只许你手动触发)、user-invocable: false(只许它自己用)、allowed-tools(该轮免批工具)、context: fork(丢进 subagent 跑)。正文里还能用 $ARGUMENTS 参数替换、!`命令` 动态注入(执行后把输出内联进内容)。位置:企业 / 个人 ~/.claude/skills/ / 项目 .claude/skills/ / 插件;SKILL.md 建议 500 行内,细料放支撑文件。截至 2026-07-17。Claude Code Docs · Skills — a skill is a directory with a SKILL.md: frontmatter says when to use it, the body says how; the description stays in context while the body loads only when invoked or judged relevant; /name summons it directly. 'Custom commands have been merged into skills' — .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy, and old command files keep working. Useful frontmatter: disable-model-invocation (only you can trigger it), user-invocable: false (only Claude can), allowed-tools (pre-approved for the invoking turn), context: fork (run in a subagent). In the body, $ARGUMENTS substitution and !`command` dynamic injection (runs the command and inlines its output) are also available. Locations: enterprise / personal ~/.claude/skills/ / project .claude/skills/ / plugin; keep SKILL.md under ~500 lines with detail in supporting files. As of 2026-07-17.
— II
输出风格:换的不是知识,是口吻Output Styles: Not What It Knows — How It Speaks.
第二根柱子管的是另一类重复:「解释详细点」「别铺垫直接干」「像导师一样带我」—— 这些不是流程,是整场对话的角色设定。输出风格直接改 system prompt 里的角色、口吻与输出格式,一次设定,每一轮生效。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.文档的界定句很准:改变它怎么回应,不改变它知道什么。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.The second pillar handles a different repetition: 'explain more,' 'skip the preamble, just do it,' 'walk me through it like a mentor' — not procedures, but the whole conversation's role setting. An output style modifies the system prompt's role, tone, and output format: set once, applied every turn.2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17. The docs' boundary line is exact: it changes how it responds, not what it knows.2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.内置四款够覆盖多数场景:Default 是原生工程师;Proactive 更敢直接动手、少停下来问;Explanatory 边干活边给你讲原理;Learning 最有意思 —— 它会在代码里留 TODO(human),把关键的一小段留给你亲手写,拿它学新代码库比纯看快得多。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.切换走 /config 里的 Output style 选项,或直接在设置文件里写 outputStyle(独立的 /output-style 命令已经移除)。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.自定义也简单:markdown 文件放进 .claude/output-styles/,用 keep-coding-instructions 决定保不保留原生编码指令 —— 保留,它是个换了口吻的工程师;去掉,它可以彻底变成写作助手或数据分析员。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.两条边界记住:风格只作用于主对话,派出去的 subagent 不受影响;会话中途换风格不生效,下个会话才加载。2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.The four built-ins cover most needs: Default is the stock engineer; Proactive acts first and pauses less; Explanatory teaches while it works; Learning is the most interesting — it leaves TODO(human) markers in the code so you write the key passage yourself, which beats pure reading for learning a new codebase.2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17. Switch via the Output style entry in /config, or set outputStyle in a settings file (the standalone /output-style command is gone).2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17. Custom styles are simple too: a markdown file in .claude/output-styles/, with keep-coding-instructions deciding whether the stock coding instructions stay — keep them and it's an engineer with a new voice; drop them and it becomes a writing assistant or data analyst outright.2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17. Two boundaries to remember: styles apply to the main conversation only — subagents are unaffected; and a mid-session switch doesn't take effect until the next session.2注 2Note 2Claude Code Docs · Output styles —— 「输出风格改变 Claude 怎么回应,不改变它知道什么」:修改 system prompt 里的角色、口吻与输出格式,作用于整场对话。内置四款:Default、Proactive(先动手少停顿)、Explanatory(边做边讲解)、Learning(留 TODO(human) 让你亲手写一段);自定义放 .claude/output-styles/,keep-coding-instructions 决定保不保留原生编码指令。经 /config 选择或直接改 outputStyle 设置(独立的 /output-style 命令已移除);只作用于主对话,subagent 不受影响。截至 2026-07-17。Claude Code Docs · Output styles — 'output styles change how Claude responds, not what Claude knows': they modify the system prompt's role, tone, and output format for the whole conversation. Four built-ins: Default, Proactive (acts first, pauses less), Explanatory (teaches while working), Learning (leaves TODO(human) markers for you to write a piece yourself); custom styles live in .claude/output-styles/ with keep-coding-instructions deciding whether the stock coding instructions stay. Set via /config or the outputStyle setting (the standalone /output-style command has been removed); applies to the main conversation only — subagents are unaffected. As of 2026-07-17.
— III
什么收、收到哪、什么不收What to Codify, Where — and What Not To.
到这里,固化的去处一共四个。判断题每次只有一道:这段重复,是流程、是事实、是口吻,还是铁律?By now there are four places for codification. The question each time is single: is this repetition a procedure, a fact, a voice, or an iron rule?
这段重复是The repetition is
收到Codify into
性质Nature
多步流程、带脚本的做法A multi-step procedure, with scripts
Skill(本章)A skill (this chapter)
按需加载,模型执行Loads on demand, model executes
每次都要的一句事实A fact needed every session
CLAUDE.md(第 3 章)CLAUDE.md (chapter 3)
常驻上下文Always in context
整场对话的角色与口吻The conversation's role and voice
输出风格(本章)An output style (this chapter)
改 system promptModifies the system prompt
必须每次都发生的动作An action that must fire every time
Hook(第 7 章)A hook (chapter 7)
harness 执行,不经模型Harness-run, no model in the loop
头两行的分界线,官方给的触发律是「第三次」:同一段提示重打到第三次、同一套做法第三次贴进对话,就存成 skill。3注 3Note 3Claude Code Docs · Extend Claude Code —— 收编的触发时机:同一段提示重打到第三次、或同一套多步流程第三次贴进对话,存成 skill;hook 与 skill 的分界:hook 在事件上必然执行,skill 由模型理解并执行、结果可能有出入。截至 2026-07-17。Claude Code Docs · Extend Claude Code — codification triggers: a prompt retyped a third time, or a multi-step playbook pasted a third time, becomes a skill; the hook/skill line: a hook always fires on its event, while a skill is interpreted and executed by the model, so outcomes can vary. As of 2026-07-17.末行的分界线更硬:skill 是模型理解后执行的,结果可能有出入;hook 在事件上必然执行 —— 「希望它跑 lint」是 skill 的事,「必须跑过 lint 才许提交」是 hook 的事。3注 3Note 3Claude Code Docs · Extend Claude Code —— 收编的触发时机:同一段提示重打到第三次、或同一套多步流程第三次贴进对话,存成 skill;hook 与 skill 的分界:hook 在事件上必然执行,skill 由模型理解并执行、结果可能有出入。截至 2026-07-17。Claude Code Docs · Extend Claude Code — codification triggers: a prompt retyped a third time, or a multi-step playbook pasted a third time, becomes a skill; the hook/skill line: a hook always fires on its event, while a skill is interpreted and executed by the model, so outcomes can vary. As of 2026-07-17.反过来,三类东西不值得收:只做一次的活,写清楚 prompt 就够;还在每周变的流程,固化了就是提前腐烂;以及模型本来就会做对的事 —— 给它立规矩,和给它写说明书一样,都有维护成本。For the first two rows, the official trigger is 'the third time': a prompt retyped a third time, a playbook pasted a third time — make it a skill.3注 3Note 3Claude Code Docs · Extend Claude Code —— 收编的触发时机:同一段提示重打到第三次、或同一套多步流程第三次贴进对话,存成 skill;hook 与 skill 的分界:hook 在事件上必然执行,skill 由模型理解并执行、结果可能有出入。截至 2026-07-17。Claude Code Docs · Extend Claude Code — codification triggers: a prompt retyped a third time, or a multi-step playbook pasted a third time, becomes a skill; the hook/skill line: a hook always fires on its event, while a skill is interpreted and executed by the model, so outcomes can vary. As of 2026-07-17. The last row's line is harder: a skill is interpreted by the model, so outcomes can vary; a hook always fires on its event — 'hoping it runs lint' is skill territory, 'no commit until lint passes' is hook territory.3注 3Note 3Claude Code Docs · Extend Claude Code —— 收编的触发时机:同一段提示重打到第三次、或同一套多步流程第三次贴进对话,存成 skill;hook 与 skill 的分界:hook 在事件上必然执行,skill 由模型理解并执行、结果可能有出入。截至 2026-07-17。Claude Code Docs · Extend Claude Code — codification triggers: a prompt retyped a third time, or a multi-step playbook pasted a third time, becomes a skill; the hook/skill line: a hook always fires on its event, while a skill is interpreted and executed by the model, so outcomes can vary. As of 2026-07-17. And three things aren't worth codifying: one-off work, where a clear prompt suffices; procedures still changing weekly, which codified is just rot on a schedule; and things the model already gets right — rules, like manuals, carry maintenance costs.动手 · 本周就收编三样:Hands-on · codify three things this week:
01
把重打过两次的 prompt 存成第一个 skillSave your twice-retyped prompt as a first skill
找出你本周重打过的那段提示,原样放进 .claude/skills/<名字>/SKILL.md 的正文,description 写清触发时机。下次用 /名字 唤起。Take the prompt you retyped this week, put it verbatim into the body of .claude/skills/<name>/SKILL.md, and write the trigger into the description. Summon it with /name next time.
02
给一个有副作用的流程上锁Lock one procedure with side effects
发版、发通知、清数据 —— 挑一个,加 disable-model-invocation: true,让触发权只在你手里。Release, notify, purge — pick one, add disable-model-invocation: true, and keep the trigger in your hands only.
03
试一周 Learning 或 Explanatory 风格Run a week on Learning or Explanatory
在你最近接手的陌生代码库里开一周,再决定回不回 Default —— 风格是可逆的,试错成本几乎为零。Turn it on for a week in the unfamiliar codebase you just picked up, then decide whether to return to Default — styles are reversible, and the trial costs nearly nothing.
重打第三遍的提示,
是一个还没存档的 skill.
A prompt retyped a third time
is a skill not yet saved.
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return