Mingyu's Library主页

深度学习文档 · 2026-08-22

Deep Dive · 2026-08-22

Agent Skills:怎么写、怎么测、怎么防

Agent Skills: Write Them, Measure Them, Secure Them

一个 SKILL.md 文件就能给 AI Agent 装上专业能力——这件事在 2026 年从「有意思的小格式」变成了一个有 2 万星规范、4 万个公开技能、以及第一批评测与安全研究的工程学科。本文把它讲成一条链:它是什么 → 机制怎么跑 → 怎么写才有用 → 有没有用(有数据) → 有什么坑。

A single SKILL.md file can hand an AI agent real expertise. Over 2026 that idea went from a neat little format to an engineering discipline — a 20k-star open spec, 40,000+ public skills, and the first serious benchmarks and security studies. This piece runs the whole chain: what it is, how the mechanism works, how to write one that earns its keep, whether skills actually help (with numbers), and where the sharp edges are.

调研时间:2026-08-22 Researched: 2026-08-22 阅读约 18 分钟 ~18 min read 面向:第一次系统了解 Skills 的开发者 For: developers new to the Skills ecosystem

030 秒速览The 30-second version

一个 Agent Skill 就是一个文件夹,里面必须有一个 SKILL.md。这个文件的开头是几行元数据(名字 + 一句「什么时候该用我」的描述),下面是给 Agent 看的操作说明。文件夹里还可以塞脚本、参考文档、模板。

An Agent Skill is a folder that must contain a SKILL.md. That file opens with a few lines of metadata (a name, plus a description saying when to use it), followed by instructions written for the agent. The folder can also bundle scripts, reference docs and templates.

关键的设计不是格式,而是加载方式:启动时 Agent 只读每个技能的名字和描述(每个约 30–50 token),只有当任务匹配上描述,才把完整正文读进上下文。所以你可以挂几十个技能而几乎不占地方。

The interesting design choice isn't the format — it's the loading strategy. At startup the agent reads only each skill's name and description (roughly 30–50 tokens apiece). The full body loads only once a task matches that description. That's how you can keep dozens of skills on hand at near-zero context cost.

20.6k规范仓库 star 数(agentskills/agentskills)stars on the spec repo (agentskills/agentskills)
40,2852026-02 学术研究抓取到的公开技能数public skills analysed in a Feb 2026 study
+16.6ppSkillsBench 实测:人工策划的技能带来的平均通过率提升average pass-rate lift from curated skills (SkillsBench)
36%Snyk 抽查中含安全缺陷的技能占比of surveyed skills carry a security flaw (Snyk)
一句话In one line Skills 把「Agent 需要但不知道的流程性知识」打包成可版本控制、可跨产品复用的文件夹,按需加载。它有效,但效果高度依赖谁来写、写得多克制——模型自己生成的技能平均没有收益。 Skills package the procedural knowledge an agent needs but can't know into version-controlled, cross-product folders that load on demand. They work — but the payoff depends heavily on who writes them and how restrained the writing is. Model-authored skills show no average benefit at all.

1它来解决什么痛点The problem it solves

先说 Skills 出现之前的世界。你手上有一个通用能力很强的 Agent:会写代码、会 debug、会写文档。但它不知道你这边的规矩——你们团队的 commit message 怎么写、你们的 lint 流水线是自定义的、每个 PR 合并前必须过一份安全清单。

Start with the world before skills. You have an agent that's broadly capable — it writes code, debugs, produces docs. What it doesn't know is your local rules: how your team writes commit messages, that your lint pipeline is custom, that every PR needs a security checklist before merge.

过去的做法是:把这些偏好、约定、工具文档一股脑塞进系统提示。问题很直接——这段提示每一次会话都会加载,不管你今天用不用得上。它和你真正的工作内容抢同一个上下文窗口。

The standard workaround was to stuff all of it into the system prompt. The problem is blunt: that prompt loads every session, whether it's relevant or not, competing with your actual work for the same context window.

上下文窗口(context window) Context window 模型一次能「看到」的文字总量。它是有限的,而且——这点更要命——模型在上下文变长时表现会可测量地变差,远在窗口被填满之前就开始了。所以「多塞点总没坏处」是错的:每一段没用上的文字都在稀释注意力。 The total amount of text a model can "see" at once. It's finite, and — more importantly — every frontier model measurably degrades as context grows, well before the window is actually full. So "more context can't hurt" is wrong: every unused paragraph dilutes attention.

Skills 的赌注就下在这里:与其造一堆专用的单一用途 Agent,不如给一个通用 Agent 配一个技能库,用的时候才取。Anthropic 的产品经理 Mahesh Murag 把这个设计原则叫做「渐进式披露(progressive disclosure)」——每个技能平时只占几十个 token 的「摘要」,细节等任务需要时再展开。

That's where skills place their bet: rather than building a fleet of narrow single-purpose agents, give one general-purpose agent a skill library it draws from on demand. Anthropic PM Mahesh Murag calls the underlying principle "progressive disclosure" — each skill costs a few dozen tokens as a summary, with the detail expanding only when the task calls for it.

换个说法:图书馆和背包 Another way to put it: the library and the backpack

系统提示像是「把整个书架背在身上」——每天都背,不管今天读不读。Skills 像是「随身带一份索引卡,书留在图书馆」——你只背卡片(名字 + 一句这本书讲什么),真要用了才去把那本书取下来。索引卡很薄,所以你可以带 50 张。

A system prompt is like carrying the whole bookshelf on your back — every day, read or not. Skills are like carrying an index card per book and leaving the books on the shelf: the card holds only a title and a line about what's inside, and you fetch the actual book when you need it. Cards are thin, so you can carry fifty.

格式本身由 Anthropic 提出,2025 年 12 月 18 日作为开放标准发布,现在规范托管在 agentskills/agentskills(代码 Apache-2.0,文档 CC-BY-4.0),已经被 20 多个 Agent 产品采用——同一个 SKILL.md 文件在 Claude Code、OpenAI Codex CLI、Gemini CLI、GitHub Copilot、Cursor、VS Code 上都能直接用,不用改。

The format itself came from Anthropic and was released as an open standard on 18 December 2025. The spec now lives at agentskills/agentskills (code Apache-2.0, docs CC-BY-4.0) and has been adopted by more than twenty agent products — the same SKILL.md runs unmodified in Claude Code, OpenAI Codex CLI, Gemini CLI, GitHub Copilot, Cursor and VS Code.

2机制:渐进式披露的三个阶段Mechanism: the three stages of progressive disclosure

规范把加载过程明确拆成三段。理解这三段,你就理解了 Skills 的全部魔法(以及它的全部局限)。

The spec breaks loading into three explicit stages. Understand these three and you understand both the whole trick and all of its limits.

① 发现 Discovery 会话启动时 只读 name + description ≈ 30–50 token / 个 ② 激活 Activation 任务匹配上 description 读入 SKILL.md 全文 中位数 1,414 token ③ 执行 Execution 按正文指示,才去读 references/ 或跑 scripts/ 没被引用的文件永不加载 上下文占用:一路只在「需要时」才增加 50 个技能挂在身上 ≈ 1,500–2,500 token 的启动开销 —— 但只有真正命中的那一个,才会展开成完整正文

图 1:渐进式披露三阶段。数字来自 agentskills 官方 README 与 2026-02 Bosch/CMU 研究(arXiv:2602.08004)。

① Discovery at session start name + description only ≈ 30–50 tokens each ② Activation task matches description full SKILL.md loads median 1,414 tokens ③ Execution reads references/ or runs scripts/ only when told to unreferenced files never load Context cost grows only when something is actually needed 50 installed skills ≈ 1,500–2,500 tokens of startup overhead — and only the one that matches expands into its full body

Fig. 1 — The three stages of progressive disclosure. Figures from the official agentskills README and the Feb 2026 Bosch/CMU study (arXiv:2602.08004).

这个机制的直接推论The direct consequence description 字段是整个技能里最重要的一行。它是唯一在「发现」阶段被读到的东西,也就是说:它是决定技能会不会被用的全部依据。写得含糊(「帮助处理代码」),技能就会长期躺在硬盘上;写得具体(「用 conventional commits 规范格式化提交信息。当用户要求撰写、审查或修正 commit message 时使用」),它才会在该出现的时候出现。 The description field is the single most important line in the whole skill. It's the only thing read during discovery — which means it is the entire basis on which the skill does or doesn't get used. Write it vaguely ("helps with code") and the skill sits on disk forever. Write it precisely ("Format commit messages using the conventional commits spec. Use when the user asks to write, review, or fix a commit message") and it fires at exactly the right moments.

Anthropic 侧的最佳实践里还有一条反直觉的建议:description 要写得「稍微强势一点」,因为 Claude 有一个可测量的欠触发(under-trigger)倾向——它宁可不用技能也不愿误用。

Anthropic's own guidance adds a counter-intuitive note: write the description a little "pushy", because Claude has a measured tendency to under-trigger skills — it would rather skip one than misapply it.

3一个 Skill 长什么样Anatomy of a skill

最小可用形态就是一个文件夹加一个文件:

The minimum viable form is one folder and one file:

