When you are testing Claude skills, a case usually fails for the wrong reason because its check describes one sample answer instead of the rule behind it. A check that demands particular words turns red on a right answer phrased differently, and a check that tests only the sample from the rule's description stays green on an answer that breaks it. Both come from writing the check while staring at the reply you hoped to get. Judge every check against two further replies: one that is right but worded in a way you never imagined, and one that breaks the rule through a door you did not think of. The check earns its place only if the first leaves it green and the second turns it red.

What official guidance says about testing Claude skills

Anthropic's authoring guide for skills says to build evaluations first, take a baseline of the model working without the skill, and then write just enough instructions to close the gaps you observed. Its example evaluation is a small record with the skills involved, a query, optional input files and a list of expected behaviours. The same page admits there is no built-in runner, so you assemble your own, and it calls the evaluations the source of truth for whether a skill works (Anthropic, skill best practices).

The wider guide on evaluations covers grading. Code-based grading is the quickest and most dependable, with exact match and string match as the simple variants, while a model acting as grader is flexible but needs its own reliability check first. That guide also asks for edge cases: input that is irrelevant, missing or very long (Anthropic, develop tests).

Neither page explains how to write a string match that tells the truth about free-form prose. That is the part people get wrong, and the rest of this guide is about it.

When a check rejects a right answer

Take an imaginary skill that drafts release notes, with a rule: mention the upgrade path when a change breaks compatibility. These are the usual ways a case turns on a good reply.

A check borrows the skill's vocabulary. It demands the phrase "migration guide", and a reply saying "here is how to move your code across" obeys the rule and fails. A check speaks one language only, so a correct reply in the reader's own language is rejected. A check expects one spelling of a value: a version can be written as v2, "version 2" or "the second major release", and a date as month name, dotted numbers or year-first digits. Unless the skill prescribes an exact format, every spelling is correct.

A ban can be broader than its rule. If the rule says never to promise a release date, a check forbidding every date also rejects the reply that quotes the date the user supplied, and a forbidden short fragment fires inside unrelated longer words. Limits can be tighter than the rule too: a word cap below the skill's own cap, a demanded line break where one line was fine, or an end-of-reply pattern that chokes on a trailing space.

In each case the check records one way of saying the thing, not the thing itself.

When a check waves a broken answer through

The opposite failures are quieter, because nothing turns red and the score looks healthy.

A rule that lists several items gets a check for the first item only. A qualifier is dropped: the rule says to offer a rollback "without extra charge", the check hunts for the rollback, and an offer with a fee still passes, although the qualifier was the whole rule. A banned value is hunted only as numerals, so "by next Friday" or "a couple of weeks" walks past. A count is tested as presence: the skill wants one sentence and the check confirms that a sentence exists. A fixed literal, such as an exact opening line or status word, is matched without case or anchor and accepts the wrong spelling in the wrong place.

Requiring versus forbidding

A forbidding check trips only on a reply that actually contains the breach, which suits cases where you can enumerate how a breach looks. A requiring check trips on every reply that lacks your chosen words, so it holds up only when the acceptable wordings form a short, complete list: an exact token the skill dictates, or a figure from the input in each of its spellings.

Reasons, apologies, thanks and reassurance are open sets. Never demand a list of synonyms there; the reply you did not picture will choose another word and be marked wrong. Ban the concrete breach instead, or leave the rule unchecked and say so. Open behaviour is where a model grader fits, as the evaluation guide describes: hand it a clear rubric and test the grader itself before relying on it.

A check that can fail

This routine applies to each case and is the core of testing Claude skills with mechanical checks.

  1. Sort the skill's rules into exact ones (a string, a position, a key) and behavioural ones (tell, offer, ask, refuse, stay short).
  2. For each input, write two or more right replies that avoid the skill's phrasing, spell each value differently and vary in length. When the skill sets a language, add a one-sentence reply in it.
  3. For every rule, write a reply that violates only that rule. A list gets one reply per entry. With a qualifier, keep the action and break the qualifier. A banned value gets a reply that writes it in words.
  4. Once the checks exist, run each one against every reply from steps 2 and 3. Right replies must clear all of their case's checks; each violating reply must trip at least one.
  5. A right reply that trips a check means the check is edited, not the reply.
  6. For each requiring check still standing, write a final right reply that dodges all the wordings it accepts. If that reply is rejected, drop or turn the check into a ban.

The same idea scales to the whole suite, because a score from checks that cannot fail says nothing. We describe that general failure in the broader trouble with green results that mean nothing. The setup specific to skills, baseline without the skill included, is in our walk-through on writing and testing skill files. When a deliberately wrong reply gets past every check, the suite has a hole; the skill is not the culprit.

Check the file under test as well

Cases cannot rescue a skill whose file never loads. The Agent Skills specification caps the description at 1024 characters and the name at 64 characters drawn from small letters, numerals and hyphens, and expects the description to say what the skill is for and when it applies (Agent Skills specification). A skill that never triggers fails every case for a reason no check will explain, so read the front matter before blaming the checks.

Our skills for this topic

  • test-guard-review examines a pasted test or script and tells you whether a green result could survive the guarded thing being broken.
  • skill-md-review goes through a SKILL.md for front matter limits, hidden orders, pasted credentials and risky commands, then gives a verdict.
  • tests-from-spec fits a neighbouring job: it derives table-driven tests from a specification instead of the code.
  • regex-from-examples fits another: it produces a JavaScript pattern from a description plus sample strings that should and should not match.

When this does not apply

Mechanical checks suit rules that are literal or have a closed set of forms. Tone, helpfulness and "explains clearly" do not reduce to string matching; for those a rubric-graded model, tested itself, is the sensible route. We also assumed a single-turn reply: an agent that edits files or calls tools needs checks on those effects, which this guide skips. The failure lists are patterns, not a full catalogue, and we ran no experiment for it. The advice leans on three public pages, read on 26 November 2026, plus our own habit of writing evals, and the pages may have moved since.

Read this post as Markdown: /blog/testing-claude-skills-evals.md · Atom feed.