optimize-agent-context
Installation
SKILL.md
Optimize Agent Context
Enforce the Band-Aid Philosophy: an agent context file should only contain rules that fix mistakes the agent is actively making. Everything else is bloat that degrades performance and increases cost.
Core Rules (Non-Negotiable)
- NO BLOAT — Never include directory structures, file trees, dependency lists, or package inventories. The agent has tools to discover these.
- NO SUMMARIES — Never include vague app descriptions ("This is a video sharing app"). This distracts the model and triggers hallucinations.
- ONLY FIX KNOWN FAILURES — Every line must correct a specific, observed agent mistake or enforce an architectural constraint the agent cannot guess.
- USE NEGATIVE CONSTRAINTS — When the agent uses the wrong tool/library, explicitly state what NOT to use, then what TO use.
- BE MINIMAL — Target under 20 lines. Bullet points preferred. If a rule can be removed without the agent breaking, remove it.
Why This Matters
Studies show bloated, AI-generated context files:
- Degrade agent performance by ~3%
- Increase token costs by 20%+
- Trigger hallucinations by surfacing legacy code the agent then tries to use ("pink elephants" effect)