Files
opencode/skill/opencode/SKILL.md
voson 43e138b19e feat: 新增对话总结命令与浏览器自动化技能
- 本地化命令描述(英文→中文)

- 删除未使用命令文件

- 新增 summarize-conversation 命令

- 更新 AI 模型配置为 DeepSeek

- 新增 agent-browser 技能

- 重构技能目录结构(重命名)
2026-01-15 17:30:39 +08:00

6.0 KiB
Raw Permalink Blame History

name, description
name description
opencode Create and manage OpenCode commands and skills with templates and best practices. Use this skill when users ask to create commands or skills.

OpenCode Command and Skill Management

You are an expert in OpenCode configuration and extension development. This skill serves as the entry point for creating and managing OpenCode commands and skills.

Trigger Phrases: When users mention any of the following, automatically use this skill:

  • "创建command", "创建命令", "make command", "create command"
  • "创建skill", "创建技能", "make skill", "create skill"
  • "添加command", "添加命令", "add command"
  • "添加skill", "添加技能", "add skill"
  • "opcode command", "opencode skill"

Overview

OpenCode extensions are organized into two main types:

  • Commands: User-invoked prompts for repetitive tasks, defined in command/ directory
  • Skills: Reusable behavior definitions for agents, defined in skill/<name>/SKILL.md

Detailed Guides

This skill folder contains comprehensive guides for command and skill creation:

Command Creation

For detailed command creation guidelines, refer to:

  • skill/opencode/command-creation.md - Complete guide to creating OpenCode commands
  • Includes: file structure, templates, best practices, troubleshooting

Skill Creation

For detailed skill creation guidelines, refer to:

  • skill/opencode/skill-creation.md - Complete guide to creating OpenCode skills
  • Includes: directory structure, naming rules, templates, testing

Quick Start

To Create a Command

  1. Determine command name (kebab-case, descriptive)
  2. Default location: global (~/.config/opencode/command/)
  3. Create file: <command-name>.md
  4. Add frontmatter with description
  5. Write template with $ARGUMENTS support

To Create a Skill

  1. Validate skill name (lowercase, hyphens, alphanumeric)
  2. Default location: global (~/.config/opencode/skill/<skill-name>/)
  3. Create directory: skill/<skill-name>/
  4. Create SKILL.md with required frontmatter
  5. Add structured content: Purpose, Usage, Examples, Troubleshooting

Automatic Name Generation

When users request command or skill creation, names are automatically generated based on the description to provide a seamless experience.

For Commands:

  1. Keyword Extraction: Identify action verbs and target nouns from the description
  2. English Conversion: Convert Chinese keywords to English equivalents (e.g., "创建" → "create", "总结" → "summarize")
  3. Kebab-case Format: Combine words with hyphens, all lowercase (e.g., "create-summary")
  4. Conflict Resolution: Check if name exists in command/ directory, append numeric suffix if needed

For Skills:

  1. Function Extraction: Identify core functionality from the description
  2. Simplified Naming: Use lowercase, hyphen-separated words describing the skill's purpose
  3. Validation: Ensure name follows [a-z0-9-]+ pattern
  4. Conflict Check: Verify uniqueness in skill/ directory

Examples:

  • "创建command用于归纳总结当前对话中有价值的内容" → summarize-conversation
  • "创建skill用于管理git工作流" → git-workflow
  • "添加命令来处理图片压缩" → compress-images
  • "创建技能用于代码审查" → code-review

User Override:

If users explicitly provide a name in their request, use the provided name instead of auto-generation.

Response Guide for Creation Requests

When users ask to create commands or skills, follow this structured approach:

For "创建command" or "创建命令" requests:

  1. 自动生成名称: 基于用户描述自动生成 kebab-case 命令名称
    • 从描述中提取关键词(动词+名词)
    • 转换为英文 kebab-case 格式
    • 如果名称已存在,添加数字后缀(如 -2, -3
  2. 验证名称: 确保名称符合 kebab-case 规范
  3. 默认位置: 全局 (~/.config/opencode/command/)
  4. 创建模板:
    • 生成包含 description 的 frontmatter
    • 创建支持 $ARGUMENTS 的模板
    • 包含使用示例
  5. 写入文件: 在默认位置创建命令文件
  6. 测试: 验证文件存在且格式正确

For "创建skill" or "创建技能" requests:

  1. 自动生成名称: 基于用户描述自动生成 skill 名称
    • 从描述中提取核心功能关键词
    • 转换为小写字母、连字符格式
    • 如果名称已存在,添加数字后缀
  2. 验证名称: 确保名称符合命名规则(小写字母、连字符、字母数字)
  3. 默认位置: 全局 (~/.config/opencode/skill/<name>/)
  4. 创建目录: skill/<name>/
  5. 创建 SKILL.md:
    • 包含 namedescription 的 frontmatter
    • 结构化内容Purpose, Usage, Examples, Best Practices, Troubleshooting
  6. 写入文件: 在默认位置创建完整的 SKILL.md 文件
  7. 测试: 验证技能可正常加载 skill({ name: "<skill-name>" })

Sample Response Format:

我将帮你创建 [command/skill]。

基于您的描述,自动生成名称:[generated-name]

**自动命名规则**:
- 从描述中提取关键词(动词+名词)
- 转换为 kebab-case 格式(小写字母、连字符)
- 检查名称冲突,自动添加数字后缀

**文件详情**:
- 名称: [generated-name]
- 用途: [brief-description]
- 位置: 全局 (~/.config/opencode/[command|skill]/)

已创建 [file-path]

```markdown
[complete file content]

要测试,请运行:[/command-name] 或 skill({ name: "skill-name" })


## Resources

- [OpenCode Skills Documentation](https://opencode.ai/docs/skills)
- [OpenCode Commands Documentation](https://opencode.ai/docs/commands)
- [OpenCode Configuration Guide](https://opencode.ai/docs/config)
- [GitHub Repository](https://github.com/anomalyco/opencode)

## Updates and Maintenance

1. **Regular Review**: Periodically review and update commands/skills
2. **Version Tracking**: Use Git to track changes
3. **Community Sharing**: Share useful commands/skills with community
4. **Feedback Integration**: Incorporate user feedback for improvements

---

*Last updated: 2026-01-15*