skill-diet
A skill that trims other skills: it cuts the excess, fixes outdated commands and checks that agents do at least as well
- 204 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The evaluation runs agents on test tasks and spends tokens on every series
- The skill edits other skills' files and runs the `observe.mjs` and `eval.mjs` scripts
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/skill-dietDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The evaluation runs agents on test tasks and spends tokens on every series
- The skill edits other skills' files and runs the `observe.mjs` and `eval.mjs` scripts
This is third-party code. Review the repository files before installing.
What it does
An agent reads the whole `SKILL.md` every time it uses a skill, and that file often carries excess: detail for rare tasks, things the model already knows, notes for people and a copy of the tool reference that goes stale. `skill-diet` does two jobs. It runs a diet: rewrites the skill, fixes mismatches with the tool and keeps the slim version only if agents do at least as well on the same tasks. And it sets rules for every later edit so new lessons do not bloat the skill again. Each fact goes to the lowest level that still reaches the agent in time: the description, `SKILL.md`, reference files, the tool help, the tool replies and errors. The check runs agents on the same tasks with the old skill, the new one and no skill, and rejects the diet if the new one does worse. The `observe.mjs` and `eval.mjs` scripts log calls and score the result. The second skill, `model-gap`, finds why a skill works worse on another model and tests one fix at a time.
Who it is for. Authors and teams who maintain their own skills and see them grow and drift away from the tool.
Good fit when
- A skill has grown to hundreds of lines and most of them serve only rare tasks
- Before editing a skill you need to decide where a new lesson goes so the main file does not swell
- A skill teaches a CLI or API and documented commands may have stopped working
- A skill does worse on Haiku or Kimi and you need to learn whether it is even opened
- A code change renames things a skill describes and the skill must be updated in the same commit
Not a fit when
- A three-line skill: a measured diet is heavier than the work itself
- You need to write a skill from scratch: `skill-diet` edits and compresses existing ones
- You cannot run agents on test tasks: the evaluation compares run results, and without them only the rules remain
Example request
Put the deploy skill on a diet: shorten it, check that its commands still work with the current CLI and run tests on the old and new versionsLimitations
- A full diet runs agents on the same tasks several times. That spends tokens; the author cites a trial of 924 sessions on four models costing $2.68.
- The part that depends on your agent is written by the agent as an adapter, and the script checks it before evaluation.
- The `model-gap` skill is started by hand: `/skill:model-gap <skill> <models>` in Pi, `/skill-diet:model-gap` in Claude Code. It depends on the `skill-diet` scripts, so install both together.
- Use one install route per agent: both at once load the skills twice.
How to disable. In Claude Code run `/plugin uninstall skill-diet@skill-diet`. Links installed through `npx skills` live in `~/.agents/skills` and can be removed by hand.
FAQ
How do I install skill-diet in Claude Code?
Run `/plugin install skill-diet --marketplace nicobailon/skill-diet`. Update with `claude plugin update skill-diet@skill-diet`.
How much does it save?
By the author's account, on real skills a diet cut 70 to 80 percent of tokens with no drop in test results and found commands that no longer worked. Those are the author's numbers; your skill will differ.
How does command format affect size?
The author recommends writing commands as plain usage lines, the cheapest format. A Markdown table costs about 1.5 times more, JSON Schema 2.8 times and OpenAPI 4.7 times.
What does model-gap do?
It runs the same tasks on different models and looks for why a weaker one fails: never opened the skill, misread a rule, hit a tool error or the test itself was wrong. Then it tests fixes one at a time.
Does the evaluation need separate code?
It needs an adapter that your agent writes. The parts common to all agents ship as the `eval.mjs` and `observe.mjs` scripts, and the adapter is checked before every evaluation.
Discussion
No questions or reviews yet.
Related
SkillsA skill that helps an agent author other skills to the agentskills.io spec: structure, metadata, progressive disclosure and validation
A doctor skill for agent skills that picks an architecture, audits against 21 red lines and returns a report with line references
A meta-skill that takes a vague idea to a finished agent skill: it designs, writes the files, checks them and refines by evidence
A skill that designs, tests, evaluates and packages other agent skills, starting from architecture
Self-learning
self-learning-skills
A meta-skill that saves a hard-won working procedure as a new skill or rule, so the next session starts already knowing it
Darwin Skill
darwin-skill
A skill that improves other skills: scores SKILL.md on nine criteria, edits, tests with prompts and reverts
README in short
The README explains what bloats a skill and shows the levels where facts are placed. It then describes the five diet steps, extra steps for skills about tools, rules for every later edit and the `model-gap` skill with a table of trial results. Install for Pi, Claude Code, Codex and Cursor, the repository layout and the reason scripts plus an adapter drive the evaluation follow.
README badge
Original SKILL.md
--- name: skill-diet description: Keep agent skills lean and correct. Use before editing an existing skill, such as adding a lesson; when a code change touches names or behavior a skill describes; and to put a skill on a full diet when it is large, loads detail most tasks never use, or has drifted from the tool it teaches. --- # Skill Diet ## Levels Put each fact on the lowest level that still reaches the agent before it needs it. | Level | Holds | Loaded | | --- | --- | --- | | `description` | one trigger per case | every session | | `SKILL.md` | what every task needs | when the skill is used | | `references/` | what only some tasks need, behind a link that says when to read it | when that case comes up | A skill that teaches a tool has two more levels: the tool's help, then its replies and errors. Exact names, fields and values live there, not in the skill. A check on the skill's output (linter, tests, renderer) can replace a rule, unless one miss costs a slow cycle. ## Editing a skill Stop at the first step that handles the change. 1. **Fix it below the skill.** A mechanical mistake gets a clearer error, a check, or a test in the tool. Prose is for judgment calls. 2. **Check the model needs it.** If a fresh session does the right thing without the line, add nothing. 3. **Edit, don't append.** Change the line that already covers the idea. Each meaning lives in one place across `SKILL.md`, references, and the tool's docs. 4. **Pick its level.** 5. **Write the rule, not the story.** One positive rule under a short name; the incident goes in the commit message. **When code changes** a name or behavior the skill relies on, update the skill in the same change. Index new public operations by name only, unless agents will call them often. Run the skill's coverage check, or add one if drift could recur. **Budget:** put `SKILL.md`'s size before and after in the commit message, and offset growth with a cut. When it is over 10% larger than at its last diet commit, or one idea appears in two places, do a full diet. `node scripts/eval.mjs check <skill-dir>` prints the size and checks links. **Verify:** rerun the case that prompted the change in a fresh session, and any tests that assert the skill's text. ## Look up the rest - Full diet of a large, bloated or drifted skill → [references/diet.md](references/diet.md)