如何在 Qoder、Cursor、Trae、Windsurf 等 AI Coding 工具中使用 Claude Skills

1,647 阅读4分钟

最近  Claude 的 Skills 非常火,很多团队都在研究  Skills 的原理和应用。

图片

本文先不介绍最基本的概念和用法,主要讲如何将 Claude 的 Skills 用到所有 AI Coding Agent (如 Qoder、Cursor、Trae、Windsurf )中。

图片

我们可以借助 OpenSkill ,传送门:github.com/numman-ali/…

Claude 也是其中一个贡献者!

安装与使用

要求:

  • Node.js  版本:20.6+
  • Git 用于克隆仓库

工具安装:

npm i -g openskills

安装 Skill 超级简单:

# 从 Anthropic 市场安装 (项目级别,放到 ./.claude/skills)
openskills install anthropics/skills

# 从 Anthropic 市场安装 (全局 放到 ~/.claude/skills)
openskills install anthropics/skills --global


# 从其他 GitHub 仓库安装
openskills install your-org/custom-skills

# 从本地安装
openskills install /path/to/my-skill

将 Skill 同步到其他  AI Coding 工具中:

# 同步到默认的 AGENTS.md
openskills sync

# 同步到特定目录 (如果不存在自动创建)
openskills sync --output .ruler/AGENTS.md
openskills sync -o custom-rules.md

如何让 Qoder 支持 Claude 的 Skill?

图片

第一步是安装 Skill,可以手动放到  ~/.agent/skills/ 路径,也可以通过 openskills 安装到对应路径。

图片

如果有已经存在的技能,也会让你确认是否覆盖,然后很轻松就可以装完。

图片

我们在「规则」中新增一个 AGENTS.md 规则。此时,内容是空的。

执行

openskills sync --output .qoder/rules/AGENTS.md

图片

这里选择要安装的 SKill即可。

图片

这样,这些 Skill 就被安装好了,而且始终生效!

图片

比如我们让 Qoder :“把当前项目的 README.md 使用 pdf skill 转为 PDF 并放到项目中”

它就可以按照 AGENTS.md 这个 Rule 中的指导,使用 openskills 指令使用 pdf  skill 正确将 README.md 转为 PDF 格式啦!

Cursor、Trae、Windsurf  这些支持 Rule 的 AI Coding 工具都可以采用类似的方式使用 Claude 的 Skills。

Skill 的原理

Claude Code 中

Claude Code 为什么能使用 Skill,系统提示词如下:

<skills_instructions>
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively.

How to use skills:
- Invoke skills using this tool with the skill name only (no arguments)
- When you invoke a skill, you will see <command-message>The "{name}" skill is loading</command-message>
- The skill's prompt will expand and provide detailed instructions

Important:
- Only use skills listed in <available_skills> below
- Do not invoke a skill that is already running
</skills_instructions>

<available_skills>
<skill>
<name>pdf</name>
<description>Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms...</description>
<location>plugin</location>
</skill>

<skill>
<name>xlsx</name>
<description>Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis...</description>
<location>plugin</location>
</skill>
</available_skills>

图片

Claude 使用方法:

1 当用户问“从 PDF 中取数据”

2 Claude 扫描 available_skills 发现有  pdf 这个 skill

3 调用 Skilll('pdf')

4 加载 SKILL.md 内容

5 Claude 根据技能中的描述完成负责任务

OpenSkill 中

OpenSkill 也遵循一样的结构,写到 AGENT.md 文件中

<skills_system priority="1">

## Available Skills

<!-- SKILLS_TABLE_START -->
<usage>
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively.

How to use skills:
- Invoke: Bash("openskills read <skill-name>")
- The skill content will load with detailed instructions
- Base directory provided in output for resolving bundled resources

Usage notes:
- Only use skills listed in <available_skills> below
- Do not invoke a skill that is already loaded in your context
</usage>

<available_skills>

<skill>
<name>pdf</name>
<description>Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms...</description>
<location>project</location>
</skill>

<skill>
<name>xlsx</name>
<description>Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis...</description>
<location>project</location>
</skill>

</available_skills>
<!-- SKILLS_TABLE_END -->

</skills_system>

图片

其他 Agent 使用方法:

1 当用户问“从 PDF 中取数据”

2 Claude 扫描 available_skills 发现有  pdf 这个 skill

3 调用 Bash('openskills read pdf')

4 加载 SKILL.md 内容到 Agent 上下文中

5 Claude 根据技能中的描述完成负责任务

对比

AspectClaude CodeOpenSkills
系统提示词Claude Code 内置在 AGENTS.md 中
调用方式Skill("pdf")  工具openskills read pdf  命令
提示词格式<available_skills> XML<available_skills> XML (一致)
文件夹结构.claude/skills/.claude/skills/ (一致)
SKILL.md 格式YAML + markdownYAML + markdown (一致)
渐进式加载YesYes
绑定资源references/scripts/assets/references/scripts/assets/ (一致)
MarketplaceAnthropic 市场GitHub (anthropics/skills)

OpenSkill 特殊

加载优先级

OpenSkill 的加载优先级:

  1. ./.agent/skills/ (项目级别-通用)
  2. ~/.agent/skills/ (全局-通用)
  3. ./.claude/skills/ (项目级)
  4. ~/.claude/skills/ (全局)

指令

openskills install <source> [options]  # 从 GitHub 安装 Skill, 本地和私有仓库都支持

openskills sync [-y] [-o <path>]       # 更新 AGENTS.md (or custom output)

openskills list                        # 显示已安装 skills

openskills read <name>                 #加载 skill (for agents)

openskills manage                      # 移除 skills (交互式)

openskills remove <name>               # 移除特定 skill

参数

--global — 安装到 ~/.claude/skills (默认: 项目级别)

--universal — 安装到 .agent/skills/  而不是 .claude/skills/ (优先级更高)

-y, --yes — 覆写(for scripts/CI)

-o, --output <path> —定制 sync 的输出 (default: AGENTS.md)

写在最后

本文介绍使用 openskills 实现 Claude Skills 的快速安装并可以在其他 AI Coding 工具中使用。

如果你有在其他 Agent 中使用的场景,都可以试一试!

创作不易,如果文章对你有帮助,欢迎点赞、喜欢和分享给身边需要的朋友。


欢迎关注我的公众号:悟鸣AI,后续会陆续分享比较有用的 AI 工具和比较好的 AI 经验,比较客观理性的 AI 观点等。

image.png