Topic 3 of 5 · 5 min read
Testing that a skill fires and helps
Goal: Build a set of matching and near-miss prompts for a skill and read the run logs to decide whether it under-triggers, over-triggers or fails to improve the result.
Test a skill like any other code: write prompts that should trigger it, prompts that should not, run them, and compare results with and without the skill. You cannot judge a skill by reading it, because the agent's choice to load it is the part you cannot see.
Check yourself · 1 of 3
What is a near-miss prompt in a skill test set?
Why it matters
A skill can fail in three ways. It can under-trigger: the task matches but the agent never loads it. It can over-trigger: it loads for unrelated tasks and adds noise or wrong rules. Or it can load and not help: the agent reads it and the output is no better. Only a test tells these apart. Model outputs vary between runs, so one lucky run proves little.
How to test it
1. Write a prompt set. Make a small file with three groups:
- Matching prompts (5 to 10): the real wording people use, including sloppy phrasings. "write the release notes for 2.4", "what shipped this week?", "update CHANGELOG".
- Near-miss prompts (5 to 10): requests that share words but should not fire. "explain what a changelog is", "revert the last release commit".
- Unrelated prompts (a few): a baseline to catch accidental triggers.
2. Record whether it loaded. Most agents show which skills were used in the transcript or log. Run each prompt a few times and note the result for each. Count loads per prompt, not just yes or no.
3. Compare with and without. Run the matching prompts with the skill installed and with it removed. Check the output against a short checklist: correct format, script was run, no invented items. If the outputs are the same, the skill adds cost and no value.
4. Fix the cause. Under-triggers: add the user's wording to the description. Over-triggers: narrow the description and say what it is not for. Loaded but unhelpful: the steps are vague or the script is not being run, so tighten the steps.
Before and after
# prompts.tsv prompt <TAB> expected
write release notes for 2.4 load
what shipped this week load
explain what a changelog is no-load
revert the last release commit no-load
fix the typo in README no-load
Weak: you try one prompt, it loads, and you ship the skill. A teammate asks "what shipped this week" and nothing happens.
Better: you run all rows three times each. "what shipped this week" loads once in three, so you add "or asks what shipped" to the description and rerun until it loads every time. "revert the last release commit" also loaded once, so you add "Not for reverting or tagging."
What goes wrong
- Testing only the happy prompt. It loads, so you assume all wordings do.
- Judging from one run. Agent behaviour varies, so repeat each prompt.
- Skipping the baseline. Without a run lacking the skill, you cannot say the skill helped.
- Not rerunning after edits. A narrower description may fix a false trigger and break a true one.
Examples
Reading a trigger log
prompt runs loaded
write release notes for 2.4 3 3
what shipped this week 3 1
explain what a changelog is 3 0
revert the last release commit 3 2
"what shipped this week" under-triggers (1 of 3): add that phrasing to the description. "revert the last release commit" over-triggers (2 of 3): add a clause that the skill is not for reverting.
Key points
- A skill can under-trigger, over-trigger or load without improving the output, and only tests show which one is happening.
- A good prompt set has matching prompts in real wording, near-miss prompts that share words but should not fire, and a few unrelated prompts.
- Run each prompt several times and record loads from the agent's log, because behaviour varies between runs.
- Compare outputs with and without the skill against a short checklist; identical outputs mean the skill adds cost for no value.
- After every description change, rerun the whole set, since narrowing can fix a false trigger and break a true one.
Common mistakes
- Testing one friendly prompt and shipping the skill, so other wordings of the same request never trigger it.
- Running each prompt once and treating the result as stable, when the agent may load the skill on some runs and not others.
- Skipping near-miss prompts, so a skill that fires on any mention of a keyword goes unnoticed until it interferes with other work.
- Never comparing against a run without the skill, so a skill that changes nothing stays installed and keeps costing context.
Check yourself · 2 of 3
A skill loads in only 1 of 3 runs for 'what shipped this week', which should trigger it. What is the best fix?
Check yourself · 3 of 3
With and without the skill, the agent's release notes are identical and it never ran the bundled script. What does this show?
Practice items, not counted towards your mastery.
Start here
- Agent Skills specification (opens in a new tab)DocsFree
The open format: required SKILL.md fields, folder layout and how agents load a skill in stages.
- Equipping agents for the real world with Agent Skills (Anthropic) (opens in a new tab)ArticleFree
The design idea behind skills: progressive disclosure, bundled scripts and why they beat stuffing everything in the prompt.
- Extend Claude with skills (Claude Code docs) (opens in a new tab)DocsFree
How Claude Code discovers, triggers and scopes skills, with frontmatter options and examples.