my-skill/
└── SKILL.md          # 必需:YAML 元数据 + markdown 说明
my-skill/
└── SKILL.md          # required: YAML frontmatter + markdown instructions

完整形态多出三个约定俗成的目录:

The full form adds three conventional directories:

skill-name/
├── SKILL.md          # 必需
├── scripts/          # 可选:可执行的 Python / Bash / JS
├── references/       # 可选:按需加载的详细文档
└── assets/           # 可选:模板、schema、数据文件
skill-name/
├── SKILL.md          # required
├── scripts/          # optional: executable Python / Bash / JS
├── references/       # optional: detailed docs, loaded on demand
└── assets/           # optional: templates, schemas, data files

SKILL.md 的两部分

The two halves of SKILL.md

上半部分是 YAML 元数据(frontmatter),下半部分是纯 markdown 的指令正文。一个真实可跑的最小例子:

The top half is YAML frontmatter; the bottom half is a plain-markdown instruction body. A minimal working example:

---
name: format-newsletter
description: 把原始文字整理成专业的周报结构。当用户提供
  草稿、要求「排版 / 结构化 / 清理 newsletter」时使用。
---
# Newsletter 格式化

## 何时使用
用户给了 newsletter 原始文字、想要专业结构,或提到「格式化 newsletter」时。

