distill
Skill67 starsChanged 4 months agoMITView on GitHub
Diff an agent draft against the user-corrected final, extract patterns from the corrections, and propose candidate rules for skill files. Manual form of the self-improving-skill loop. Invoked at /ship or on demand.
75 other projects use a version of this.
Adopted by
Most recently taken up by
- venhdev/skillstheir own version, first seen Nov 8, 2026
- kylehughes/distillation-for-agentstheir own version, first seen Nov 8, 2026
- komluk/scaffoldingtheir own version, first seen Nov 7, 2026
- Integralist/agent-skillstheir own version, first seen Nov 6, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- JHostalek/dotclaudetheir own version, first seen Nov 1, 2026
Used with
Projects with it also use layout, shape and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
owshq-mecSkilllayout
Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.
Also in 8 projects that use this
HAR5HA-7663Skillshape
Plan the UX and UI for a feature before writing code. Runs a structured discovery interview, then produces a design brief that guides implementation. Use during the planning phase to establish design direction, constraints, and strategy before any code is written.
Also in 11 projects that use this
ReScienceLabSkillarchive
Archive session learnings, debugging solutions, and deployment logs to .archive/yyyy-mm-dd/ as indexed markdown with searchable tags. Use when completing a significant task, resolving a tricky bug, deploying, or when the user says \"archive this\". Maintains .archive/MEMORY.md index for cross-session knowledge reuse.
Also in 3 projects that use this
klauswgSkillckm:design-system
Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing/typography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.
Also in 3 projects that use this
iovisorSkillevolve
Evolve uBPF through a gated spec-first workflow that propagates approved changes through requirements, design, validation, implementation, and RFC alignment artifacts.
Also in 3 projects that use this
termdockSkillrecall
Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.
Also in 5 projects that use this
Other versions75 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 75
- talesofai/cohub★ 585same name
- juxt/allium★ 506same name
- educlopez/ui-craft★ 441same name
- Michaelliv/napkin★ 428same name
- nexmoe/DayBee★ 424same name
- nexmoe/eve★ 424same name
- Southclaws/storyden★ 348same name
- 10xChengTu/Mux0★ 337same name
- theexperiencecompany/gaia★ 325same name
- AkaraChen/aghub★ 271same name
65 more not listed
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 repository24 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- autoresearchSkill
- brainstormSkill
- bug-huntSkill
- check-resolvableSkill
- compSkill
- debugSkill
- dialectic-reviewSkill
- finalizeSkill
- implementSkill
- learnSkill
- plan-taskSkill
- premortemSkill
- red-teamSkill
- researchSkill
- retroSkill
- reviewSkill
- rsbSkill
- sessionsSkill
- shipSkill
- socratesSkill
- tradeoffSkill
- verifySkill
- wrapupSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 71 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When you and an agent collaborate on an artifact, the diff between the agent's draft and the version you actually shipped is a learning …
- Very specific: line 25
"last /ship": when invoked from /ship or right after a commit, automatically diff HEAD~1..HEAD for the staged files
- Distinctive: line 42
If the diff is tiny (< 5 lines changed) or uniform (only whitespace/typos), report "no signal" and exit.
- Distinctive: line 61
If the draft was a CLAUDE.md addition → propose rule for CLAUDE.md
- Distinctive: line 62
If the draft was a commit message → /ship
- Distinctive: line 63
If the draft was a code review comment → /review or /bug-hunt
- Distinctive: line 64
If the draft was prose for external publication → the pre-publish-critical-response guide
- Distinctive: line 65
If the draft was a plan → /plan-task
- Distinctive: line 66
If unclear, ask the user.
- Very specific: line 85
Before exiting, scan ~/.claude/candidate-rules.md for prior entries whose proposed rule matches what was just observed.
- Distinctive: line 87
Read the prior candidate's "Proposed home"
- Distinctive: line 89
Remove the original entry from candidate-rules.md
- Distinctive: line 92
If no second sighting fires, exit with: "N candidate rules logged.
- Distinctive: line 98
Always print a concise summary to chat:
- Distinctive: line 115
From /wrapup: when reflecting on what got edited and what didn't
- Distinctive: line 116
On demand: when you suspect a recurring correction pattern but haven't named it
“Common” is measured: kept by at least 6 in 10 of the 71 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
/distill — Extract Rules from Observed Corrections
When you and an agent collaborate on an artifact, the diff between the agent's draft and the version you actually shipped is a learning corpus. This skill takes that diff, classifies the patterns of correction, and proposes candidate rules for the relevant skill file.
This is the manual half of the self-improving-skill loop. The agent-watching-edits-automatically half (auto-watcher) is deferred pending Anthropic's native skill-learning features. The doctrine — that corrections are a learning corpus — is provider-neutral and ships now.
Promotion gate applies. Candidate rules go to ~/.claude/candidate-rules.md on first sighting. Promotion to permanent skill doctrine happens on the second sighting per the rule promotion gate (see ~/.claude/skills/wrapup/health-check-guide.md).
Input
$ARGUMENTS should be one of:
- Two file paths:
<draft-path> <final-path>— explicit before/after files - Git refs:
<commit-or-branch>..<commit-or-branch><file-path>— use the diff between commits - "last /ship": when invoked from
/shipor right after a commit, automatically diffHEAD~1..HEADfor the staged files - A description: "Claude drafted X; I edited it to Y" — agent reconstructs the relevant artifacts and diffs them
Optional flag:
--target-skill <skill-name>— propose rules for a specific skill (default: agent infers which skill produced the draft)
Process
Step 1: Establish the diff
Render the diff between draft and final in a structured way:
- Lines/blocks removed (what the agent did that the user un-did)
- Lines/blocks added (what the agent missed that the user filled in)
- Lines/blocks modified (what the agent got partly right)
If the diff is tiny (< 5 lines changed) or uniform (only whitespace/typos), report "no signal" and exit. Don't manufacture patterns from noise.
Step 2: Classify correction patterns
For each non-trivial removal/addition/modification, classify it. Common pattern types:
- Voice/tone: Agent used X phrasing; user replaced with Y. (e.g. AI-tell phrases caught by the de-AI-ism pass — "load-bearing," "let me gently push back")
- Specificity: Agent abstracted; user got concrete. (e.g. "users" → a specific handle/name, "improve performance" → "reduce p95 latency below 200ms")
- Hedging: Agent qualified; user committed. (e.g. "this should work" → "this works")
- Structure: Agent used wrong format. (e.g. paragraph → numbered list; missing headers; wrong code-fence language)
- Scope: Agent did more than asked. (e.g. unsolicited refactor; defensive error handling for impossible cases)
- Specificity-of-attribution: Agent generic-attributed; user named the source. (e.g. "research suggests" → a named, dated citation)
- Workflow-specific: Agent missed a project convention. (e.g. forgot a known data-file encoding gotcha; used
cd <dir>before git commands)
Pattern-count threshold: a pattern needs to appear at least twice in this single diff to be worth proposing as a rule. Once is noise; twice is signal.
Step 3: Identify the target skill (if not specified)
Without --target-skill, infer:
- If the draft was a CLAUDE.md addition → propose rule for CLAUDE.md
- If the draft was a commit message → /ship
- If the draft was a code review comment → /review or /bug-hunt
- If the draft was prose for external publication → the pre-publish-critical-response guide
- If the draft was a plan → /plan-task
- If unclear, ask the user.
Step 4: Propose candidate rules
For each pattern that fired ≥2 times in the diff, write a candidate rule entry. Format:
### YYYY-MM-DD — <short rule>
- **Pattern observed:** <how it showed up in the diff — give 2-3 concrete examples from the actual edits>
- **Proposed rule:** <one-sentence behavioral rule that would prevent the correction>
- **Proposed home:** <specific skill file / CLAUDE.md / guide>
- **First sighting context:** <which artifact, which project>
- **What would promote:** <what specific second sighting would justify codifying>Append all candidates to ~/.claude/candidate-rules.md.
Step 5: Check for second-sighting matches
Before exiting, scan ~/.claude/candidate-rules.md for prior entries whose proposed rule matches what was just observed. If a prior candidate matches, this is the second sighting — promote it now:
- Read the prior candidate's "Proposed home"
- Append the rule to that target file (with a "Promoted from candidate-rules.md after second sighting on YYYY-MM-DD" note)
- Remove the original entry from candidate-rules.md
- Report the promotion to the user
If no second sighting fires, exit with: "N candidate rules logged. Promotion happens when these patterns appear again."
Output
Always print a concise summary to chat:
DISTILL SUMMARY
- Artifact: <what was diffed>
- Patterns detected: <N>
- Candidates logged: <N> (appended to candidate-rules.md)
- Promotions this run: <N> (matched second sightings)
- Top pattern: <one-line description of the most-fired pattern>When This Skill Triggers
- Automatic at /ship (intended): after a commit lands, /ship can call /distill on the agent's last draft vs. the committed version. (Currently /ship doesn't auto-call /distill — that's a future wiring.)
- Manual after a session where you noticeably edited Claude's output: invoke
/distillwith two file paths - From /wrapup when reflecting on what got edited and what didn't
- On demand when you suspect a recurring correction pattern but haven't named it
Don't use this skill when:
- The diff is trivial (typos, whitespace, single-word swaps) — no learning signal
- The corrections were the user's own change of mind (not agent error) — wrong direction of learning
- The artifact was experimental / one-off — corrections won't generalize
Latent / Deterministic Split (per CLAUDE.md rule)
| Step | Latent / Deterministic |
| Compute the diff | Deterministic (git diff or difflib) |
| Render the diff | Deterministic |
| Classify patterns | Latent (semantic judgment of what each edit represents) |
| Pattern-count threshold (≥2 per diff) | Deterministic (count) |
| Infer target skill | Latent (route based on content) |
| Propose candidate rules | Latent (write a behavioral rule that would prevent the pattern) |
| Check second-sighting matches | Deterministic (file scan, fuzzy match on proposed-rule text) |
| Append to candidate-rules.md | Deterministic |
| Promote on second sighting | Deterministic (file move) |
Extensions (mode of thinking)
The core principle: observed corrections are a learning corpus; corpora can be distilled into rules. Today this fires manually on artifacts you choose. Extensions:
- Auto-watcher at /ship. Once the doctrine is stable, /ship hooks into /distill on every commit — automatic distillation, manual promotion. This is the deferred half of the self-improving-skill loop.
- Cross-session corpus. Today /distill operates on a single diff. A cross-session version would query the candidate-rules ledger for similar pending rules across diffs — clustering corrections from multiple artifacts to surface patterns invisible to any single one.
- Bidirectional distill. Today we distill what Claude got wrong. The mirror image: when Claude's output surprises the user positively, what about the draft was non-obvious? That's also a learning signal — but for a capture-style skill, not for skill-rule promotion.
- Distill on rejected drafts. Sometimes you
/rewindan agent attempt. The pre-rewind state is a "definitively rejected" draft. Diff against your eventual replacement to surface what about the original framing was wrong.
Sources
- A shared write-up on wiring agent skills into loops — diff-distill loop, 10-15 similar edits → classify → rule
- Garry Tan (/improve skill) — NPS feedback → diarize "OK" responses → propose rules → write back to matching skills. Reported 12% → 4% OK rate after one cycle
- Workflow dialectic review — the argument that the doctrine survives even if Anthropic ships native learning
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.

