skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Creator

Skill Creator

创建新的 OpenCode Skill。
Create a new OpenCode Skill.

何时使用

When to Use

用户想要创建一个新的 OpenCode skill 时使用。
Use this when the user wants to create a new OpenCode Skill.

重要参考

Important References

在创建 skill 之前,必须阅读以下文档:
  • SKILL.md 格式规范 — YAML frontmatter 和 Markdown 正文的格式要求
  • 目录结构规范 — scripts/references/assets 的用途和选择
  • 脚本语言选择指南 — 何时需要脚本 + 语言选择原则
  • 路径引用规范必读:skill 内部资源的合规引用方式(相对路径 / Markdown 链接,禁止硬编码绝对路径)

Before creating a skill, you must read the following documents:
  • SKILL.md Format Specification — Format requirements for YAML frontmatter and Markdown content
  • Directory Structure Specification — Purpose and selection of scripts/references/assets
  • Script Language Selection Guide — When scripts are needed + language selection principles
  • Path Resolution SpecificationMust-read: Compliant way to reference internal skill resources (relative paths / Markdown links, hard-coded absolute paths are prohibited)

生态字段(可选 frontmatter)

Ecosystem Fields (Optional Frontmatter)

agentskills.io 规范除必填的
name
description
外,还支持以下可选字段(创建时按需选用,不要为填而填):
字段用途示例
license
许可证名称,或指向随 skill 附带的许可证文件
license: MIT
/
license: Proprietary. LICENSE.txt has complete terms
compatibility
环境要求(目标产品、系统包、网络访问等),1-500 字符,大多数 skill 不需要
compatibility: Requires Python 3.14+ and uv
metadata
自定义键值对元数据(author、version、category 等),可含
supportedAgents
声明兼容的 Agent
见下例
allowed-tools
空格分隔的预授权工具列表(实验性字段,各 Agent 支持程度不一)
allowed-tools: Read Write Edit Bash
yaml
metadata:
  author: your-name
  version: "1.0.0"
  supportedAgents: ["claude-code", "opencode"]
要点
  • license
    :可选,写法参考本仓库其他 skill(如
    license: MIT
    )。
  • metadata.supportedAgents
    :声明该 skill 面向的 Agent 列表;省略表示全兼容。
  • allowed-tools
    :可选,写法参考本仓库其他 skill(如
    allowed-tools: Bash
    )。格式必须为空格分隔字符串
    allowed-tools: Read Write Edit
    ),支持子命令限制形式(如
    Bash(git:*)
    );不要写成 YAML 数组或逗号分隔。不写则工具默认全部可用。

In addition to the required
name
and
description
, the agentskills.io specification supports the following optional fields (use as needed when creating, do not fill for the sake of filling):
FieldPurposeExample
license
Name of the license, or a link to the license file included with the skill
license: MIT
/
license: Proprietary. LICENSE.txt has complete terms
compatibility
Environment requirements (target products, system packages, network access, etc.), 1-500 characters, most skills do not require it
compatibility: Requires Python 3.14+ and uv
metadata
Custom key-value pair metadata (author, version, category, etc.), can include
supportedAgents
to declare compatible Agents
See example below
allowed-tools
Space-separated list of pre-authorized tools (experimental field, support varies by Agent)
allowed-tools: Read Write Edit Bash
yaml
metadata:
  author: your-name
  version: "1.0.0"
  supportedAgents: ["claude-code", "opencode"]
Key Points:
  • license
    : Optional, refer to other skills in this repository for writing style (e.g.,
    license: MIT
    ).
  • metadata.supportedAgents
    : Declare the list of Agents this skill is intended for; omitting it means full compatibility.
  • allowed-tools
    : Optional, refer to other skills in this repository for writing style (e.g.,
    allowed-tools: Bash
    ). Must be a space-separated string (e.g.,
    allowed-tools: Read Write Edit
    ), supports subcommand restriction format (such as
    Bash(git:*)
    ); do not write as YAML array or comma-separated. If not specified, all tools are available by default.

创建流程

Creation Process

Phase 1: 澄清需求

Phase 1: Clarify Requirements

