An OpenCode V2 plugin that finds repeated multi-step workflows in session history and proposes reusable artifacts: a skill, a command, or a subagent.
mkdir -p ~/.config/opencode/plugins
curl -fsSL \
https://raw.githubusercontent.com/jadmadi/opencode-distill/main/distill.ts \
-o ~/.config/opencode/plugins/distill.tsFor one project, put it in .opencode/plugins/. Tested against OpenCode
0.0.0-beta-19425.
| Command | Effect |
|---|---|
/distill |
Analyze the current session |
/distill <sessionID> ... |
Analyze named sessions |
/distill list |
Show the last proposal |
/distill apply <n> |
Write the candidate numbered n |
The command prints the candidates and their confidence. Nothing is written until
apply. A candidate whose target file already exists is reported as a duplicate.
Approved artifacts are written under DISTILL_ROOT, or ~/.config/opencode/ by
default:
skills/<name>/SKILL.md
commands/<name>.md
agents/<name>.md
The analysis uses the session's model. Some providers do not support transient
generation: OpenCode Go returned Request is missing x-opencode-session in
testing. Set DISTILL_MODEL to a working model, for example
DISTILL_MODEL=deepseek/deepseek-flash.
bun testInspired by MiMoCode's /distill. See NOTICE.
MIT