Agent Skills 正在变成新标准:一份能被任意代理加载的技能,该怎么写

结论先说:11 月第一周,anthropics/skills、google/skills、mattpocock/skills、cloudflare/security-audit-skill 同一天冲上 GitHub Trending。它们做的事不同,但共享一个文件——SKILL.md。Anthropic 把它沉淀成了跨代理的标准,规范站点是 agentskills.io(源:GitHub Trending 2026-11-07;Anthropic skills 仓库 2026-11-06 更新)。

一个 skill 就是给 LLM 的即插即用插件

Agent Skills 的本质很简单:一个文件夹,里面有一份 SKILL.md(YAML frontmatter + 自然语言指令),可选带脚本和资源。代理在需要时动态加载它,而不是把所有流程都塞进 system prompt。好处是上下文更省、能力可组合、还能跨团队和跨代理复用。

规范里两个容易踩的坑

frontmatter 只需要两个字段:name 和 description。但实测有两个坑:

  • description 不能超过 1024 字符:anthropics/skills 自己就把一条 1176 字符的 description 砍到 992 字符,因为上传校验会卡这个上限。而 description 是代理决定「要不要加载这个技能」的唯一依据,写得太短或太泛,技能永远不会被触发。
  • name 不能含保留词:claude 和 anthropic 这两个词不能出现在技能名里。anthropics/skills 仓库里就有一条提交把 claude-academy-guide 改名成 academy-guide,原因正是 reserved words。
---
name: pr-title-lint
description: Enforce Conventional Commits for PR/commit titles. Use when a PR is opened or a commit title looks non-conforming.
---
# PR Title Lint
Reject titles that do not match type(scope): summary.
## Steps
1. Read the title from the argument or the latest commit.
2. Match ^(feat|fix|docs|refactor|test|chore)(.+)?: .+$
3. On mismatch, print the suggested fix and exit 1.

为什么是「标准」而不是「功能」

看 star 数就知道了:mattpocock/skills 约 31.7 万、anthropics/skills 约 18.8 万、google/skills 约 2.3 万。生态已经自发聚拢,skills.sh 提供的 CLI 让安装跨平台:

npx skills add https://github.com/cloudflare/security-audit-skill --skill security-audit
npx skills add ./pr-title-lint --global

这是 2026 年 agent 工程里最被低估的一块基建:它把「能力」从模型权重和 prompt 里抽出来,变成可版本化、可审计、可分享的单元。

案例:cloudflare/security-audit-skill 把审计做成流水线

它不是一个提示词,而是一个六阶段流程:侦察到覆盖驱动猎杀,到候选验证,到结构化输出(findings.json + report-schema.json),再到独立记录复核,最后出目标中立报告。两个设计值得抄:

  • 对抗验证:验证某条发现是否成立的 agent,绝不是发现它的那个 agent。自己查自己永远偏乐观。
  • 只在确认边界失效时才确认:拿不准的标 needs_validation,宁可挂着也不下结论;severity 要 impact 乘 likelihood,而不是「偏离清单就扣分」。

它还硬性要求 OS 级沙箱(禁外网、限资源、只写 scratch)——否则结论只能停在 needs_validation,根本不执行目标代码。这条正好和「让 agent 操作仓库先上沙箱」呼应。

分步实操:写一个最小 skill 并用 CLI 装起来

照着上面的 frontmatter 建一个文件夹,再补一个真正能跑的 lint 脚本:

#!/usr/bin/env bash
# pr-title-lint.sh
title="$1"
python3 - "$title" <<'PY'
import sys, re
title = sys.argv[1]
pat = r'^(feat|fix|docs|refactor|test|chore)(\([^)]+\))?:\s.+$'
if not re.match(pat, title):
    print("bad title:", title)
    sys.exit(1)
PY

本地装好并验证触发:

npx skills add ./pr-title-lint --global
# 让代理对一条不合规标题跑这个 skill,应返回 exit 1

写在最后

skill 等于「给代理装插件」,而插件能带任意脚本。所以铁律只有一条:只装来源可信的 skill,装之前先读一遍它的 SKILL.md 和脚本,并在沙箱里跑。把能力做成可审计的单元,agent 工程才算真正工程化。

相关阅读

问题反馈

本站是纯前端静态站,没有后端也没有账号系统,反馈走 GitHub Issues、讨论区或邮件。

粘贴到 issue 或邮件里能帮我更快定位问题,其中不含你输入的任何内容

其它:查看已有反馈 · 邮件反馈(无需 GitHub 账号):278975598@qq.com