跳转到内容

Skill 机制

这是 writing-for-agents 中关于 skill 的部分:当文档是 skill 时,哪些内容会改变(frontmatter、调用方式的选择,以及路由 skill)。其他写作内容都以 SKILL.md 中的通用参考为准。

有两种选择,各自承担不同的加载成本:

  • 模型也可以自己调用的 skill 会保留 description,这样代理就能自主调用它,其他 skill 也能调用它。你仍然可以输入它的名称:模型调用始终_包含_读者调用的能力;description 只会让代理发现它,不会剥夺读者的调用权。description 是 skill 顶层的上下文指针,必须始终保持加载:用持续占用上下文换取可发现性。如果模型也可以自己调用的 skill 内容全是参考资料,它也可以集中存放共享参考资料:其他 skill 可以调用它,因此多个 skill 需要的参考资料可以放在同一处。具体做法:省略 disable-model-invocation,并编写面向模型的 description,其中包含触发分支(完整遵循 SKILL.md 中编写指针的规则)。
  • 读者点名才用的 skill 会从代理可调用范围中移除 description:只有读者输入它的名称才能调用,其他 skill 都不能调用。它不占上下文,但会增加认知负担:你必须记住它的存在。具体做法:设置 disable-model-invocation: true;description 改为面向读者的一行摘要,并去掉触发条件列表。

只有在代理必须自行调用该 skill,或其他 skill 必须调用它时,才选择模型调用。如果它只会被手动调用,就设为读者点名才用,不占上下文。

两个读者点名才用的 skill 都需要的共享参考资料,不能放在它们任何一个里面:没有 description,它们都无法调用对方。应将资料放到 skill 系统外的普通文件中,任何 skill 都能引用外部参考资料。

拆分时按调用方式划分(按顺序拆分见 SKILL.md):如果你有一个独特的引导词应该单独触发某个 skill(也就是你确实会在提示中使用的触发词),或者另一个 skill 必须调用它,就把它拆成一个模型也可以自己调用的 skill。新的 description 会持续占用上下文,因此这种独立调用能力必须物有所值。

当读者点名才用的 skill 多到难以记住时,可以用路由 skill来减轻认知负担:创建一个读者点名才用的 skill,列出其他 skill 以及何时调用它们,让读者只需记住一个 skill。它只能提供提示,不能调用其他 skill:读者点名才用的 skill 没有 description,只有读者才能调用它们。

英文 SKILL-MECHANICS.md
# Skill mechanics
The skill-specific branch of [`writing-for-agents`](SKILL.md): what changes when the document is a skill (frontmatter, the invocation choice, and router skills). Everything else about writing it is the universal reference in `SKILL.md`.
## Invocation
Two choices, trading the two loads:
- A **model-invoked** skill keeps a `description`, so the agent can fire it autonomously, and other skills can reach it. You can still type its name: model-invocation always _includes_ user reach; a description only ever adds agent discovery, never removes the human's. The description is the skill's top-level context pointer, forced to stay loaded at all times: permanent context load in exchange for discoverability. A model-invoked skill whose content is all reference is also one home for shared reference: another skill can invoke it, so reference needed by several skills lives in one place. Mechanics: omit `disable-model-invocation`, and write a model-facing description carrying the trigger branches (the pointer-writing rules in `SKILL.md` apply in full).
- A **user-invoked** skill strips the description from the agent's reach: only the human typing its name can invoke it, and no other skill can. Zero context load, but it spends cognitive load: you are the index that must remember it exists. Mechanics: set `disable-model-invocation: true`; the `description` becomes human-facing: a one-line summary, trigger lists stripped.
Pick model-invocation only when the agent must reach the skill on its own, or another skill must. If it only ever fires by hand, make it user-invoked and pay no context load.
Shared reference that two user-invoked skills both need can live in neither: with no descriptions, neither can fire the other. Push it to a plain file outside the skill system: external reference any skill can point at.
## Splitting by invocation
The invocation cut of splitting (the sequence cut lives in `SKILL.md`): split off a model-invoked skill when you have a distinct leading word that should trigger it on its own (a trigger word you actually use in your prompts), or another skill must reach it. You pay context load for the new always-loaded description, so that independent reach has to be worth it.
## Router skills
When user-invoked skills multiply past what you can remember, that piled-up cognitive load is cured by a **router skill**: one user-invoked skill that names the others and when to reach for each, so the human has one skill to remember instead of many. It can only hint, never fire them: user-invoked skills have no description, so nothing but the human can reach them.

非官方学习站,与 Matt Pocock 和 AI Hero 没有隶属关系。本站不提供可安装的中文技能包。

技能原文采用 MIT 许可。Copyright (c) 2026 Matt Pocock

鲁ICP备2025189036号