Auto Skill Distiller
by @christianye
Auto-distill successful workflows into reusable skills. Use after completing any multi-step task to evaluate if the workflow should be saved as a skill. Trig...
clawhub install auto-skill-distillerπ About This Skill
name: skill-distiller description: "Auto-distill successful workflows into reusable skills. Use after completing any multi-step task to evaluate if the workflow should be saved as a skill. Triggers on: 'distill this', 'save as skill', 'make this reusable', or automatically at the end of complex tasks when compound learning is enabled. Evaluates task novelty, success, and reuse potential before generating a standard SKILL.md. Prevents skill bloat through quality gates."
Skill Distiller
Turn successful workflows into reusable skills β automatically.
> Inspired by Hermes Agent's learning loop, but with quality gates to prevent skill bloat.
When to Distill
Not every task deserves a skill. Evaluate these three criteria:
All three must be YES to proceed:
1. Novel? β Did this task require a workflow you haven't done before? (If you already have a skill for this, update it instead of creating a new one) 2. Successful? β Did the task complete with verified results? (Failed tasks produce lessons, not skills β write to memory/lessons-learned.md instead) 3. Reusable? β Will this exact workflow likely be needed again? (One-off tasks don't need skills)
Quick scoring:
Novel + Successful + Reusable = CREATE SKILL
Novel + Successful + One-off = WRITE TO MEMORY (lesson learned, not a skill)
Novel + Failed = WRITE TO LESSONS-LEARNED
Not Novel = UPDATE EXISTING SKILL (or skip)
Distillation Process
Step 1: Extract the Workflow
Look back at what you just did and identify:
Step 2: Generalize
Transform the specific instance into a reusable pattern:
, etc.Bad (too specific):
1. Read ch10-multi-agent-comm-patterns.md
2. Convert markdown to docx using python-docx
3. Upload to feishu folder nodcnxdXVfsiCVDuiigFVpnCPoc
Good (generalized):
1. Read source markdown file(s)
2. Convert to docx using python-docx (see references/docx-patterns.md)
3. Upload to target feishu folder
Step 3: Write SKILL.md
Generate the skill following the standard format:
---
name:
description: ""
When to Use
<1-2 sentences on the trigger pattern>Workflow
Key Decisions
Gotchas
References
Size target: SKILL.md body should be under 200 lines. If longer, split into SKILL.md (workflow) + references/ (details).
Step 4: Quality Check
Before saving, verify:
ls ~/.openclaw/skills/)Step 5: Save and Register
Save to ~/.openclaw/skills/.
If the skill has reference materials, save them to ~/.openclaw/skills/.
After saving, verify the skill loads:
ls ~/.openclaw/skills//SKILL.md
Automatic Distillation Mode
When integrated with trinity-harness's Layer 3 (Compound), distillation happens automatically:
1. Task completes β Layer 3 Compound phase triggers
2. Evaluate Novel + Successful + Reusable
3. If all YES β run distillation process
4. If NO β write lesson to memory instead
5. Announce to user: "Distilled skill: read ~/.openclaw/skills/"
Never auto-distill silently. Always announce what was created so the user can review, edit, or delete.
Skill Maintenance
Update vs. Create
Before creating a new skill, check if a related one exists:
ls ~/.openclaw/skills/ | grep -i
If a similar skill exists, update it (add the new pattern as a variant) rather than creating a near-duplicate.
Pruning
Periodically (during Dream Task), review skills:
Anti-Patterns
| Don't | Why | Do Instead |
|---|---|---|
| Distill every task | Skill bloat, noise drowns signal | Apply the 3-question gate |
| Include conversation history | Wastes tokens, not reusable | Extract only the workflow pattern |
| Write vague gotchas | "Be careful" helps no one | Specific: "API X returns 429 after 3 concurrent requests" |
| Hardcode paths/names | Not portable | Use placeholders |
| Skip quality check | Garbage skills waste future context | Always verify before saving |
Integration with Memory System
Distillation complements, not replaces, the memory system:
| Output | Goes to | When |
|---|---|---|
| Reusable workflow | ~/.openclaw/skills/ | Novel + Successful + Reusable |
| Lesson learned | memory/lessons-learned.md | Successful but one-off, or failed |
| Quick note | memory/YYYY-MM-DD.md | Routine observations |
| Core insight | MEMORY.md | Fundamental principle change |
β‘ When to Use
<1-2 sentences on the trigger pattern>