improve-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImprove Skill
改进Skill
This skill helps analyze coding agent sessions to improve or create skills. It works with opencode session files.
本Skill用于分析编码Agent会话,以改进或创建Skill。它可与opencode会话文件配合使用。
Quick Start
快速开始
List recent sessions, let the user choose one, then export it:
bash
undefined列出最近的会话,让用户选择一个,然后导出:
bash
undefinedList recent sessions (user picks session ID)
List recent sessions (user picks session ID)
opencode session list -n 10
opencode session list -n 10
Export selected session transcript
Export selected session transcript
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt
undefinedSESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt
undefinedSession Extraction
会话提取
OpenCode provides built-in commands to list and export sessions:
bash
undefinedOpenCode提供内置命令来列出和导出会话:
bash
undefinedList recent sessions (shows session IDs)
List recent sessions (shows session IDs)
opencode session list -n 10
opencode session list -n 10
Export a specific session
Export a specific session
opencode export <session-id>
opencode export <session-id>
Export selected session to file
Export selected session to file
SESSION_ID=<session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt
undefinedSESSION_ID=<session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt
undefinedSession Selection Rule
会话选择规则
Always list sessions first and let the user choose which session to use.
- Run:
bash
opencode session list -n 10- Show the list to the user.
- Ask for a specific session ID.
- Only export after the user confirms the session ID.
Do not auto-pick the latest session unless the user explicitly asks for "latest".
Skill location:
- OpenCode skills:
~/.config/opencode/skills/<skill-name>/SKILL.md - If is a symlink (common in dotfiles setups), the equivalent real path works too:
~/.config/opencode/home/zhe/github/.dotfiles/opencode/skills/<skill-name>/SKILL.md
始终先列出会话,让用户选择要使用的会话。
- 运行:
bash
opencode session list -n 10- 向用户展示列表。
- 请求用户提供具体的会话ID。
- 仅在用户确认会话ID后再导出。
除非用户明确要求“最新会话”,否则不要自动选择最新会话。
Skill存储位置:
- OpenCode skills:
~/.config/opencode/skills/<skill-name>/SKILL.md - 如果是符号链接(在dotfiles配置中很常见),对应的真实路径也可使用:
~/.config/opencode/home/zhe/github/.dotfiles/opencode/skills/<skill-name>/SKILL.md
Workflow: Improve an Existing Skill
工作流:改进现有Skill
When asked to improve a skill based on a session:
- List sessions and ask the user to choose one:
bash
opencode session list -n 10- Extract the chosen session transcript:
bash
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt- Find the existing skill:
bash
ls ~/.config/opencode/skills/<skill-name>/SKILL.md- Generate an improvement prompt for a new session:
═══════════════════════════════════════════════════════════════════════════════
COPY THE FOLLOWING PROMPT INTO A NEW OPENCODE SESSION:
═══════════════════════════════════════════════════════════════════════════════
I need to improve the "<skill-name>" skill based on a session where I used it.
First, read the current skill at: ~/.config/opencode/skills/<skill-name>/SKILL.md
Then analyze this session transcript to understand:
- Where I struggled to use the skill correctly
- What information was missing from the skill
- What examples would have helped
- What I had to figure out on my own
<session_transcript>
<paste transcript here>
</session_transcript>
Based on this analysis, improve the skill by:
1. Adding missing instructions or clarifications
2. Adding examples for common use cases discovered
3. Fixing any incorrect guidance
4. Making the skill more concise where possible
Write the improved skill back to the same location.
═══════════════════════════════════════════════════════════════════════════════当需要基于会话改进Skill时:
- 列出会话并让用户选择一个:
bash
opencode session list -n 10- 提取选中的会话记录:
bash
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt- 生成改进提示语用于新会话:
═══════════════════════════════════════════════════════════════════════════════
将以下提示语复制到新的OpenCode会话中:
═══════════════════════════════════════════════════════════════════════════════
我需要基于使用该Skill的会话来改进名为"<skill-name>"的Skill。
首先,读取当前Skill的内容:~/.config/opencode/skills/<skill-name>/SKILL.md
然后分析此会话记录,以了解:
- 我在正确使用该Skill时遇到了哪些困难
- Skill中缺少哪些信息
- 哪些示例会有帮助
- 哪些内容是我不得不自行摸索的
<session_transcript>
<paste transcript here>
</session_transcript>
基于上述分析,通过以下方式改进Skill:
1. 添加缺失的说明或澄清内容
2. 为发现的常见使用场景添加示例
3. 修正任何错误的指导内容
4. 尽可能让Skill更简洁
将改进后的Skill写回原位置。
═══════════════════════════════════════════════════════════════════════════════Workflow: Create a New Skill
工作流:创建新Skill
When asked to create a new skill from a session:
- List sessions and ask the user to choose one:
bash
opencode session list -n 10- Extract the chosen session transcript:
bash
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt- Generate a creation prompt for a new session:
═══════════════════════════════════════════════════════════════════════════════
COPY THE FOLLOWING PROMPT INTO A NEW OPENCODE SESSION:
═══════════════════════════════════════════════════════════════════════════════
Analyze this session transcript to extract a reusable skill called "<skill-name>":
<session_transcript>
<paste transcript here>
</session_transcript>
Create a new skill that captures:
1. The core capability or workflow demonstrated
2. Key commands, APIs, or patterns used
3. Common pitfalls and how to avoid them
4. Example usage for typical scenarios
Write the skill to: ~/.config/opencode/skills/<skill-name>/SKILL.md
Use this format:
---
name: <skill-name>
description: "<one-line description>"
---当需要从会话中创建新Skill时:
- 列出会话并让用户选择一个:
bash
opencode session list -n 10- 提取选中的会话记录:
bash
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt- 生成创建提示语用于新会话:
═══════════════════════════════════════════════════════════════════════════════
将以下提示语复制到新的OpenCode会话中:
═══════════════════════════════════════════════════════════════════════════════
分析此会话记录,以提取名为"<skill-name>"的可复用Skill:
<session_transcript>
<paste transcript here>
</session_transcript>
创建一个新Skill,涵盖以下内容:
1. 展示的核心能力或工作流
2. 使用的关键命令、API或模式
3. 常见陷阱及避免方法
4. 典型场景的示例用法
将Skill写入:~/.config/opencode/skills/<skill-name>/SKILL.md
使用以下格式:
---
name: <skill-name>
description: "<一行描述>"
---<Skill Name> Skill
<Skill名称> Skill
<overview and quick reference>
<概述和快速参考>
<Section for each major capability>
<每个主要能力的章节>
<instructions and examples>
═══════════════════════════════════════════════════════════════════════════════
undefined<说明和示例>
═══════════════════════════════════════════════════════════════════════════════
undefinedWhy a Separate Session?
为什么需要单独会话?
The improvement prompt is meant to be copied into a fresh OpenCode session because:
- Token efficiency - The current session already has a lot of context; starting fresh means only the transcript and skill are loaded
- Clean analysis - The new session can focus purely on improvement without being influenced by the current task
- Reproducibility - The prompt is self-contained and can be shared or reused
改进提示语需要复制到全新的OpenCode会话中,原因如下:
- Token效率 - 当前会话已有大量上下文,全新会话只会加载记录和Skill内容
- 清晰分析 - 新会话可以专注于改进工作,不受当前任务的干扰
- 可重复性 - 提示语是自包含的,可以共享或重复使用
Tips for Good Skill Improvements
优秀Skill改进技巧
When analyzing a transcript, look for:
- Confusion patterns - Where did the agent retry or change approach?
- Missing examples - What specific commands or code patterns were discovered?
- Workarounds - What did the agent have to figure out that wasn't documented?
- Errors - What failed and how was it resolved?
- Successful patterns - What worked well and should be highlighted?
Keep skills concise - focus on the most important information and examples.
分析记录时,请注意以下几点:
- 困惑模式 - Agent在哪里重试或改变了方法?
- 缺失示例 - 发现了哪些特定命令或代码模式?
- 临时解决方案 - Agent不得不自行摸索哪些未记录的内容?
- 错误 - 哪些操作失败了,又是如何解决的?
- 成功模式 - 哪些方法效果良好,需要重点突出?
保持Skill简洁 - 专注于最重要的信息和示例。
Quick Reference
快速参考
bash
undefinedbash
undefinedList sessions
列出会话
opencode session list -n 10
opencode session list -n 10
Set chosen session ID
设置选中的会话ID
SESSION_ID=<session-id>
SESSION_ID=<session-id>
Export session
导出会话
opencode export $SESSION_ID
opencode export $SESSION_ID
Save to file
保存到文件
opencode export $SESSION_ID > /tmp/session.txt
opencode export $SESSION_ID > /tmp/session.txt
View skill
查看Skill
cat ~/.config/opencode/skills/<skill-name>/SKILL.md
undefinedcat ~/.config/opencode/skills/<skill-name>/SKILL.md
undefined