惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 见路非道

Flag Tone:如何匹配旗子条纹颜色(2026完整指南) Mog Omegle 2026 完全指南:如何运行一场 AI PSL 颜值对比 Toon Tone:用更简洁、更易分享的色彩匹配游戏练习色彩记忆 CurateClick 2026年4月每周精选:发现、访问与创意AI Hy-MT1.5-1.8B-2bit:腾讯开源 574MB 能打败 72B 巨人的移动端翻译模型 Qwen3.6-35B-A3B 全面评测:阿里开源模型如何超越前沿级水平 SBTI 和 SBTI Skill 完全指南:Claude 驱动的超大型人格测试 Happy Horse:重新定义2026年AI视频生成的最强模型 OpenClaw Dreaming 完全指南 2026:AI 代理的后台记忆整合 Qwen3.6-Plus:阿里低调憋大招,百万Token上下文企业级AI旗舰发布 CurateClick 应用推荐(2026年3月22日版) 2026年完全指南:OpenClaw LCM 插件 — 再也不会丢失任何对话 ACE-Step 1.5:2026年开源AI音乐生成完全指南 用 OpenClaw 构建 CBT 疗法 Agent — 2026 年完整指南 Claude Code Telegram 官方插件:完整配置指南 2026 小米 MiMo-V2 系列完全指南 2026:Pro/Omni/TTS 三大模型全面解读 MiroThinker-1.7:改变深度研究的新一代SOTA开源AI研究代理 GLM-5-Turbo完全指南2026:中国新世代前沿AI模型 Openclaw MemorySearch 配置 OpenClaw ACP 配置 OpenClaw imageModel 配置指南 2026 完整指南:Moltbook — AI Agent 社交网络革命 Moltbot: 2026年终极个人AI助手完整指南 Qwen3-TTS:2026年开源语音克隆与AI语音生成完全指南
OpenClaw Skills 机制总结
见路非道 · 2026-03-08 · via 博客园 - 见路非道

OpenClaw Skills 机制总结

一、什么是 Skill

Skill 是一个包含 SKILL.md 的目录,遵循 AgentSkills 规范。它通过 Markdown 指令教 LLM 如何使用特定工具或工作流。

my-skill/
├── SKILL.md          # 必须:定义 + 指令
├── scripts/          # 可选:可执行脚本
├── references/       # 可选:按需加载的参考文档
└── assets/           # 可选:输出用的资源文件

SKILL.md 结构:

---
name: my-skill
description: 一句话描述,帮助 LLM 判断何时触发
user-invocable: true
metadata:
  { "openclaw": { "emoji": "", "skillKey": "my-skill", "requires": { "bins": ["some-cli"] } } }
---

这里是 Markdown 正文,包含 LLM 使用该 skill 的完整指令...

二、Skill 存储位置(按优先级从低到高)

插件/扩展 skills.load.extraDirs[] + 插件内 skills/ 第三方扩展 内置 <安装目录>/skills/ 随 OpenClaw 发布(35+ 个) 本地管理 ~/.openclaw/skills/ 用户全局 skill 个人 agents ~/.agents/skills/ 跨项目个人 skill 项目 agents <workspace>/.agents/skills/ 项目级 skill 工作区 <workspace>/skills/最高优先级
来源路径说明

同名 skill,高优先级覆盖低优先级。

三、Skill 的两种触发方式

1. 模型自动触发 — skill 的 name + description 被注入到系统提示词中,LLM 根据用户意图自动判断是否调用。

2. 用户手动触发 — 在对话中输入 /skill-name(斜杠命令),直接激活该 skill。

通过 frontmatter 控制行为: - user-invocable: true — 暴露为用户斜杠命令 - disable-model-invocation: true — 仅用户手动触发,模型不自动调用 - command-dispatch: tool — 绕过模型,直接调用指定工具

四、Skill 准入门控(Gating)

通过 metadata.openclaw 中的字段控制 skill 是否可用:

{
  "openclaw": {
    "always": true,                    // 跳过所有检查,始终加载
    "os": ["darwin", "linux"],         // 操作系统限制
    "requires": {
      "bins": ["ffmpeg"],              // 必须安装的命令行工具
      "anyBins": ["bun", "node"],      // 至少安装其中一个
      "env": ["OPENAI_API_KEY"],       // 必须设置的环境变量
      "config": ["browser.enabled"]    // 必须开启的配置项
    }
  }
}

不满足条件的 skill 不会加载到 LLM 上下文中。

五、CLI 管理命令

openclaw skills list               # 列出所有 skill
openclaw skills list --eligible    # 仅显示当前可用的
openclaw skills list --verbose     # 显示缺失依赖详情
openclaw skills info <name>        # 查看单个 skill 详情
openclaw skills check              # 检查所有 skill 就绪状态

六、配置管理

~/.openclaw/openclaw.json 中:

{
  "skills": {
    // 启用/禁用 + API Key 管理
    "entries": {
      "gemini": { "enabled": true, "apiKey": "xxx" },
      "peekaboo": { "enabled": false }
    },
    // 限制内置 skill 范围
    "allowBundled": ["gemini", "peekaboo"],
    // 额外 skill 目录
    "load": {
      "extraDirs": ["~/my-skills-pack/skills"],
      "watch": true
    }
  }
}

Per-agent skill 过滤:

{
  "agents": {
    "list": [
      { "id": "coding-agent", "skills": ["gemini", "github"] }
    ]
  }
}

七、最佳实践

1. 分层管理

所有项目通用的个人 skill ~/.agents/skills/ 特定项目的 skill <project>/.agents/skills/ 团队共享的 skill(提交到 Git) <project>/skills/ 第三方 skill 包 skills.load.extraDirs
场景放哪里

2. 编写高质量 SKILL.md

  • description 精准简洁,帮助 LLM 正确判断触发时机
  • requires 声明依赖,避免运行时报错
  • 正文中写清楚何时使用 / 何时不使用(参考内置 skill 的 "Use when" / "Do NOT use" 模式)
  • 脚本放 scripts/,大段参考资料放 references/(按需加载,节省 token)

3. 控制 token 开销

每个 eligible skill 都会占用系统提示词 token。建议: - 用 enabled: false 关闭不常用的 skill - 用 allowBundled 只加载需要的内置 skill - 用 disable-model-invocation: true 让不常用但偶尔需要的 skill 仅在 /命令 时触发 - SKILL.md 正文保持精炼

4. 热重载开发

开启 skills.load.watch: true 后,编辑 SKILL.md 会自动重载(默认 250ms 防抖),开发调试时无需重启。

5. 安全注意

  • 安装 skill 依赖前会自动安全扫描(检测 child_processeval、数据外传等危险模式)
  • apiKey 存在配置文件中,通过环境变量注入运行时,运行结束后自动清理
  • 不要在 SKILL.md 中硬编码敏感信息