Loading...
Loading...
Analyze coding agent session transcripts to improve existing skills or create new ones. Use when asked to improve a skill based on a session, or extract a new skill from session history.
npx skill4agent add samuerio/.dotfiles improve-skill# List recent sessions (user picks session ID)
opencode session list -n 10
# Export selected session transcript
SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt# List recent sessions (shows session IDs)
opencode session list -n 10
# Export a specific session
opencode export <session-id>
# Export selected session to file
SESSION_ID=<session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txtopencode session list -n 10~/.config/opencode/skills/<skill-name>/SKILL.md~/.config/opencode/home/zhe/github/.dotfiles/opencode/skills/<skill-name>/SKILL.md opencode session list -n 10 SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt ls ~/.config/opencode/skills/<skill-name>/SKILL.md═══════════════════════════════════════════════════════════════════════════════
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.
═══════════════════════════════════════════════════════════════════════════════ opencode session list -n 10 SESSION_ID=<user-selected-session-id>
opencode export $SESSION_ID > /tmp/session-transcript.txt═══════════════════════════════════════════════════════════════════════════════
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 Name> Skill
<overview and quick reference>
## <Section for each major capability>
<instructions and examples>
═══════════════════════════════════════════════════════════════════════════════# List sessions
opencode session list -n 10
# Set chosen session ID
SESSION_ID=<session-id>
# Export session
opencode export $SESSION_ID
# Save to file
opencode export $SESSION_ID > /tmp/session.txt
# View skill
cat ~/.config/opencode/skills/<skill-name>/SKILL.md