harness
它能做什么
这份指南说明智能体技能的结构,包括其 SKILL.md 文件、参考文档和脚本,以及技能可以存放的位置。适合为 AI 智能体设置技能的开发者。
适用场景
- ✓当你想为智能体用 SKILL.md 文件打包一项技能时。
- ✓当你需要了解技能可以从哪里安装,例如 Git 仓库或共享工作区时。
- ✓当你想为智能体设置每个用户专用的技能文件夹的时候。
技能链接
https://github.com/agentscope-ai/agentscope-java/blob/main/docs/v2/en/docs/harness/skill.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请说明如何为我的 AgentScope 智能体打包一项技能,包括文件夹结构以及应该存放在哪里。”
每周 5 个新技能,1 分钟读完。
工作原理
这份指南把技能描述为一个文件夹,其中包含告诉智能体该做什么的 SKILL.md 文件,并可选择性地包含参考文件和脚本。它还说明,共享技能文件夹和每个用户专用的技能文件夹可以同时生效。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
A skill is a packaged capability: a directory with a SKILL.md (purpose + instructions the agent reads), optional reference docs, scripts, samples. Hand it to the agent and it will use it when relevant.
Harness lets you install skills from two places:
- Skill marketplaces — Git repo, Nacos, MySQL, classpath, custom stores
- Workspace —
workspace/skills/is shared by everyone;<userId>/skills/isolates per user
Both sources are active simultaneously — no need to choose one. On top of that you can enable a self-learning loop: the agent drafts skills → review gate → background curator tidies up.
A skill directory looks like:
code-reviewer/
├── SKILL.md # required — YAML frontmatter (name + description) + instructions for the agent
├── references/ # optional — long-form docs the agent reads on demand
│ └── style-guide.md
└── scripts/ # optional — executable scripts the agent can shell out to
└── run-checks.sh
Save SKILL.md as UTF-8. A byte order mark (BOM) before the opening --- is supported.
Close the YAML frontmatter with an unindented line containing only --- and optional spaces or tabs. A --- inside a description or an indented YAML block scalar remains part of the metadata.
Skill names must match ^[a-z0-9][a-z0-9-]*$ and be at most 64 characters (lowercase letters, digits, and hyphens only — no underscores or dots), following the industry naming standard for Agent Skills. Names are used verbatim as directory keys and skill identifiers, so non-conforming names are rejected when the skill is constructed or loaded.
SKILL.md format:
---
name: code-reviewer
description: Use when the user asks for code review, style feedback, or PR audits.
---
# Code Reviewer
Steps:
1. Read `references/style-guide.md` for project conventions.
2. Run `scripts/run-checks.sh <target-path>` and summarize the output.
A quick example
Plug in your team's skill repo and the agent can use it immediately:
HarnessAgent agent = HarnessAgent.builder()
.name("assistant")
.model(model)
.workspace(workspace)
.skillRepository(new GitSkillRepository("https://github.com/your-org/team-skills.git"))
.build();
During reasoning, the agent sees skills from the repo and calls load_skill_through_path for whichever one it needs.
Marketplace stores
skillRepository(...) is the unified entry point — pass any store.
Git
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-extensions-skill-git-repository</artifactId>
<version>${agentscope.version}</version>
</dependency>
.skillRepository(new GitSkillRepository("https://github.com/your-org/team-skills.git"))
By default, each read does a lightweight remote check, pulling only when HEAD changed. If the repo has a skills/ subdirectory, that's the root; otherwise the repo root is. To control sync timing yourself: new GitSkillRepository(url, false), then call repo.sync() manually.
Nacos
<dependency>
<groupId>io.agentscope</groupId>
<artifactId>agentscope-extensions-nacos-skill</artifactId>
<version>${agentscope.version}</version>
</dependency>
NacosSkillRepository market = new NacosSkillRepository(aiService, "namespace");
HarnessAgent.builder()
.skillRepository(market)
.build();
Best for online distribution + change subscription. market is AutoCloseable; close it on shutdown to release subscriptions.
MySQL
MysqlSkillRepository registry = MysqlSkillRepository.builder(dataSource)
.databaseName("agentscope")
.skillsTableName("skills")
.createIfNotExist(true)
.writeable(true)
.build();
HarnessAgent.builder()
.skillRepository(registry)
.build();
Common for platform-side skill management. writeable(true) lets agents write back; pass false for read-only distribution.
Classpath
Ship skills inside your JAR:
src/main/resources/skills/
└── code-reviewer/
└── SKILL.md
.skillRepository(new ClasspathSkillRepository("skills"))
Works with both standard JARs and Spring Boot fat JARs.
Multiple stores
Call skillRepository(...) multiple times; later ones win:
HarnessAgent.builder()
.skillRepository(communityMarket)
.skillRepository(internalRegistry)
.skillRepository(teamGitRepo)
.build();
Wor
常见问题
技能中必需的文件是什么?
每项技能都需要一个 SKILL.md 文件,并在文件顶部写明名称和描述。
技能可以从哪里获取?
指南提到 Git 仓库,以及共享或每个用户专用的工作区文件夹。
有什么命名规则?
技能名称使用小写字母、数字和连字符,最多 64 个字符。
详情
作者的原始描述
Four-layer skill composition, skill marketplaces, the self-learning loop
热度
- GitHub 星标
- 6.2k
- 排名
- #14393
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agentscope-java
6.2k帮你的智能体用 Java 编写非阻塞的 AgentScope 代码,AgentScope 是基于 Project Reactor 的多智能体框架。
data-report
6.2k帮你的智能体把数据集汇总成报告,包括平均值、总数、范围和趋势,并保存为 Markdown 文件。
data-transform
6.2k帮你的智能体在 CSV 和 JSON 等格式之间转换数据文件,使数据可以在其他工具中使用。
git-changelog
6.2k帮你的智能体根据 Git 历史编写变更日志或发布说明,并按新功能、修复和其他改动分组。