skill-editor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skills Editor Skill

技能编辑器Skill

Description

说明

This skill enables the agent to create and maintain "Agent Skills" - modular capabilities that extend the agent's functionality. It ensures that all skills follow the standardized directory structure and file format required by the deepagents environment.
此技能允许Agent创建和维护「Agent Skills」——用于扩展Agent功能的模块化能力。它确保所有技能都符合deepagents环境要求的标准化目录结构和文件格式。

When to Use

使用场景

  • When the user asks to "create a skill" or "add a capability".
  • When the user wants to package a specific workflow (e.g., "teach the agent how to handle PDF invoices").
  • When modifying existing skills to add new resources or update instructions.
  • 当用户要求「创建技能」或「添加功能」时。
  • 当用户想要打包特定工作流时(例如:「教Agent如何处理PDF发票」)。
  • 修改现有技能以添加新资源或更新说明时。

Skill Structure Rules

技能结构规则

Every skill must reside in its own directory and contain a
SKILL.md
file.
每个技能必须位于独立目录中,且包含一个
SKILL.md
文件。

1. Directory Structure

1. 目录结构

Create a new directory for the skill (e.g.,
pdf-processing/
). Inside, the
SKILL.md
is mandatory. Other files are optional but recommended for complex tasks to keep the context window light (Progressive Disclosure).
text
skill-name/
├── SKILL.md          # (Required) Main instructions and metadata
├── REFERENCE.md      # (Optional) Detailed API docs or reference material
├── FORMS.md          # (Optional) Specialized guides
└── scripts/          # (Optional) Executable scripts
    └── utility.py
为技能创建一个新目录(例如:
pdf-processing/
)。 目录内必须包含
SKILL.md
文件,其他文件为可选,但对于复杂任务建议添加,以减少上下文窗口的负担(渐进式披露)。
text
skill-name/
├── SKILL.md          # (Required) Main instructions and metadata
├── REFERENCE.md      # (Optional) Detailed API docs or reference material
├── FORMS.md          # (Optional) Specialized guides
└── scripts/          # (Optional) Executable scripts
    └── utility.py

2. SKILL.md Format

2. SKILL.md 格式

The
SKILL.md
file must start with YAML frontmatter, followed by markdown instructions.
Frontmatter Requirements:
  • name
    : Max 64 chars, lowercase letters, numbers, and hyphens only. No reserved words ("anthropic", "claude").
  • description
    : Max 1024 chars. Must explain what the skill does and when to use it.
Content Sections:
  • # [Skill Name]
  • ## Instructions
    : Step-by-step guidance.
  • ## Examples
    : Concrete usage examples.
SKILL.md
文件必须以YAML前置元数据开头,后跟Markdown格式的说明。

Instructions - How to Create a Skill

前置元数据要求

MUST use the
todowrite
and
todoread
tools to track progress of the execution of the below steps:
  • name
    :最多64个字符,仅允许小写字母、数字和连字符。不得使用保留词("anthropic"、"claude")。
  • description
    :最多1024个字符。必须说明该技能的功能以及使用场景

Step 1: Check for Similar Online Skills

内容板块

