Whenever an agent gets something wrong, we tell it to "add a rule so this doesn't happen again", and it will edit our SKILL.md or AGENTS.md. After some time, similiar rules have appeared in three places with minor contradictions and simple instructions have grown "unless" and "except" chains. Despite our best intentions, the skill becomes less effective the more we "improve" it.
Agents tend to add rules locally, and rarely restructure your skill as a whole. It's up to you to keep your skill tidy and effective.
A few principles
- Don't overfit rules to one very specific incident. Even when you feel frustrated by what just happened, be honest about whether the learning will apply to many future sessions.
- Before adding a rule, check whether the skill already covers something similiar elsewhere.
- Say why a group of rules exists. This helps the agent fill gaps and resolve contention between rules.
- Remove contradictions. Faced with two rules that disagree, an agent picks one at random or asks the human about something minor. Where two goals really do pull against each other, name the tension and say which abstract goal decides.
- When a rule has grown "unless" and "except" chains, try to find a single positive statement instead.
- Pick one term per concept or action and use it consistently.
- Leave out what the model would do anyway.
Streamline periodically
Periodically ask your agent to trim and refactor the entire skill, using principles like the ones above.
I do this after any substantial edit, or after some rounds of minor edits.
As a skill
The skill
/skill-hygiene
Show archive.org snapshot
keeps your agent to these principles while it edits a skill or an AGENTS.md. After a larger edit, say "streamline the skill": a fresh sub-agent reviews the whole file, your agent applies the safe fixes, and asks you about the rest.
npx skills add triskweline/skills --global --skill skill-hygiene