## 步骤
1. **清理**:去掉多余换行,修正空格。
2. **结构**:确保存在 标题 / 引言 / 本周更新(用列表)/ 本周金句 / 行动号召。
3. **语气**:口语但专业。
4. **格式**:用 Markdown 标题(#、##)与加粗(**)。
---
name: format-newsletter
description: Formats raw text into a professional weekly newsletter
  structure. Use when asked to format, structure, or clean up a draft.
---
# Newsletter Formatting

## When to use
Whenever the user provides raw newsletter text, wants a professional
structure, or mentions "formatting the newsletter."

## Instructions
1. **Cleanup:** remove excessive line breaks, fix spacing.
2. **Structure:** ensure Title / Introduction / Key Updates (bulleted) /
   Quote of the Week / Call to Action all exist.
3. **Tone:** conversational yet professional.
4. **Formatting:** Markdown headers (#, ##) and bolding (**).

代码示例来自 Firecrawl 的 Agent Skills 解析文(2026-05 更新),与 agentskills 官方 README 的结构描述一致。

Example adapted from Firecrawl's Agent Skills explainer (updated May 2026); consistent with the structure described in the official agentskills README.

值得知道的 frontmatter 字段

Frontmatter fields worth knowing

字段作用什么时候用
name技能名,同时变成斜杠命令。只允许小写字母、数字、连字符,上限 64 字符。必填。deploy-to-staging 合法,Deploy_To_Staging 不合法。
description决定技能会不会被激活。写给模型看,不是写给人看。必填,而且是全场最重要的一行。
disable-model-invocation关掉自动加载,只能用户手动 /name 调用;description 完全退出上下文,「上下文税」降到近零。有副作用的技能:部署、提交、对外写操作。
pathsglob 模式,限制技能在哪些路径下才考虑自动激活。技能只适用于 libs/go/ 时,在别处就不参与匹配。
allowed-tools限定技能可用的工具范围,支持通配(如 Bash(gh *))。收窄权限面。注意:这是 CLI 侧字段,通过 SDK 使用时不生效。
effort思考深度:low / medium / high格式化类用 low;架构决策类用 high。别留给默认。
context: fork在独立 subagent 里跑,拥有自己的上下文窗口。要吞大量参考资料、否则会撑爆主会话的技能。
argument-hint自动补全时提示参数,如 [environment]/deploy [environment]需要参数的技能。
FieldWhat it doesWhen to reach for it
nameSkill name, which also becomes the slash command. Lowercase letters, numbers and hyphens only; 64 characters max.Required. deploy-to-staging is valid; Deploy_To_Staging is not.
descriptionDecides whether the skill activates at all. Written for the model, not for humans.Required — and the most consequential line in the file.
disable-model-invocationTurns off automatic loading; users invoke it manually with /name. The description drops out of context entirely, cutting the "context tax" to near zero.Skills with side effects: deployments, commits, external writes.
pathsGlob patterns limiting where the skill is considered for auto-activation.A skill that only applies to libs/go/ shouldn't compete elsewhere in the repo.
allowed-toolsScopes which tools the skill may use; supports wildcards such as Bash(gh *).Narrowing the permission surface. Note: this is a CLI-side field and does not apply when using skills through the SDK.
effortThinking depth: low / medium / high.low for a formatting skill, high for architecture calls. Don't leave it to chance.
context: forkRuns the skill in an isolated subagent with its own context window.Reference-heavy skills that would otherwise bloat the primary session.
argument-hintShows expected arguments in autocomplete: [environment]/deploy [environment].Any skill that takes arguments.

正文里还能用三个运行时变量:$ARGUMENTS(斜杠命令后面跟的全部内容)、$ARGUMENTS[0](按位取参)、${CLAUDE_SKILL_DIR}(引用打包脚本时用,不受用户当前工作目录影响)。

The body also supports three runtime substitutions: $ARGUMENTS (everything passed after the slash command), $ARGUMENTS[0] for positional access, and ${CLAUDE_SKILL_DIR} for referencing bundled scripts regardless of the user's working directory.

规范给的两条硬约束Two hard limits from the spec SKILL.md 正文建议不超过 5,000 token,整个技能目录建议不超过 500 行。这不是刁难,是在逼你区分「Agent 真正需要的」和「写着好看的」。想放更多细节?挪到 references/,让它按需加载。 The spec recommends keeping SKILL.md bodies under 5,000 tokens and whole skill directories under 500 lines. That's not pedantry — it forces you to separate what the agent actually needs from what's merely nice to have. Want more detail? Push it into references/ and let it load on demand.

技能装在哪儿

Where skills live

  • Claude Code:默认读 ~/.claude/skills
  • Codex CLI:~/.codex/skills
  • Gemini CLI:扫描 ~/.gemini/skills
  • Cursor:读项目级目录
  • Claude Code reads from ~/.claude/skills by default
  • Codex CLI uses ~/.codex/skills
  • Gemini CLI scans ~/.gemini/skills
  • Cursor reads project-level directories

社区维护的 npx skills CLI(Vercel Labs)会自动判断装到哪里:

The community npx skills CLI (Vercel Labs) handles placement automatically:

npx skills add firebase/agent-skills
npx skills add anthropics/skills/pdf

⚠️ 手动安装时,放好目录后需要重启会话——技能是在启动时被发现的。

⚠️ If you install manually, restart the session after dropping the folder in place — skills are discovered at startup.

4怎么写才有用Writing one that actually works

格式十分钟就学会了。难的是下一个问题:这个技能该不该存在,以及它该多短。下面这套流程综合了 Anthropic 的官方最佳实践、一篇被广泛引用的工程博客《Does Your Skill Earn Its Keep?》,以及 2026-07 的论文《Authoring Agent Skills: A Software-Engineering Approach》。

The format takes ten minutes to learn. The hard question comes next: should this skill exist at all, and how short can it be? The workflow below combines Anthropic's published best practices, a widely-cited engineering post titled "Does Your Skill Earn Its Keep?", and the July 2026 paper Authoring Agent Skills: A Software-Engineering Approach.

  1. 先不带技能试一次。打开 Agent,直接描述你要什么,什么技能都不装。如果它已经做得挺好,你不需要技能。如果它做成了但绕了远路,或者以某种具体的方式失败了——那个缺口,就是你的技能该填的,仅此而已。跳过这一步,你根本不知道 Agent 在哪里需要帮助。
  2. 算一下「上下文税」。你的 description 会在每一次会话加载,不管技能触没触发。100 token 的描述 × 1,000 个工程师 × 每天 10 次会话 = 每天 100 万 token 的固定开销,而且是在 Agent 碰到任何真实任务之前。问题不是「这个技能有用吗」,而是「它挣得回自己的成本吗」。10 个人时你察觉不到;10,000 个人时,一个定位不准的技能就是每天都在复利的隐形税。
  3. 先写评测,再写技能。确认缺口真实存在后,别急着写技能——先写一个 eval。把任务编码成可测的形式,量出当前模型 + 当前 harness 的基线。这样技能写完你才知道它到底有没有帮上忙。没有 eval,你就是在猜:你可能写出一个增加噪声、误导模型、或与其它技能冲突的东西。
  4. 问一句:这是技能,还是脚本?如果它主要是一串确定性步骤,如果有人能用 bash 脚本或一个 Makefile target 完成其中 80%——那就写脚本。最糟的技能是用 500 token 的自然语言描述一件其实等同于 make test 加几个 flag 的事。技能可以调用脚本:脚本负责可预测的部分(便宜、可靠),技能负责判断——什么时候跑、输出怎么解读、出意外了怎么办。
  5. 写到最小。目标不是一份完整指南,不是教程,是一次轻推:指向正确的框架、提醒一条模型不可能知道的内部约定、点出一个容易漏的 flag。每多一行都是模型要处理的额外上下文、更多指令冲突的可能、以及将来更大的维护负担。最好的技能,一分钟内读得完。
  6. 诚实对待适用范围与分发方式。这个技能是给谁的?一份专为你们团队工作流写的端到端技能,对团队外几乎没用——如果它进了默认集合,所有人都在替它交上下文税。普适的放进默认配置;团队/领域专用的做成 opt-in。一个对 15 个人极有价值、对另外 5,000 人纯属噪声的技能,不该被默认加载。
  1. Try the task without a skill first. Open the agent and describe what you want with nothing installed. If it already handles the task well, you don't need a skill. If it succeeds but takes a roundabout path, or fails in a specific way, that gap is what your skill should fill — and nothing more. Skip this step and you can't know where the agent actually needs help.
  2. Do the context-tax arithmetic. Your description loads into context on every session, for every engineer, whether the skill fires or not. 100 tokens of description × 1,000 engineers × 10 sessions a day = a million tokens of daily overhead before the agent touches a single task. The question isn't "is this useful?" but "will it earn back what it costs to carry?" At ten engineers you'll never notice. At ten thousand, a poorly targeted skill is a silent tax compounding daily.
  3. Write the eval before the skill. Once you've identified a real gap, don't write the skill yet — encode the task as a measurable eval and establish a baseline for your current model and harness. Only then can you tell whether the skill actually helped. Without an eval you're guessing, and you may ship something that adds noise, confuses the model, or conflicts with other skills.
  4. Ask: is this a skill or a script? If it's mostly a sequence of deterministic steps — if someone could write a bash script or a Makefile target that does 80% of it — write the script instead. The worst skills spend 500 tokens of natural language describing something that is really just make test with a few flags. A skill can call a script: the script handles the predictable parts cheaply and reliably, while the skill handles the judgement — when to run it, how to read the output, what to do when something unexpected happens.
  5. Keep it minimal. You're not writing a comprehensive guide or a tutorial. You're writing a nudge: a pointer to the right framework, a reminder of an internal convention the model can't know, a specific flag that's easy to miss. Every extra line is more context to process, more room for conflicting instructions, and more maintenance debt later. The best skills read in under a minute.
  6. Be honest about scope and distribution. Who is this for? A detailed end-to-end skill built around your team's workflow is unlikely to help anyone outside it — and if it ships in the default set, everyone pays its context tax. Broadly applicable? Ship it by default. Team- or domain-specific? Make it opt-in. A skill that's invaluable to 15 people and meaningless noise to 5,000 should not load by default.
不装技能,先跑一次任务 它做好了吗? 做好了 不要写技能 ✋ 有具体缺口 缺口是确定性步骤吗? 写脚本,不写技能 🔧 需要判断力 先写 eval,量出基线 写「最小的一次轻推」 再用 eval 验证它真的有帮助

图 2:「该不该写这个技能」的决策路径。综合自 Anthropic 最佳实践与《Does Your Skill Earn Its Keep?》。

Run the task with no skill Did it do the job? yes Don't write one ✋ specific gap Is the gap deterministic steps? yes Write a script 🔧 needs judgement Write the eval, get a baseline Write the smallest nudge then verify with the eval that it helped

Fig. 2 — Deciding whether a skill should exist. Synthesised from Anthropic's best practices and "Does Your Skill Earn Its Keep?".

还有一条组织层面的规矩One organisational rule on top Anthropic 侧的实践强调:每个技能只有一个 canonical source(唯一权威副本)。技能在一个按领域组织的库里编写,再通过自动化同步流程复制到每个使用它的 Agent。手工复制粘贴到三个地方,三个月后你会有三个互相矛盾的版本。 Anthropic's practice adds: every skill has exactly one canonical source. Skills are authored in a domain-organised library and copied into each consuming agent via an automated sync. Hand-copy the same skill into three places and in three months you'll have three contradictory versions.

5到底有没有用:第一批实测数据Do skills actually help? The first hard numbers

到 2026 年年中为止,这个问题一直靠体感回答。SkillsBench 是第一份把它量化的公开基准:86 个任务、11 个领域、配套人工策划的技能与确定性验证器,跑了 7,308 条轨迹。

Until mid-2026 this question was answered by vibes. SkillsBench is the first public benchmark to quantify it: 86 tasks across 11 domains, each paired with curated skills and deterministic verifiers, measured over 7,308 trajectories.

整体通过率 无技能 33.9% 有策划技能 50.5% (+16.6pp) 但领域之间差了一个数量级 软件工程 +4.5pp 医疗 +51.9pp 两条不能忽略的负面结果 ① 84 个任务中有 16 个出现负增益 ② 模型自己生成的技能,平均收益为零

图 3:SkillsBench 主要结果(arXiv:2602.12670)。「pp」= 百分点。

Overall pass rate no skills 33.9% curated skills 50.5% (+16.6pp) But domains differ by an order of magnitude Software eng. +4.5pp Healthcare +51.9pp Two negative findings you can't wave away ① 16 of 84 tasks show negative deltas ② self-generated skills deliver no benefit on average

Fig. 3 — Headline SkillsBench results (arXiv:2602.12670). "pp" = percentage points.

怎么读这几个数字

How to read these numbers

  • 平均 +16.6pp 是真的,但平均值在这里很危险。软件工程只有 +4.5pp——如果你的场景就是写代码,别指望技能带来跃迁。医疗 +51.9pp 说明:模型越缺乏领域程序性知识的地方,技能的杠杆越大
  • 16/84 的负增益不是噪声,是警告。写坏了的技能会让 Agent 变差。这正是「先写 eval」那一步存在的理由。
  • 模型自己写的技能平均无效。这是全篇最反直觉的一条:模型能受益于程序性知识,却不能可靠地产出它。所以「让 Claude 帮我把这个流程写成技能」可以当草稿起点,但不能当终点——人得进来做筛选和裁剪。
  • 聚焦优于全面。2–3 个模块的紧凑技能,表现优于面面俱到的大文档。这和规范的 5,000 token 上限、以及「写成一次轻推」的建议是同一件事的三种说法。
  • 小模型 + 技能 ≈ 大模型无技能。这条有直接的成本含义:某些任务上,与其升级模型档位,不如补一份好技能。
  • +16.6pp on average is real, but averages are dangerous here. Software engineering gets only +4.5pp — if coding is your use case, don't expect a step change. Healthcare's +51.9pp tells the real story: the leverage is largest exactly where the model lacks domain procedural knowledge.
  • 16 of 84 negative deltas is a warning, not noise. A badly written skill makes the agent worse. That is precisely why "write the eval first" exists as a step.
  • Model-authored skills show no average benefit. The most counter-intuitive finding in the whole study: models can consume procedural knowledge reliably but can't produce it. "Have Claude turn this workflow into a skill" is a fine starting draft — it is not a finished artefact. A human has to prune.
  • Focused beats comprehensive. Skills with 2–3 modules outperform exhaustive documentation. This is the same claim as the spec's 5,000-token ceiling and the "write a nudge" advice, stated three different ways.
  • A small model with skills can match a large model without them. That has a direct cost implication: on some tasks, adding a good skill beats upgrading the model tier.

另一份补充证据来自 NVIDIA SkillEvaluator:用 2026-08-12 的基准快照,在正确性 / 可发现性 / 有效性 / 效率四个维度上给技能打分,baseline 平均分只有 39–46 分(满分 100)。换句话说:大部分已发布的技能,离「写好」还有很远。

A second data point comes from NVIDIA SkillEvaluator: scoring skills on correctness, discoverability, effectiveness and efficiency against an August 12, 2026 benchmark snapshot, average baseline scores landed at just 39–46 out of 100. Put plainly: most published skills are nowhere near well-written.

6和谁比:什么时候选 SkillsSkills vs the alternatives

Skills 不是唯一能给 Agent 加能力的方式。搞清它在生态里的位置,你才知道什么时候该用它。

Skills aren't the only way to extend an agent. Knowing where they sit in the ecosystem is how you learn when not to reach for them.

方式它给 Agent 的是成本模型什么时候选它
Agent Skills程序性知识:「这类活该怎么干」启动时每技能 30–50 token;命中才展开正文有固定流程/约定/领域套路要教;跨产品复用;要版本控制
MCP(Model Context Protocol)能力接口:「你可以调这些工具、读这些数据」工具 schema 常驻上下文;需要跑一个 server需要真正连到外部系统(数据库、SaaS、内部 API)
系统提示 / CLAUDE.md全局的、每次都成立的约束每次会话全量加载内容确实每次都需要(项目结构、语气、红线)
脚本 / Makefile确定性执行近乎为零(不进上下文)步骤固定、无需判断——这是最被低估的选项
微调改变模型本身的倾向训练成本 + 数据准备 + 迭代周期长提示与技能都试过仍不够;有稳定大量的样本
ApproachWhat it gives the agentCost modelReach for it when
Agent SkillsProcedural knowledge — "here's how this kind of work is done"30–50 tokens per skill at startup; body expands only on a matchYou have a repeatable workflow, convention or domain playbook to teach; you want cross-product reuse and version control
MCP (Model Context Protocol)Capability surface — "here are tools you can call and data you can read"Tool schemas sit in context; you have to run a serverYou genuinely need to reach an external system: a database, a SaaS product, an internal API
System prompt / CLAUDE.mdGlobal constraints that hold every single timeLoaded in full, every sessionThe content really is needed every time — project layout, tone, hard rules
Scripts / MakefileDeterministic executionEffectively zero — never enters contextThe steps are fixed and need no judgement. The most underrated option on this list.
Fine-tuningShifts the model's own dispositionsTraining cost, data prep, long iteration loopPrompting and skills were tried and weren't enough, and you have stable volume of examples
最实用的一条分界线The most useful dividing line MCP 解决「够不着」(Agent 无法访问某个系统);Skills 解决「不知道怎么做」(Agent 能访问,但做法不对)。两者经常一起用:MCP 给通路,Skill 教套路。 MCP solves "can't reach it" — the agent has no access to a system. Skills solve "doesn't know how" — it has access but goes about it wrong. They're frequently paired: MCP provides the connection, the skill supplies the playbook.

7坑、税与安全Costs, noise and security

7.1 生态噪声:数量爆炸,质量没跟上

7.1 Ecosystem noise: explosive growth, lagging quality

2026 年 2 月,Bosch Research 与卡内基梅隆大学的研究者分析了 40,285 个公开技能(arXiv:2602.08004),数字很能说明问题:生态在 20 天里增长了 18.5 倍——1 月 16 日 2,179 个,2 月 5 日超过 4 万个;峰值出现在 1 月 25 日,单日发布 8,857 个,占该窗口全部新增的 23%。

In February 2026, researchers at Bosch Research and Carnegie Mellon analysed 40,285 publicly listed skills (arXiv:2602.08004). The numbers speak for themselves: the ecosystem grew 18.5× in twenty days — from 2,179 skills on 16 January to over 40,000 by 5 February, peaking on 25 January with 8,857 skills published in a single day, 23% of all new listings in the window.

  • 46% 的市场条目和至少一个其它技能重名——大量近乎相同的转发副本。没有可靠的质量信号,找到某个任务的「最佳版本」需要比应有的更多手工评估。
  • 供需错配:55% 的技能是软件工程流程(因为这是开发者最容易写的);而安装量最高的类别是信息检索(平均每个技能 1,268 次安装,约为代码生成类的 5 倍),恰恰长期供给不足——因为它需要稳定的连接器和持续维护。
  • 46% of marketplace listings share a name with at least one other skill — a mass of near-identical reposts. Without reliable quality signals, finding the best version of a skill takes more manual evaluation than it should.
  • Supply doesn't match demand: 55% of all skills are software-engineering workflows, because that's what developers find easiest to write. Meanwhile the highest-install category is information retrieval (averaging 1,268 installs per skill, roughly 5× code generation) and it stays chronically undersupplied, because it needs stable connectors and ongoing maintenance.

7.2 安全:把技能当依赖治理,而不是当文档审阅

7.2 Security: govern skills as dependencies, not as documents

Snyk「ToxicSkills」抽查结果Snyk's "ToxicSkills" findings 36% 的技能含安全缺陷,1,467 个存在漏洞,其中 534 个(13.4%)含至少一个 critical 级问题——恶意软件分发、提示注入、明文泄露的密钥。更棘手的一个观察:恶意技能会改写 MEMORY.md(Agent 的持久指令存储),使得技能被删除后,恶意行为仍然存活 36% of skills carry a security flaw. 1,467 were found vulnerable, of which 534 (13.4%) contain at least one critical-level issue — malware distribution, prompt injection, exposed secrets. The nastiest observation: malicious skills rewrote MEMORY.md, the agent's persistent instruction store, so the malicious behaviour survived deletion of the skill itself.

学术侧给出的攻击面分类学(arXiv:2604.02837 等)列了六条路径:直接提示注入、间接提示注入、动态上下文、工具授权、外部依赖、市场信任。云安全联盟(CSA)把这类问题统称为「Agent 上下文投毒」——Anthropic 在 2026-02-10 的 Claude Code 版本里通过 Unicode 规范化修补过其中一种手法,但研究者指出:这类技术的门槛只是「攻击者能通过正常的技能分发渠道投递一个文件」。

The academic threat taxonomy (arXiv:2604.02837 and related work) lists six paths: direct prompt injection, indirect prompt injection, dynamic context, tool grants, external dependencies, and marketplace trust. The Cloud Security Alliance groups these under "agent context poisoning." Anthropic patched one variant via Unicode sanitisation in the 10 February 2026 Claude Code release — but as researchers note, the technique requires only that an attacker can deliver a file through the normal skill distribution channel.

前述 4 万技能研究还有一个量化补充:近 40% 的已发布技能会访问敏感上下文或执行写操作,9% 落在关键风险等级。而规范目前还没有在平台层面强制权限模型或沙箱——安全地限定作用域这件事,责任落在写技能的人身上。

The 40,000-skill study adds a quantitative complement: nearly 40% of published skills access sensitive context or perform writes, and 9% fall into the critical-risk category. The spec does not yet enforce a permission model or sandboxing at the platform level, so the burden of scoping skills safely falls on whoever writes them.

实操上的三条对策:

Three practical mitigations:

  • 装第三方技能前通读 SKILL.md 全文和 scripts/ 里的每个脚本——它和装一个 npm 包是同一性质的操作,不是「读一篇文档」。
  • 对有副作用的技能加 disable-model-invocation: true,让它只能被人手动调起,顺带把 description 的上下文税降到零。
  • allowed-tools 收窄工具面(如 Bash(gh *) 而不是放开整个 Bash),并配合 Agent 侧的权限/沙箱设置。
  • Before installing a third-party skill, read the whole SKILL.md and every script in scripts/. This is the same class of action as installing an npm package — not "reading a doc."
  • Put disable-model-invocation: true on anything with side effects so it can only be invoked deliberately by a human — which also drops its description's context tax to zero.
  • Narrow the tool surface with allowed-tools (Bash(gh *) rather than all of Bash), backed by your agent's own permission and sandbox settings.

7.3 三个还没解决的粗糙边缘

7.3 Three rough edges that remain

  • 会话中途更新技能很别扭。技能在会话启动时加载。你推了 SKILL.md 的改动,正在跑的会话不会生效,得重启。对集中共享技能的团队来说,「不打断在跑的工作流去滚动更新」目前仍是没被工具解决的协调问题。
  • 发现机制噪声大。重名率 46%,缺乏质量信号,挑技能仍然是体力活。
  • 没有平台级权限模型。见 7.2。
  • Updating a skill mid-session is awkward. Skills load at session start. Push a change to SKILL.md and a running session won't see it until restart. For teams sharing skills centrally, rolling out updates without disrupting active work remains an unsolved coordination problem.
  • Discovery is noisy. A 46% name-collision rate and no reliable quality signal means choosing a skill is still manual labour.
  • No platform-level permission model. See 7.2.

8学习资源与术语表Where to go next, plus a glossary

渐进式披露(progressive disclosure)
只在需要时才把详细内容读进上下文的加载策略。Skills 的核心机制。
程序性知识(procedural knowledge)
「这类事情该怎么一步步做」的知识,区别于「这是什么」的事实性知识。Skills 装的主要是前者。
上下文税(context tax)
一个技能的 description 在每次会话都要占用的固定 token 开销,不管技能是否触发。乘以团队人数和会话频率后会变得可观。
欠触发(under-trigger)
模型倾向于不去调用本该调用的技能。对策是把 description 写得更具体、更「强势」。
上下文投毒(context poisoning)
攻击者通过正常渠道投递一个含恶意指令的文件(如 SKILL.md),让 Agent 把它当成合法指令执行。
pp(percentage point,百分点)
两个百分数之间的绝对差值。33.9% → 50.5% 是 +16.6pp,不是 +16.6%。
Progressive disclosure
A loading strategy that pulls detail into context only when it's needed. The core mechanism behind skills.
Procedural knowledge
Knowledge of how a class of task is done, step by step — as opposed to factual knowledge of what something is. Skills mostly package the former.
Context tax
The fixed token cost a skill's description imposes on every session, whether or not it fires. Multiplied by headcount and session frequency, it stops being trivial.
Under-triggering
A model's tendency to skip a skill it should have invoked. The fix is a more specific, slightly pushier description.
Context poisoning
Delivering a file containing malicious instructions (e.g. a SKILL.md) through a normal distribution channel so the agent executes it as legitimate guidance.
pp (percentage points)
The absolute difference between two percentages. 33.9% → 50.5% is +16.6pp, not +16.6%.
带走的三句话Three things to take away ① Skills 的价值不在格式,在加载策略——所以 description 是最重要的一行。② 效果真实但方差极大,先写 eval 再写技能是唯一能分辨「帮上忙」和「加噪声」的办法。③ 装第三方技能等同于装一个依赖,按依赖来审,不要按文档来读。 ① The value of skills lies in the loading strategy, not the format — which is why the description is the most important line you'll write. ② The benefit is real but wildly variable; writing the eval before the skill is the only way to tell "helped" from "added noise." ③ Installing a third-party skill is installing a dependency. Review it like one, not like a document.