Agent Skill 介绍与集成

AI 时代程序员必备技能

Codex、Claude Code、Cursor、Hermes Agent、OpenClaw等工程化实战专栏 ,讲透 AI 如何接管脏活累活

概念与意义

Skill 是一种轻量级、可复用的任务执行单元,用于赋予大模型确定性行为能力,其核心目标是解决传统提示词的局限:

  1. 不可复用:每次需重复编写相似指令
  2. 无状态:无法跨会话保持上下文策略

通过将执行能力模块化为 Skill,系统能够实现清晰的职责分离,提升可扩展性、可维护性和行为可控性,并为 Agent 架构中的自动调度与复杂任务编排提供基础支撑

与 Prompt Engineering 的区别

  • Prompt Engineering 解决如何思考的问题,引导模型进行正确的理解、推理和决策
  • Skill 的核心职责是将模型的决策转化为可执行行为,支持 AI 自主触发,无需人工手动输入

规范与组成

Skill 的必需文件为 SKILL.md,是大模型识别和使用 Skill 的唯一入口,需包含两部分:

一是 YAML 前置****元数据,包括技能名称(小写字母+连字符,可作为手动调用命令)、功能描述(明确用途与边界)、版本号、作者、开源许可证、标签列表、外部依赖库

---
name: ml-paper-writing
description: Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.
version: 1.0.0
author: Orchestra Research
license: MIT
tags: [Academic Writing, NeurIPS, ICML, ICLR, ACL, AAAI, COLM, LaTeX, Paper Writing, Citations, Research]
dependencies: [semanticscholar, arxiv, habanero, requests]
---

二是 Markdown 正文指令,明确执行流程、输入输出要求、注意事项与示例,确保大模型精准执行

# ML Paper Writing for Top AI Conferences

Expert-level guidance for writing publication-ready papers targeting **NeurIPS, ICML, ICLR, ACL, AAAI, and COLM**. This skill combines writing philosophy from top researchers (Nanda, Farquhar, Karpathy, Lipton, Steinhardt) with practical tools: LaTeX templates, citation verification APIs, and conference checklists.

## Core Philosophy: Collaborative Writing

**Paper writing is collaborative, but Claude should be proactive in delivering drafts.**

The typical workflow starts with a research repository containing code, results, and experimental artifacts. Claude's role is to:

1. **Understand the project** by exploring the repo, results, and existing documentation
2. **Deliver a complete first draft** when confident about the contribution
3. **Search literature** using web search and APIs to find relevant citations
4. **Refine through feedback cycles** when the scientist provides input
5. **Ask for clarification** only when genuinely uncertain about key decisions

**Key Principle**: Be proactive. If the repo and results are clear, deliver a full draft. Don't block waiting for feedback on every section—scientists are busy. Produce something concrete they can react to, then iterate based on their response.

此外还有 3 个可选子文件夹:

  1. references/存放参考文档,提升输出准确性
  2. scripts/存放可执行脚本,实现自动化
  3. assets/存放静态资源,保障输出规范

整体而言,Skill = 元数据 + 行动指南 + 资源文件

大模型/Agent 调用 Skill 的核心机制(TODO)

大模型调用 Skill 的核心机制可简洁概括为以下五点:

  1. 语义路由
    • 用户输入指令后,主模型读取所有已注册 Skill 的 name、description 和 tags
    • 通过语义匹配,判断哪个 Skill 最符合当前任务
  2. 参数结构化
    • 模型从自然语言中提取**关键参数**
    • 将其转化为符合 Skill 定义的 JSON 对象(如 {"topic": "Transformer", "conference": "ICLR"}
  3. 环境注入与执行
    • 系统加载该 Skill 的专属行动规则和 API/工具,执行具体逻辑
    • 模型可根据复杂任务,自主串联多个 Skill
    • 如果 Skill 涉及代码执行,则在安全沙箱中执行具体操作
  4. 反思与结果整合
    • 执行结果回传给模型
    • 若报错,模型自动分析原因、修正参数或代码,并重试,直到成功

Cursor 集成 Skill

安装 OpenSkills 工具

在 Cursor 的终端中运行以下命令

npm i -g openskills

安装 Skill

在 Cursor 的终端中执行以下命令,可以到 Skillsmp 中寻找合适的 Skill

npx openskills install zechenzhangAGI/AI-research-SKILLs

npx openskills install zechenzhangAGI/AI-research-SKILLs --global  #全局安装

查看 Skill 列表

在 Cursor 的终端中运行以下命令

npx openskills list

在 Cursor 中,项目中会出现 .claude/skills/ 和或 .cursor/skills/ 目录,其中包含了导入的 Skill

Trae 集成 Skill

通过 Skill CLI 导入 Skill

进入 Skill Hub,选择一个 xlsx skill,复制 npx 命令

npx skills add https://github.com/anthropics/skills --skill xlsx

在 Trae 的终端中输入命令,若未安装 Skills CLI 会自动安装

接着选择目标 Agent 平台,并回车

选择在本项目安装还是在全局安装

若是在本项目安装,安装成功后会在本项目生成一个 .agent/skills/ 目录,该目录下保存了所有的 Skill

由于 Trae 不支持解析 .agent 目录下的 Skill,需要手动将 .agent 改为 .trae,在设置中的规则和技能中也看到了导入的 xlsx 技能

下面进行一个测试,检验是否识别到 Skill 并调用

可以看到调用了 xlsx 技能


Skill 集合站点

  1. SkillHub

  1. Skillsmp

  1. ClawHub

AI 时代程序员必备技能

Codex、Claude Code、Cursor、Hermes Agent、OpenClaw等工程化实战专栏 ,讲透 AI 如何接管脏活累活

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Uranus^

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值