Sub topic 10
Writing skill descriptions that get selected
This chapter assumes you know the layout of a skill folder and its SKILL.md frontmatter from the previous chapter. It also assumes you know what a context window is. Frontmatter fields differ between products, so check your tool's documentation.
Why the description decides everything
At startup, the agent usually loads only each skill's name and description. The body of SKILL.md stays on disk. When you send a request, the model compares it with those descriptions and decides whether to load a skill. If the description does not match how you phrase the task, the skill never runs, however good its instructions are.
What a good description contains
A description should answer two questions: what the skill does, and when to use it. Include the words a user would actually type.
- Start with a concrete action, such as "Writes", "Checks", or "Converts".
- Name the output or artifact, such as a changelog entry or a migration file.
- Add a "Use when..." clause with trigger phrases like "add", "draft", or "release note".
- State boundaries if a neighboring skill could be confused with this one.
- Write in the third person. The text is injected into the agent's context, so "I can help with..." reads oddly there.
Weak and strong descriptions
---
name: changelog-entry
description: Helps with changelogs.
---This is too vague. It does not say what the help is, and it lacks the phrases a user would say. Compare it with this version:
---
name: changelog-entry
description: Writes a changelog entry in the project's format, grouped under Added, Changed, Fixed, or Removed. Use when the user asks to add, draft, or update a changelog or release note. Does not publish releases.
---The second version names the action, the output, the triggers, and one boundary.
Common errors
| Problem | Symptom | Fix |
|---|---|---|
| Too vague | Skill rarely loads | Add the action, artifact, and trigger phrases |
| Too broad ("any code task") | Skill loads when it should not | Narrow the scope and add a boundary |
| Overlaps another skill | Wrong skill is picked | Say which task belongs to each skill |
| Describes internals | No match with user wording | Describe the user's goal, not your implementation |
| Very long | Wastes budget on every session | Keep it to a few sentences and move details into the body |
Test it like a classifier
Treat the description as a rule that sorts requests into "use this skill" and "do not". Write a small set of test prompts:
- Three prompts that should trigger the skill, phrased in different ways.
- Three that should not, including one close to the boundary.
Run each in a fresh session and note whether the skill loads. If a should-trigger prompt fails, borrow its wording for the description. If a should-not prompt triggers the skill, add a boundary or narrow the verbs.
Exercise
A skill named db-migration has the description "Database stuff." Users say "add a column to the orders table", and the skill never loads. Rewrite the description in two sentences.
Show answer
For example: "Creates a database migration file for schema changes such as adding, renaming, or dropping columns and tables. Use when the user asks to change the database schema or add a migration. Does not run migrations against a live database." It names the action and output, includes trigger wording, and states a boundary.