skill-diet
Agent skills that keep other skills lean, correct, and working on every model you run.
An agent reads a skill's whole SKILL.md every time it uses the skill. Most skills carry far more than a task needs: detail only some tasks use, things the model already knows, notes written for people rather than agents, and lists that one idea could replace. Skills that teach a tool (a CLI, an API, an SDK, an MCP server) also copy the tool's reference, and that copy goes stale as the tool changes. Asking an agent to update a skill usually makes it longer, since agents tend to add more than they cut.
On real skills, a diet has cut 70–80% of the tokens with no drop in test results, and found commands the skill documented that no longer worked.
skill-diet does three jobs:
- Put a skill on a diet. It rewrites the skill, fixes what no longer matches the tool, and keeps the slim version unless tests show agents doing worse with it.
- Keep it lean afterward. It gives agents rules for every later update, so new lessons and code changes don't bring the bloat back.
- Make it work on other models. A second skill, skill-model-gap, runs the same tasks on each model you pick, finds why a weaker one fails, and keeps a fix only if it helps that model without hurting the others. You start it yourself (how).
Ask your agent:
> put the deploy skill on a diet
> is this skill still accurate for the current CLI?
> add this lesson to the deploy skill
> put this skill on a diet, and keep what we just did working
What's new in 0.2
https://github.com/user-attachments/assets/8dadf9d3-8987-48d3-9b22-c531b2c0454c
Most skills are written and tested on one top model, but many people run them on other models, where they can quietly fail. The new skill-model-gap skill runs the same tasks on each model you pick, finds why the weaker one fails, and keeps a fix only if it helps that model without hurting the others. In its first trial, one line in a skill's description took Kimi from 78% to 98% of runs passed and Haiku from 85% to 100%. See below and the changelog.
How it works
https://github.com/user-attachments/assets/5ed957c3-bb1e-4916-80d1-ae081a1f84b7
Each fact goes on the lowest level that still reaches the agent before it needs it:
| Level | Holds | Read |
|---|
| the skill's description | one trigger per case | in every session |
SKILL.md | what every task needs | when the skill is used |
| reference files | what only some tasks need | when that case comes up |
| the tool's own help | flags, allowed values, examples | when the agent picks that command |
| the tool's replies, errors and checkers | the right name, the fix, the next step | when the agent calls the tool, or a guess is wrong |
A diet
- Measure the skill and what a typical task loads.
- If the skill teaches a tool, do the extra steps below.
- Place each piece on a level. If only you ever start the skill, it gets marked user-only, so its description stops costing context in every session.
- Cut what the model already knows and what only a human needs, then rewrite the rest tighter.
- Run agents on the same tasks with the old skill, the new one, and no skill at all, and keep the new one unless it does worse. Your agent can do all of this unattended: tasks are written before anything is cut, a fresh session settles disputed answers without seeing which version wrote them, and the scorer fails the diet if the new skill does worse than chance would explain or never passes a task the old one always passed.
For a skill that teaches a tool, the diet also:
- proves each mismatch between skill and tool, by running it or pointing to the source line;
- reads your session logs to find the calls agents make most, and spells out only those in full;
- checks how often agents actually open the skill, and moves rules they need into the tool's replies and errors when they rarely do;
- checks that the tool's help and errors are good enough to replace skill text, and lists fixes where they aren't;
- trims a tool's schema to the fields agents use, when the tool is yours, since the schema is sent with every request;
- leaves a check that warns after a commit when the skill no longer matches the tool.
Commands are written as plain usage lines, the way the agent types them, because that is the cheapest format. For the same set of commands on a real CLI:
| Format | Tokens, relative to usage lines |
|---|
| usage lines | 1× |
| markdown table | 1.5× |
| TypeScript types | 1.6× |
| JSON Schema | 2.8× |
| OpenAPI | 4.7× |
Every later update
Before an agent adds to a skill, it stops at the first step that handles the change: