- 本地化命令描述(英文→中文) - 删除未使用命令文件 - 新增 summarize-conversation 命令 - 更新 AI 模型配置为 DeepSeek - 新增 agent-browser 技能 - 重构技能目录结构(重命名)
6.0 KiB
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
- Determine command name (kebab-case, descriptive)
- Default location: global (
~/.config/opencode/command/) - Create file:
<command-name>.md - Add frontmatter with
description - Write template with
$ARGUMENTSsupport
To Create a Skill
- Validate skill name (lowercase, hyphens, alphanumeric)
- Default location: global (
~/.config/opencode/skill/<skill-name>/) - Create directory:
skill/<skill-name>/ - Create
SKILL.mdwith required frontmatter - 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:
- Keyword Extraction: Identify action verbs and target nouns from the description
- English Conversion: Convert Chinese keywords to English equivalents (e.g., "创建" → "create", "总结" → "summarize")
- Kebab-case Format: Combine words with hyphens, all lowercase (e.g., "create-summary")
- Conflict Resolution: Check if name exists in
command/directory, append numeric suffix if needed
For Skills:
- Function Extraction: Identify core functionality from the description
- Simplified Naming: Use lowercase, hyphen-separated words describing the skill's purpose
- Validation: Ensure name follows
[a-z0-9-]+pattern - 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:
- 自动生成名称: 基于用户描述自动生成 kebab-case 命令名称
- 从描述中提取关键词(动词+名词)
- 转换为英文 kebab-case 格式
- 如果名称已存在,添加数字后缀(如
-2,-3)
- 验证名称: 确保名称符合 kebab-case 规范
- 默认位置: 全局 (
~/.config/opencode/command/) - 创建模板:
- 生成包含
description的 frontmatter - 创建支持
$ARGUMENTS的模板 - 包含使用示例
- 生成包含
- 写入文件: 在默认位置创建命令文件
- 测试: 验证文件存在且格式正确
For "创建skill" or "创建技能" requests:
- 自动生成名称: 基于用户描述自动生成 skill 名称
- 从描述中提取核心功能关键词
- 转换为小写字母、连字符格式
- 如果名称已存在,添加数字后缀
- 验证名称: 确保名称符合命名规则(小写字母、连字符、字母数字)
- 默认位置: 全局 (
~/.config/opencode/skill/<name>/) - 创建目录:
skill/<name>/ - 创建 SKILL.md:
- 包含
name和description的 frontmatter - 结构化内容:Purpose, Usage, Examples, Best Practices, Troubleshooting
- 包含
- 写入文件: 在默认位置创建完整的 SKILL.md 文件
- 测试: 验证技能可正常加载
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*