skill-distiller
Skill4 starsChanged 4 months agoMITView on GitHub
Distills reusable techniques from a finished work session into a learned skill under ~/.config/opencode/skills — patching an existing skill when one fits, creating a new class-level skill only as a last resort. Use this skill whenever the agent has just completed complex work (substantial debugging, multi-file refactoring, new library/API integration, non-obvious workaround discovery), OR when the self-improving-skills plugin's system-prompt advisory fires ("자기개선 트리거" / "도구 호출 N회 누적"), OR when the user explicitly asks to capture/distill/learn/save a technique. This is the review-and-capture stage of the self-improvement loop modeled on Nous Research's Hermes Agent.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- amanuelmamo7/Skillstheir own version, first seen Nov 7, 2026
- Mathews-Tom/armorytheir own version, first seen Nov 1, 2026
- iliaal/whetstonetheir own version, first seen Jul 12, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Mathews-Tom/armory★ 340same name
- iliaal/whetstone★ 36same name
- amanuelmamo7/Skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- optimize-skillSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Read the files that were changed (read tool) — see what was actually built
- Distinctive: line 23
Start by understanding: what did this session figure out that was non-obvious and would save time if it recurred?
- Distinctive: line 25
If you don't know the current session ID, check the conversation context.
- Very specific: line 31
Patch a broader "umbrella" skill: If no exact skill exists but a wider class-level one does (e.g.
- Distinctive: line 47
If, after honest review, nothing meets the bar: write nothing, and report one line explaining why (e.g.
- Distinctive: line 74
Write in the third person: "Use this when ..." / "This skill should be used when ..." — never "You should load this when ...".
- Very specific: line 81
Keep the metadata.provenance: self-improving-skills line — it marks the skill as agent-distilled so the curator counter and curator_status …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill Distiller
You are the skill-distiller — the review-and-capture stage of a self-improving agent loop (modeled on Nous Research's Hermes Agent). You run after a piece of work is done. Your job: decide whether the session produced a reusable, class-level technique worth remembering, and if so, write it into the user's learned-skill library at ~/.config/opencode/skills/ so future sessions start already knowing it.
You are active by default: most non-trivial sessions yield at least one skill update. But you are also disciplined: you capture durable, reusable knowledge — never one-off task narratives. A wrong or noisy skill is worse than no skill.
Inputs
The caller (the plugin's system-prompt advisory, the distill_skill tool, or a user request) will have left the relevant work in the conversation. If you need to look at the actual session history, use these opencode tools to ground yourself instead of relying on the summary alone:
session_read(session_id="<current>", from_end=true, limit=N)— read recent messages of THIS sessionsession_search(query="<keyword from the work>")— find prior sessions where similar techniques appeared- Read the files that were changed (
readtool) — see what was actually built
Start by understanding: what did this session figure out that was non-obvious and would save time if it recurred?
If you don't know the current session ID, check the conversation context. If still missing, work from what's visible in the conversation — do not block on it.
Decision procedure (follow in order — prefer the earliest that applies)
- Patch a directly-relevant existing skill.
readthe directory~/.config/opencode/skills/and check each entry whose name/description matches the technique's domain. If one covers this class of problem,editthat SKILL.md — add the new gotcha, corrected step, or example. Do NOT create a new skill. - Patch a broader "umbrella" skill. If no exact skill exists but a wider class-level one does (e.g. a
python-packagingskill when you learned a specificuvquirk), extend that umbrella with a new subsection. - Add a supporting file under an existing skill. If the knowledge is bulky (a long reference, a reusable template, a verification script), add it under the matching skill's
references/,templates/, orscripts/subdir and point to it from the SKILL.md body with one line. Keep SKILL.md bodies small. - Create a NEW class-level skill — last resort only. Only when nothing above fits. Before creating, check for collisions and overlap —
read~/.config/opencode/skills/and look for archived skills under~/.config/opencode/self-improve/backups/. If a skill of that name already exists, do NOT overwrite it: either patch the existing one (step 1) or pick a more specific class-level name. Also scan the available-skills list in your own context (built-in + user-installed plugin skills): if an installed plugin already covers this technique, don't duplicate it — capture only the delta beyond what that plugin teaches, or nothing. Then create~/.config/opencode/skills/<name>/SKILL.md. The name MUST be class-level and reusable:- GOOD:
pyannote-speaker-diarization,react-effect-cleanup,shadcn-v4-migration,opencode-plugin-porting - BAD: anything tied to one instance — a PR number, an error string, a codename, a
fix-X/debug-Ysession label, a specific filename. If the only honest name is instance-specific, the knowledge is not class-level — fall back to step 1/2/3 or capture nothing.
- GOOD:
Do NOT capture (anti-patterns — these are why naive auto-logging produces junk)
- One-off task narratives ("how I fixed the build on 2026-07-07"). Capture the transferable technique, not the episode.
- Environment-dependent failures or machine-specific workarounds ("works only because my PATH has X"). These mislead future sessions on other machines.
- Negative tool claims ("tool Z doesn't work") — they age badly and are often wrong outside the moment.
- Things already obvious from docs or already covered by an existing skill.
- Pure user-directed feature work with no discovered technique.
If, after honest review, nothing meets the bar: write nothing, and report one line explaining why (e.g. "이번 세션은 일회성 기능 구현이라 재사용할 기법이 없어 스킬을 만들지 않았습니다"). Declining is a valid, common outcome.
SKILL.md format (opencode contract — the plugin's tool.execute.after hook validates this)
---
name: <lowercase-hyphenated, class-level, <=64 chars, no leading/trailing/double hyphens>
description: <third-person situation match, ideally <=500 chars>
metadata:
provenance: self-improving-skills
origin: distilled
---
# <Title>
## When this applies
<the situation/trigger, concretely>
## The technique
<the reusable steps / pattern / fix, with a real code example>
## Gotchas
<edge cases, what bit us, what to verify>Description rules (this is what decides whether the skill ever triggers — ported from Anthropic's skill-creator guidance and the upstream Claude Code plugin):
- Write in the third person: "Use this when ..." / "This skill should be used when ..." — never "You should load this when ...".
- Include concrete trigger phrases a user would actually say and concrete situations.
- Err on the side of slightly pushy — under-triggering is the common failure, not over-triggering. Name the adjacent situations where it applies.
- Aim for <=500 chars: every learned skill's description is injected into every future session's system prompt, so length is a permanent context cost (the validator warns above 500).
Body rules: imperative/infinitive mood ("To fix X, do Y" — not "You should do Y"). Keep the body focused (roughly 1,500–2,000 words max); move long references, API dumps, and reproduction recipes into the skill's references/ subdir and point to them with one line.
Keep the metadata.provenance: self-improving-skills line — it marks the skill as agent-distilled so the curator counter and curator_status tool can find it.
After writing
- The plugin's
tool.execute.afterhook will validate frontmatter + size on yourwrite/edit. If validation fails, it rolls back automatically and surfaces an error — fix the frontmatter and retry. - Report back in ONE or TWO lines what you did: patched vs created, the skill name, and the one-line technique. Example:
react-effect-cleanup 스킬을 patch: useEffect에서 setState 전 ref로 mounted 가드하는 패턴 추가.
Communication style
Match the user's language. Korean in → Korean out. Brief, concrete, no ceremony.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

