← Back to articles

You're Burning Your AI Agent Budget Because You Don't Test Their Skills

technology
aiagentsskillsevaluationskillbench

Читать на русском →

You're burning your AI agent budget because you don't test their skills. Most developers and teams actively use agents for writing code and boosting productivity, but almost no one evaluates the skills they create. The SkillBench index analyzed over 50,000 skills from GitHub and found that the vast majority were generated by artificial intelligence without any real testing. The core problem is agent non-determinism. When a task fails in production, you can't tell whether it failed because of a poorly written skill or because the base model couldn't handle the complexity. Today we'll break down how skills work and build an evaluation system that removes guesswork from your workflow.

Skill Anatomy and Token Economics

An AI agent skill isn't just a text file with instructions — it's a progressive disclosure system that directly affects your costs. Understanding this architecture is critical for optimizing spend and improving accuracy. The first level is the name and description, which always sit in the model's system context. This is a tax you pay on every agent call, so the description must be as short and dense as possible. The second level is the skill body with detailed instructions, which the model loads only when needed. The third level is reference files with deep context that the agent consults for specific tasks.

SkillBench research shows that properly structured skills improve model performance by roughly 15% on average. But there's a hard limit: skill files must be under 500 lines. If your skill exceeds that, you're overloading the context window and degrading generation quality. Human-written skills consistently outperform those generated by AI itself. It's also important to distinguish capability skills from preference skills. The former teach the model what it can't yet do reliably and become obsolete as base models improve. The latter encode your company's unique workflows and standards — and they must be protected with evaluations so agent updates don't break your internal specifics.


Seven Rules of Skill Engineering

Writing an effective skill requires discipline and cutting unnecessary entities.

1. Descriptions must be directive, not descriptive. Don't write an essay about why the Interactions API is good for multi-chats. Give the model a clear instruction to use that API only when working with check apps.

2. Set the right level of freedom. If your workflow is always the same, don't waste model tokens on step-by-step instructions. Write a regular script and tell the agent to just run it.

3. Always define negative scenarios. Specify not only when to use the skill, but also when it must absolutely not be applied, to avoid false triggers.

4. Ruthlessly remove no-ops. AI generators often add phrases like "write clean code" or "make the implementation readable." These instructions don't change agent behavior but consume your tokens and money.

5. Test outcomes, not paths. We don't care at which dialogue step the model loaded the skill. We care whether it solved the user's final task.

6. Run multiple trials. Since models are non-deterministic, one successful run means nothing. Run three to six attempts per test case to measure real reliability.

7. Test across execution environments. A skill that works perfectly in one environment may break completely in another, so cover all tools your customers use.


Evaluation System and Isolation

Building a skill evaluation environment doesn't require complex infrastructure, but it does require strict methodology. Start with a JSON file of test cases that includes the user prompt, expected programming language, skill trigger flag, and expected checks. For basic checks, use regular expressions — it's incredibly cheap and fast. You can easily verify whether the agent uses the right SDK, the right model, and avoids deprecated patterns without bringing in additional language models as judges.

For complex skills where you need to analyze the full trace of agent actions, use an LLM-as-judge approach. You create a rubric with evaluation criteria, pass the agent's output through it, and get a clear pass or fail status. It's critical to run these tests in isolated workspaces. Coding agents are very good at "cheating" by peeking at context from previous chats or the environment. Isolation ensures the agent solved the task because of the skill, not because of information leakage from outside. And always run ablation tests — evaluate with the skill enabled and completely without it. Only then will you know whether the skill actually improves performance or the model has already learned to handle it on its own.

Lifecycle and Obsolescence

Skills aren't meant to live forever. Base models keep improving, and what required a complex skill six months ago may be built into the model by default today. If your ablation tests show the model produces the desired result even without calling the skill, retire it immediately. That saves tokens, reduces latency, and lowers cognitive load on the system. But never delete the tests and evaluations themselves. Keep them running as regression tests. The moment you notice performance degradation after the next model update, you'll know exactly that the skill needs to be brought back.

Share