一轮问完所有需要的信息。 包括:
  • 使用场景:这个 skill 在哪些情况下会被调用?举 2-3 个典型场景。
  • 输入/输出:输入什么 → 产出什么?
  • 边界情况:有没有需要特别处理的边界?
  • skill 名字(kebab-case)
  • 触发词:什么时候应该触发?列出用户可能说的关键词
  • 输出格式:产出有什么格式要求?
  • 安装位置:这个 skill 的最终目标路径是哪里?(这是唯一位置,不存在 deploy 步骤)
询问用户直接在主对话中进行即可(提问/确认都是普通对话,不需要专门的 question 工具)。
allowed-tools
为可选字段,不写则工具默认全部可用。
关于"安装位置"必问的 3 个子问题:
  1. 使用范围:这个 skill 给当前用户所有项目用(全局),还是只给当前项目用(项目级)?
  2. 项目自定义目录:当前项目根目录是否已经有 skill 目录约定(非
    .opencode/skills/
    ,例如
    skills/
    .agents/skills/
    )?如果有,优先用项目自己的约定。
  3. .opencode
    是否在
    .gitignore
    :如果是项目级 skill 且要随 Git 共享,需要确认
    .opencode/
    没被忽略,否则换
    skills/
    opencode.json
    skills.paths
位置速查(详见 目录结构规范 - 安装位置):
  • 全局通用:
    ~/.config/opencode/skills/<name>/
    ← 个人用,推荐默认
  • 项目级(随 Git 共享):
    <project>/.opencode/skills/<name>/
    ← 项目专属
  • 项目自定义:用户项目根目录的
    skills/
    等 ← 遵循项目既有约定
用以下格式总结你的理解,让用户确认:
undefined
Ask all necessary information in one round. Include:
  • Usage Scenarios: In which situations will this skill be invoked? Provide 2-3 typical scenarios.
  • Input/Output: What is the input → what is the output?
  • Edge Cases: Are there any edge cases that need special handling?
  • Skill Name (kebab-case)
  • Trigger Phrases: When should this skill be triggered? List keywords the user might say
  • Output Format: Are there any format requirements for the output?
  • Installation Location: Where is the final target path for this skill? (This is the only location, there is no deploy step)
Ask the user directly in the main conversation (questions/confirmations are regular conversations, no special question tool is needed).
allowed-tools
is an optional field; if not specified, all tools are available by default.
3 Sub-questions that must be asked about "Installation Location":
  1. Scope: Is this skill for all projects of the current user (global), or only for the current project (project-level)?
  2. Project Custom Directory: Does the current project root directory already have a skill directory convention (not
    .opencode/skills/
    , such as
    skills/
    ,
    .agents/skills/
    )? If yes, prioritize the project's existing convention.
  3. Is
    .opencode
    in
    .gitignore
    : If it is a project-level skill and needs to be shared with Git, confirm that
    .opencode/
    is not ignored; otherwise, use
    skills/
    or
    skills.paths
    in
    opencode.json
    instead.
Location Quick Reference(See Directory Structure Specification - Installation Location for details):
  • Global Use:
    ~/.config/opencode/skills/<name>/
    ← For personal use, recommended default
  • Project-level (Shared with Git):
    <project>/.opencode/skills/<name>/
    ← Exclusive to the project
  • Project Custom:
    skills/
    or other directories in the user's project root ← Follow the project's existing convention
Summarize your understanding in the following format and ask the user to confirm:
undefined

我的理解

My Understanding

  • 解决的问题:{一句话}
  • 典型场景:{2-3 个场景}
  • 输入/输出:{输入} → {输出}
  • 边界:{需要注意的边界}
  • skill 名字:
    {name}
  • 触发词:{触发词列表}
  • 安装位置:
    {绝对路径}
    ← 这是最终目标,创建后即可使用,无需复制
以上理解正确吗?

**以上理解正确吗?请确认,或补充遗漏的信息。**
  • Problem Solved: {one sentence}
  • Typical Scenarios: {2-3 scenarios}
  • Input/Output: {input} → {output}
  • Edge Cases: {notable edge cases to watch for}
  • Skill Name:
    {name}
  • Trigger Phrases: {list of trigger phrases}
  • Installation Location:
    {absolute path}
    ← This is the final location, ready to use after creation, no need to copy