Before creating or editing a skill, MUST run a quick web-search (use the
webfetch
tool) to find any existing, similar skills online (for example, Anthropic's official skills at https://github.com/anthropics/skills/tree/main/skills or community-maintained lists). If similar skills are found:
  • If the license and terms allow reuse, prefer adapting them as a template and include a clear reference/link in the new skill's SKILL.md ("Based on: <url>").
  • If the license requires attribution or imposes conditions, include the original LICENSE.txt (or a pointer) in the new skill directory and follow the license terms. If the license is incompatible with your intended use, notify the user and request guidance before importing.
  • # [Skill Name]
  • ## Instructions
    :分步指导。
  • ## Examples
    :具体使用示例。

Step 2: Check for Existing Skills

操作说明 - 如何创建技能

Before creating a new skill and not using an online skill as a template, search for existing or similar local skills and reuse their structure, examples, and patterns as a starting point.
必须使用
todowrite
todoread
工具跟踪以下步骤的执行进度:

Step 3: Create the Directory

步骤1:查找同类在线技能

Create a directory under
.opencode/skills/
with a kebab-case name matching the skill's purpose.
在创建或编辑技能之前,必须运行快速网络搜索(使用
webfetch
工具)以查找任何已有的同类在线技能(例如,Anthropic官方技能库:https://github.com/anthropics/skills/tree/main/skills 或社区维护的列表)。如果找到同类技能:
  • 如果许可证和条款允许复用,优先将其作为模板进行改编,并在新技能的
    SKILL.md
    中明确添加引用/链接(格式:"基于:<链接地址>")。
  • 如果许可证要求署名或有其他条件,需在新技能目录中包含原始LICENSE.txt文件(或指向该文件的链接),并遵守许可证条款。如果许可证与你的预期使用场景不兼容,需通知用户并在导入前请求指导。

Step 4: Create SKILL.md

步骤2:检查现有技能

Write the
SKILL.md
file with the required frontmatter and sections.
Template:
markdown
---
name: my-new-skill
description: Brief description of what this skill does and when to use it.
---
在创建新技能且不使用在线技能作为模板之前,先搜索本地已有的同类技能,并以它们的结构、示例和模式作为起点进行复用。

My New Skill

步骤3:创建目录

Instructions

[Clear, step-by-step guidance for the agent to follow]
.opencode/skills/
目录下创建一个短横线命名法(kebab-case)的目录,名称需与技能用途匹配。

Examples

步骤4:创建SKILL.md文件

[Concrete examples of using this skill]
undefined
编写包含必填前置元数据和板块的
SKILL.md
文件。
模板:
markdown
---
name: my-new-skill
description: Brief description of what this skill does and when to use it.
---

Step 5: Add Supporting Files (Optional)

My New Skill

Instructions

If the skill requires large reference texts or scripts, create separate files (e.g.,
scripts/main.py
,
docs/api.md
) and reference them in
SKILL.md
. The agent will read these only when needed.
[Clear, step-by-step guidance for the agent to follow]

Step 6: Update dependencies (Optional)

Examples

Add any required dependencies to the project's
requirements.txt
file using
uv pip install <package>
so the project's virtual environment is updated.
[Concrete examples of using this skill]
undefined

Step 7: Highlight necessary environment variables (Optional)

步骤5:添加支持文件(可选)

If a skill's scripts require environment variables (API keys, tokens, credentials), list them clearly in the SKILL.md
Credentials
section with the expected variable names (e.g.,
GITHUB_ACCESS_TOKEN
,
YOUTUBE_API_KEY
). When creating a new skill, surface these required env vars to the user and advise adding them to the project's .env file or system environment before running the scripts.
如果技能需要大量参考文本或脚本,可创建单独文件(例如:
scripts/main.py
docs/api.md
)并在
SKILL.md
中引用它们。Agent仅在需要时才会读取这些文件。

Best Practices

步骤6:更新依赖项(可选)

  • Progressive Disclosure: Don't put everything in
    SKILL.md
    . Use it as an entry point that links to other files.
  • Deterministic Code: Prefer Python scripts for complex logic or data processing over natural language instructions.
  • Concise Scripts: When creating script files, keep them concise—clear purpose, small functions, minimal external dependencies, and avoid unnecessary complexity.
  • Clear Triggers: Ensure the
    description
    clearly states when the skill should be used so the router can pick it up correctly.
  • Confirm changes: Confirm changes with the user before executing any steps.
使用
uv pip install <package>
命令将所需依赖项添加到项目的
requirements.txt
文件中,以便更新项目的虚拟环境。

步骤7:标注必要的环境变量(可选)

如果技能的脚本需要环境变量(API密钥、令牌、凭证),需在
SKILL.md
的「Credentials」板块中清晰列出预期的变量名称(例如:
GITHUB_ACCESS_TOKEN
YOUTUBE_API_KEY
)。创建新技能时,需向用户说明这些必填环境变量,并建议在运行脚本前将其添加到项目的.env文件或系统环境中。

最佳实践

  • 渐进式披露:不要将所有内容都放在
    SKILL.md
    中。将其作为入口点,链接到其他文件。
  • 确定性代码:对于复杂逻辑或数据处理,优先使用Python脚本而非自然语言说明。
  • 简洁脚本:创建脚本文件时,保持简洁——明确的用途、小巧的函数、最少的外部依赖,避免不必要的复杂性。
  • 清晰触发条件:确保
    description
    中明确说明技能的使用场景,以便路由模块能正确识别。
  • 确认变更:在执行任何步骤前,需与用户确认变更内容。