skill-portability
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseskill-portability
—
Audits whether an agent skill loads and behaves correctly across the major
providers — Claude Code, Cursor, OpenAI Codex CLI, and the Agents-Skills
Baseline (covering Gemini CLI, OpenCode, Pi). See
for the canonical list. The audit covers three layers:
scripts/providers.mjs- Format-level — does the file/dir structure and frontmatter match what the provider expects?
- Body-level — does the body reference provider-specific conventions (XML tags, headings) that other providers ignore?
- Tool-surface-level — does the body name tools (e.g.,
) that only exist in one provider?
AskUserQuestion
The canonical provider list, required/forbidden frontmatter fields, and
bundled doc snapshots live in
and . Provider docs are
refreshed at authoring time via
and committed — the audit never fetches at runtime, so per-provider
verdicts are deterministic and offline-capable.
scripts/providers.mjsreferences/providers/pnpm skill-tools refresh-provider-docsClaude Code extensions (其他Agent会忽略) --- argument-hint: '[<skill-path-or-name>]' user-invocable: true model-invocable: true
When to use
skill-portability
Verbatim trigger phrases:
- "is this skill cross-provider safe"
- "will my skill work in cursor"
- "will this load in codex"
- "audit skill compatibility"
- "check if this skill is portable"
- "which providers support this skill"
- "is my skill claude-only"
审计Agent技能能否在主流提供商(Claude Code、Cursor、OpenAI Codex CLI以及Agents-Skills基准测试套件,涵盖Gemini CLI、OpenCode、Pi)中正确加载并运行。提供商的标准列表请查看。审计涵盖三个层面:
scripts/providers.mjs- 格式层面 — 文件/目录结构和前置元数据是否符合提供商的要求?
- 内容层面 — 技能内容是否引用了其他提供商不支持的特定约定(如XML标签、标题格式)?
- 工具层面 — 技能内容是否调用了仅在某一个提供商中存在的工具(例如)?
AskUserQuestion
提供商的标准列表、必填/禁用的前置元数据字段以及捆绑的文档快照存储在和中。提供商文档会在开发阶段通过命令刷新并提交——审计过程中不会在运行时获取文档,因此每个提供商的判定结果是确定性的,且支持离线使用。
scripts/providers.mjsreferences/providers/pnpm skill-tools refresh-provider-docsWhen NOT to use
使用场景
- Authoring a brand-new skill → use
skill-creator - Rerunning a skill's existing eval baselines → use
skill-eval - Linting a skill against this monorepo's rules → use
pnpm skill-tools lint - Comparing skill behavior across model versions → that's , not this
skill-eval
明确的触发语句:
- "这个技能跨提供商安全吗"
- "我的技能能在Cursor中运行吗"
- "这个技能能在Codex中加载吗"
- "审计技能兼容性"
- "检查这个技能是否可移植"
- "哪些提供商支持这个技能"
- "我的技能是不是只能在Claude中使用"
Inputs
禁用场景
$ARGUMENTS- A path to a skill directory (or
skills/code-reviewer/)skills/skill-creator/ - A path to a single SKILL.md / .mdc / AGENTS.md file
- A glob () — bulk audit
skills/* - A literal frontmatter+body block pasted into the prompt
- Empty — discover via and ask which to audit
ls skills/
- 编写全新技能 → 使用
skill-creator - 重新运行技能的现有基准测试 → 使用
skill-eval - 针对本单体仓库规则对技能进行代码检查 → 使用
pnpm skill-tools lint - 跨模型版本比较技能行为 → 这是的功能,而非本技能
skill-eval
Workflow
输入参数
1. Resolve the input
—
Determine what the user is auditing.
| Input | Action |
|---|---|
| Directory path | Read the SKILL.md (or .mdc / AGENTS.md) inside |
| Single file path | Read the file directly |
| Glob | Expand and audit each match |
| Pasted content | Treat the prompt body as the skill content |
Empty | List |
Parse the frontmatter (YAML between leading markers) and remember the
body content. Both feed into the per-provider checks.
---$ARGUMENTS- 技能目录路径(例如或
skills/code-reviewer/)skills/skill-creator/ - 单个SKILL.md/.mdc/AGENTS.md文件的路径
- 通配符(例如)——批量审计
skills/* - 粘贴到提示中的前置元数据+内容块
- 空值 — 通过自动发现并询问用户要审计哪个技能
ls skills/
2. Load the canonical provider list
工作流程
—
1. 解析输入
Run the bundled ESM script — no shell required, works on macOS, Linux, and
Windows:
bash
node skills/skill-portability/scripts/providers.mjs --prettyCapture the JSON. Each entry has , , , ,
, , , ,
, , , and .
idnamefileFormatfileLocationdocUrlslocalDocPathrequiredFrontmatteroptionalFrontmatterignoredFrontmatterforbiddenFrontmattertoolSurfacenotesThis script is the single source of truth. Don't hardcode provider details
into the audit body — re-run the script each time.
确定用户要审计的对象。
| 输入类型 | 操作说明 |
|---|---|
| 目录路径 | 读取目录内的SKILL.md(或.mdc/AGENTS.md)文件 |
| 单个文件路径 | 直接读取该文件内容 |
| 通配符 | 展开通配符并审计每个匹配项 |
| 粘贴的内容块 | 将提示内容视为技能内容进行处理 |
空值 | 列出 |
解析前置元数据(开头标记之间的YAML内容)并保留技能正文内容,两者都会用于后续的提供商检查。
---3. Fan out: one agent per provider, in parallel
2. 加载标准提供商列表
Dispatch one call per provider returned by step 2 (concurrent — one
tool message with all tool uses). Don't hardcode the count —
is the source of truth and may grow. Each agent gets:
Agentproviders.mjs-
The provider entry from step 2 (id, format requirements, toolSurface, notes)
-
The bundled provider doc snapshot read from(e.g.
localDocPath). Read the file with thereferences/providers/cursor.mdtool before dispatching the subagent and pass its contents inline in the subagent prompt — do NOT instruct the subagent to fetch.Read -
The skill content from step 1 (frontmatter + body)
-
These instructions to the subagent:Use the provider doc snapshot included in this prompt — it was bundled with the skill at authoring time and is the authoritative reference for this audit. Do NOT WebFetch any URL; if the snapshot is missing details, surface that as a NOTES finding rather than fetching.Evaluate the skill against three layers:
- Format: does it match ? Are all
fileFormatfields present? Are anyrequiredFrontmatterfields present?forbiddenFrontmatter - Body: does the body lean on conventions this provider doesn't parse (e.g., XML tags Cursor strips, headings the baseline ignores)?
- Tool surface: does the body name tools not in this provider's
? List each unmatched tool name.
toolSurface
Return a structured verdict:VERDICT: compatible | partial | incompatible FORMAT: <one-line summary> BODY: <one-line summary> TOOLS: <comma-separated unmatched tool names, or "none"> NOTES: <2–3 specific findings with file/line references where possible> - Format: does it match
Use . Run all dispatches in one
message so they execute concurrently.
subagent_type: "general-purpose"运行捆绑的ESM脚本——无需shell,支持macOS、Linux和Windows:
bash
node skills/skill-portability/scripts/providers.mjs --pretty捕获JSON结果。每个条目包含、、、、、、、、、、和字段。
idnamefileFormatfileLocationdocUrlslocalDocPathrequiredFrontmatteroptionalFrontmatterignoredFrontmatterforbiddenFrontmattertoolSurfacenotes该脚本是唯一的事实来源,请勿将提供商细节硬编码到审计逻辑中——每次都要重新运行该脚本。
4. Aggregate the verdicts into a matrix
3. 并行分发:每个提供商对应一个Agent
Build a markdown table with one row per provider and one column per layer:
| Provider | Verdict | Format | Body | Tools |
| ----------------------- | ------------ | ------------------- | ------------- | -------------- |
| Claude Code | compatible | SKILL.md ✓ | clean | - |
| Cursor | partial | needs .mdc | XML stripped | - |
| OpenAI Codex CLI | partial | rename to AGENTS.md | clean | Bash → shell |
| Agents-Skills Baseline | compatible | SKILL.md ✓ | clean | tool names vary |Add a paragraph below summarizing the most actionable change to make
the skill more portable.
NOTES针对步骤2返回的每个提供商,分发一次调用(并发执行——通过一条工具消息包含所有工具调用)。请勿硬编码提供商数量——是事实来源,可能会新增提供商。每个Agent会收到:
Agentproviders.mjs-
步骤2中的提供商条目(id、格式要求、toolSurface、notes)
-
从读取的捆绑提供商文档快照(例如
localDocPath)。在分发子Agent前使用references/providers/cursor.md工具读取文件内容,并将内容内联到子Agent的提示中——请勿指示子Agent去获取文档。Read -
步骤1中的技能内容(前置元数据+正文)
-
给子Agent的以下指令:使用本提示中包含的提供商文档快照——该快照在技能开发阶段已捆绑,是本次审计的权威参考。请勿使用WebFetch获取任何URL;如果快照缺少细节,请将其作为NOTES结果列出,而非去获取文档。从三个层面评估技能:
- 格式:是否符合要求?所有
fileFormat字段是否存在?是否包含任何requiredFrontmatter字段?forbiddenFrontmatter - 内容:技能内容是否依赖该提供商不解析的约定(例如Cursor会剥离的XML标签、基准测试套件会忽略的标题)?
- 工具层面:技能内容是否调用了不在该提供商中的工具?列出每个不匹配的工具名称。
toolSurface
返回结构化的判定结果:VERDICT: compatible | partial | incompatible FORMAT: <单行摘要> BODY: <单行摘要> TOOLS: <逗号分隔的不匹配工具名称,或"none"> NOTES: <2-3条具体结果,尽可能包含文件/行号引用> - 格式:是否符合
使用。所有分发操作在一条消息中完成,以便并发执行。
subagent_type: "general-purpose"5. Write COMPAT.md and print the matrix inline
4. 将判定结果汇总为矩阵
Two outputs:
- Inline: print the matrix + notes in chat so the user sees it immediately.
- Persisted: write (or
<skill-dir>/COMPAT.mdif no skill dir), containing: the matrix, the per-provider verdict bodies, the timestamp, and the./COMPAT.mdproviders.mjsactually fetched. The user can diff this over time to spot regressions when providers move docs.docUrls
For bulk audits (glob input), produce one combined matrix where rows are
skills, columns are providers, and write at the repo root.
COMPAT.md构建一个Markdown表格,每行对应一个提供商,每列对应一个评估层面:
| 提供商 | 判定结果 | 格式检查 | 内容检查 | 工具检查 |
| ----------------------- | ------------ | ------------------- | ------------- | -------------- |
| Claude Code | 兼容 | SKILL.md ✓ | 合规 | - |
| Cursor | 部分兼容 | 需要转换为.mdc格式 | XML标签会被剥离 | - |
| OpenAI Codex CLI | 部分兼容 | 需要重命名为AGENTS.md | 合规 | Bash → shell |
| Agents-Skills Baseline | 兼容 | SKILL.md ✓ | 合规 | 工具名称因消费者而异 |在表格下方添加段落,总结使技能更具可移植性的最可行修改建议。
NOTES6. Handle missing or stale snapshots
5. 写入COMPAT.md并在聊天中打印矩阵
If any provider's doesn't exist or its snapshot is empty /
truncated to a placeholder, surface this in the inline output:
localDocPath⚠ Provider snapshot missing or sparse: `cursor` — references/providers/cursor.md
is 503 bytes (likely SPA-rendered upstream). Verdict relies on the
`notes` field. Run `pnpm skill-tools refresh-provider-docs` to refresh.Don't silently fall back to WebFetch — that's exactly the runtime fetch
behavior the bundled-snapshot design avoids. If a snapshot is genuinely
missing, treat it as in the verdict rather than guessing.
unknownTo refresh snapshots from upstream (dev-time, not runtime):
bash
pnpm skill-tools refresh-provider-docsTo verify URLs still resolve (HEAD requests, no body fetch):
bash
node skills/skill-portability/scripts/providers.mjs --check输出分为两部分:
- 即时输出:在聊天中打印矩阵+备注,让用户立即看到结果。
- 持久化输出:将内容写入(如果没有技能目录则写入
<skill-dir>/COMPAT.md),包含:矩阵、每个提供商的完整判定结果、时间戳以及./COMPAT.md中实际获取的providers.mjs。用户可以通过对比不同版本的COMPAT.md来发现提供商文档更新导致的兼容性退化。docUrls
对于批量审计(通配符输入),生成一个组合矩阵,行对应技能,列对应提供商,并将COMPAT.md写入仓库根目录。
Examples
6. 处理缺失或过期的快照
<example>
<input>"is my code-reviewer skill cross-provider safe? it's at skills/code-reviewer/"</input>
<output>
1. Resolve: read `skills/code-reviewer/SKILL.md` → frontmatter has `name`,
`description`, `argument-hint`, `user-invocable`, `model-invocable`. Body
uses `<example>` blocks and references `AskUserQuestion`, `gh pr diff`,
and a sibling `scripts/detect-clis.mjs`.
2. Load providers: `node skills/skill-portability/scripts/providers.mjs --pretty`
→ entries returned (currently 4).
3. Fan out one parallel `Agent` call per provider — Claude Code, Cursor, Codex CLI, Agents-Skills Baseline.
4. Aggregate verdicts:
| Provider | Verdict | Notes |
|---|---|---|
| Claude Code | compatible | native format |
| Cursor | partial | needs |
| OpenAI Codex CLI | partial | rename to AGENTS.md; |
| Agents-Skills Baseline | compatible | loads from |
- Write with full per-provider bodies. </output> </example>
skills/code-reviewer/COMPAT.md
- Claude Code: incompatible — missing required field;
nameCLI rejects without it.skills/globsare silently ignored.alwaysApply - Cursor: compatible — this is native format.
.mdc - Codex CLI: partial — Codex reads AGENTS.md as plain markdown; frontmatter is silently ignored, content would still apply.
- Continue.dev: partial — move to ;
.continue/rules/<name>.mdis supported,globsis not.alwaysApply
- Recommend: add to make portable; consider dropping
name: <kebab-case>since only Cursor honors it. </output> </example>alwaysApply
The bad version reintroduces the runtime URL fetch the snapshot pattern
exists to avoid. Snapshots are committed; refresh on cadence with
.
</example>
pnpm skill-tools refresh-provider-docs如果任何提供商的不存在,或快照为空/被截断为占位符,请在即时输出中提示:
localDocPath⚠ 提供商快照缺失或不完整: `cursor` — references/providers/cursor.md
大小为503字节(上游可能是SPA渲染)。判定结果基于`notes`字段。请运行`pnpm skill-tools refresh-provider-docs`来刷新快照。请勿静默回退到WebFetch——这正是捆绑快照设计要避免的运行时获取行为。如果快照确实缺失,请在判定结果中标记为,而非猜测。
unknown从上游刷新快照(开发阶段,非运行时):
bash
pnpm skill-tools refresh-provider-docs验证URL是否仍可访问(HEAD请求,不获取内容):
bash
node skills/skill-portability/scripts/providers.mjs --checkReferences
示例
- — canonical provider list, format requirements,
scripts/providers.mjsfor each provider's bundled snapshot. RunlocalDocPathto verify upstream URLs still resolve.--check - — per-provider doc snapshots (auto-generated; refresh via
references/providers/).pnpm skill-tools refresh-provider-docs - — per-provider deep dive: frontmatter shape, file location conventions, tool surface, common porting gotchas.
references/provider-formats.md - — the verbatim prompt template handed to each subagent in step 3.
references/audit-prompt.md
<example>
<input>"我的code-reviewer技能跨提供商安全吗?它在skills/code-reviewer/目录下"</input>
<output>
1. 解析输入: 读取`skills/code-reviewer/SKILL.md` → 前置元数据包含`name`、
`description`、`argument-hint`、`user-invocable`、`model-invocable`。正文使用`<example>`块并引用`AskUserQuestion`、`gh pr diff`
以及同级的`scripts/detect-clis.mjs`。
2. 加载提供商列表: `node skills/skill-portability/scripts/providers.mjs --pretty`
→ 返回4个条目。
3. 并行分发4个`Agent`调用——分别对应Claude Code、Cursor、Codex CLI、Agents-Skills Baseline。
4. 汇总判定结果:
| 提供商 | 判定结果 | 备注 |
|---|---|---|
| Claude Code | 兼容 | 原生格式支持 |
| Cursor | 部分兼容 | 需要转换为 |
| OpenAI Codex CLI | 部分兼容 | 需要重命名为AGENTS.md; |
| Agents-Skills Baseline | 兼容 | 可从 |
- 将完整的提供商判定结果写入。 </output> </example>
skills/code-reviewer/COMPAT.md
- Claude Code: 不兼容 — 缺少必填的字段;
nameCLI会拒绝加载。skills/globs会被静默忽略。alwaysApply - Cursor: 兼容 — 这是原生.mdc格式。
- Codex CLI: 部分兼容 — Codex将AGENTS.md视为纯markdown; 前置元数据会被静默忽略,但内容仍可正常运行。
- Continue.dev: 部分兼容 — 需要移动到; 支持
.continue/rules/<name>.md,但不支持globs。alwaysApply
- 建议: 添加字段以提升可移植性;考虑移除
name: <kebab-case>,因为只有Cursor支持该字段。 </output> </example>alwaysApply
错误版本重新引入了快照模式本应避免的运行时URL获取行为。快照已提交到仓库;请定期使用命令刷新。
</example>
pnpm skill-tools refresh-provider-docs—
参考资料
—
- — 标准提供商列表、 格式要求、每个提供商捆绑快照的
scripts/providers.mjs。运行localDocPath参数可验证上游URL是否仍可访问。--check - — 各提供商的文档快照(自动生成;通过
references/providers/命令刷新)。pnpm skill-tools refresh-provider-docs - — 各提供商深度解析:前置元数据格式、文件位置约定、 工具列表、常见移植陷阱。
references/provider-formats.md - — 步骤3中传递给每个子Agent的完整提示模板。
references/audit-prompt.md