Is the above understanding correct?

**Is the above understanding correct? Please confirm, or supplement any missing information.**

Phase 2: 创建文件

Phase 2: Create Files

直接在主对话里写 SKILL.md。 根据实际复杂度判断是否需要 scripts/、references/、assets/ 子目录。
  1. 创建目录结构
  2. 写入 SKILL.md
  3. 如需 scripts/,创建并写入脚本文件
  4. 如需 references/,创建并写入参考文档
  5. 如需 assets/,创建并写入资源文件
关键:SKILL.md 中引用 skill 内部资源(scripts/、references/、assets/ 等子目录下的文件)时,用相对路径(相对于 skill 目录,如
scripts/main.py
)或 Markdown 链接(如
[指南](references/guide.md)
),详见 路径引用规范禁止硬编码绝对路径(如
~/.config/opencode/skills/xxx
),禁止
@path
语法(如
@scripts/xxx
——agentskills.io 规范不允许,其他 Agent 无法识别)。
bash
undefined
Write SKILL.md directly in the main conversation. Determine whether subdirectories like scripts/, references/, assets/ are needed based on actual complexity.
  1. Create directory structure
  2. Write SKILL.md
  3. If scripts/ is needed, create and write script files
  4. If references/ is needed, create and write reference documents
  5. If assets/ is needed, create and write resource files
Key: When referencing internal skill resources (files in subdirectories like scripts/, references/, assets/) in SKILL.md, use relative paths (relative to the skill directory, e.g.,
scripts/main.py
) or Markdown links (e.g.,
[Guide](references/guide.md)
), see Path Resolution Specification for details. Prohibit hard-coded absolute paths (e.g.,
~/.config/opencode/skills/xxx
), prohibit
@path
syntax (e.g.,
@scripts/xxx
— not allowed by agentskills.io specification, cannot be recognized by other Agents).
bash
undefined

示例:全局 skill —— 这一步就是最终位置

Example: Global skill — This is the final location

mkdir -p ~/.config/opencode/skills/{skill-name}/
mkdir -p ~/.config/opencode/skills/{skill-name}/

示例:项目级 skill —— 这一步也是最终位置

Example: Project-level skill — This is also the final location

mkdir -p .opencode/skills/{skill-name}/

> ⚠️ **关键澄清**:`mkdir -p` 创建的目录就是 skill 的**最终存放位置**。OpenCode 通过纯文件发现机制加载 skill(扫描 6+ 个已知路径,后发现的同名 skill 覆盖先发现的),**不存在 "deploy 到全局" 这一步骤**。如果用户要"全局"skill,直接写到 `~/.config/opencode/skills/<name>/` 即可,不要先写到 `.opencode/skills/` 再复制。

**写完后告知用户文件路径,让用户直接 review 最终文件。** 用户可以:

- 直接使用(无需回复)
- 提出修改意见(进入修改循环)
- 删除文件重来

---
mkdir -p .opencode/skills/{skill-name}/

> ⚠️ **Key Clarification**: The directory created by `mkdir -p` is the **final storage location** of the skill. OpenCode loads skills through a pure file discovery mechanism (scans 6+ known paths, later discovered skills with the same name override earlier ones), **there is no "deploy to global" step**. If the user wants a "global" skill, write directly to `~/.config/opencode/skills/<name>/`, do not write to `.opencode/skills/` first and then copy.

**After writing, inform the user of the file path and let them directly review the final files.** The user can:

- Use it directly (no reply needed)
- Propose modification suggestions (enter modification loop)
- Delete files and start over

---

⚠️ 重要提醒

⚠️ Important Reminder

Phase 1 必须完成:理解用户问题要透彻,不清楚就问。

Phase 1 must be completed: Understand the user's problem thoroughly, ask if unclear.

目录结构完整说明

Complete Directory Structure Description

skill-name/
├── SKILL.md              # 必选:指令 + 元数据
├── scripts/              # 可选:可执行脚本
├── references/          # 可选:参考文档
└── assets/              # 可选:模板/资源
skill-name/
├── SKILL.md              # Required: Instructions + Metadata
├── scripts/              # Optional: Executable scripts
├── references/          # Optional: Reference documents
└── assets/              # Optional: Templates/Resources