5 min read

Let's Talk About AI Agent Skills

AI LLMs Agent Skills

When you start building AI agents, it is easy to get caught up in how smart the model is or how cool it looks when it chains tools together.

But when you try using agents for real work, you quickly realize something: an agent is only as good as the skills you give it.

A “skill” is basically the instruction manual and tool definition you hand to an AI model so it knows how to do a specific job. If you write vague, messy, or bloated skills, the agent will get confused, call the wrong tools, or waste a lot of tokens.

If you want your agent to work reliably without burning through your budget, here are four simple principles I stick to when writing skills.


1. Keep Your Descriptions Short and Direct

Here is something a lot of developers overlook: every single time your agent takes a turn in a conversation, the summary of all available skills gets sent to the model for tool selection.1

That means you pay for those words on every single message, even if the agent never uses the skill. Major frameworks emphasize writing concise tool descriptions focused strictly on trigger conditions rather than long explanations.2

If your description is a long, wordy essay explaining the philosophy of cloud computing, you are literally throwing money away. Keep it direct and tell the model:

  • What the skill does
  • Exactly when to trigger it
  • What parameters to pass

Think of it like a function signature. Tell the model what it needs to know in two or three sentences, and move on.


2. Tell the Agent When Not to Use It

Most developers are great at explaining when a skill should be used. But almost everyone forgets to define when it should not be used.

Models love to pattern-match. If you build a skill designed to refactor React code and just tell the model “use this to clean up frontend components,” guess what happens? As soon as you ask it to fix an Angular or Vue file, it sees the word “component,” triggers the React skill, and starts writing React hooks into your Angular project.

To avoid this, always add clear negative boundaries. If a tool is only for React, tell the model explicitly: “Do not use this for Angular, Vue, or backend code.”

Teaching the model when to stay quiet is just as important as teaching it when to run.


3. Keep Files Small and Break Them Up

When an agent actually triggers a skill, the entire skill document gets loaded into the context window.

A big mistake is dumping thousands of lines of documentation, edge cases, and every command-line flag into one giant file. As a rule of thumb, try to keep your main skill file under 500 lines.34

If your skill handles something broad (like deploying to the cloud), don’t stuff AWS, Google Cloud, and Azure instructions all into the main file. Instead, set up a small root file that points to separate reference files.

That way, if the user asks for a Google Cloud deployment, the agent only reads the Google Cloud file and ignores the rest. Your context stays clean, and the model does not get bogged down with irrelevant information.

Context Window Simulator

Task:
Monolithic (Single File)
📄
SKILL.md
2,500 lines (AWS + GCP + Azure + CLI)
Context Window Used18,500 tokens (85%)

All cloud docs loaded simultaneously into context on every turn.

Layered (On Demand)
🧭
SKILL.md Router
180 lines (Workflow rules)
📄
references/aws.md
140 lines
Active
📄
references/gcp.md
Dormant
0 tokens
📄
references/azure.md
Dormant
0 tokens
Context Window Used1,400 tokens (8%)

Agent only loads AWS instructions into context window.


4. Test When It Fires (and When It Shouldn’t)

You don’t need a complicated or expensive testing setup to check if your skills work. You can do most of your testing with simple scripts and regex checks.

When testing a skill, write 10 to 20 test prompts that cover two main cases:

  1. The Happy Path: Prompts that should trigger the skill. Check that the right function was called with the right arguments.
  2. The Dormant Path: Prompts that are slightly related, but out of scope. Make sure the skill does not trigger.

If your tests take seconds to run, you will actually run them often and catch regressions before deploying changes to users.


The Takeaway

Skills are the best way to turn a general AI model into a specialized teammate. But if you don’t treat them with the same care as production code, you will end up with flaky, unpredictable agents.

Keep your descriptions concise, define clear boundaries on when not to use them, break big files into smaller pieces, and always test both the triggers and the dormant cases.


Note: I used AI to help with grammar, structure, and formatting for this post.

Footnotes

  1. OpenAI: Function Calling & Tool Definition Guide

  2. LangChain: Tools Concept & Routing Best Practices

  3. Anthropic: Claude Skill Best Practices

  4. Agent Skills Specification: Document Size Guidance