Guide

Test and Eval Your Claude Skills

Build an evaluation harness to test skill triggers, verify output assertions, and prevent regressions as prompts evolve.

~9 min read

The most dangerous moment for any skill is the second week after you write it. On day one, you tested it with the exact phrasing in your head, and it worked. On day ten, you add two new skills to your project, tighten a description, or update your model, and suddenly your skill stops triggering.

Software engineers would never deploy a payment service without automated unit tests. Yet most teams deploy AI skills based on a single subjective conversation. If you want skills that perform consistently across hundreds of sessions, you must evaluate them systematically.

The four silent failure modes of untested skills

Skills do not crash like broken compilers. They degrade quietly in four specific ways:

  • False negatives: A user asks for the task using natural synonyms, but the skill fails to trigger, leaving Claude to give a generic answer.
  • False positives: A user asks an unrelated question, but an overly broad description causes your skill to hijack the conversation.
  • Output drift: The skill triggers correctly, but fails to obey formatting constraints like character limits or required JSON keys.
  • Character budget truncation: Your `description` and `when_to_use` fields exceed the 1,536-character budget, causing Claude Code to truncate your trigger instructions.

Building a positive and negative trigger matrix

Testing a skill begins with a trigger matrix. You write a balanced list of positive queries that MUST load the skill, and near-miss negative queries that must NOT load it.

Comment: Positive queries: must trigger pr-summary
You type: draft a PR description comparing this branch against main
You type: summarize my branch changes into a pull request body
You type: prepare the PR template with release notes from our commits
Comment: Negative queries: must NOT trigger pr-summary
You type: write a git commit message for these staged files
Note: Must route to commit-helper instead.
You type: review this pull request diff for security vulnerabilities
Note: Must route to code-review skill or standard session.
A trigger evaluation matrix for a pull request summary skill.

Deterministic output assertions over vibes

Never evaluate a skill by asking whether the response "feels right." Evaluate hard, measurable assertions:

  1. Structural constraints: Did the output include all three required markdown headings (Summary, Changes, Testing)?
  2. Negative constraints: Did the response omit internal ticket IDs, private keys, or banned promotional jargon?
  3. Schema validity: If the skill outputs JSON or YAML, does it parse without errors against a schema validator?
  4. Tool calls: Did the skill call the required verification script before outputting its final conclusion?

Using the official skill-creator plugin

Anthropic provides an official plugin specifically designed for evaluating skills and optimizing descriptions: `skill-creator`.

Command: claude plugin install skill-creator@claude-plugins-official
Output: Installed plugin "skill-creator" version 1.1.0
You type: evaluate skill .claude/skills/pr-summary with 12 test prompts
Output: Testing trigger precision across 12 inputs...
Output: Trigger success: 12/12 (100%)
Output: Constraint verification: 11/12 (1 failure: missing "How to Test" section)
Note: Automated sweeps find edge cases in seconds that manual testing never catches.
Install skill-creator and run an automated evaluation sweep.

Headless regression testing with claude -p

For continuous integration, you can script trigger verification using Claude Code in headless print mode (`-p`). A simple shell script can assert that the skill announcement appears in standard output.

#!/usr/bin/env bash
# test-trigger.sh
QUERY="summarize this branch into a pull request draft"
OUTPUT=$(claude -p "$QUERY")

if echo "$OUTPUT" | grep -q "Using skill: pr-summary"; then
  echo "PASS: Skill triggered as expected."
else
  echo "FAIL: Skill failed to trigger on target query."
  exit 1
fi
Command: ./test-trigger.sh
Output: Running query against Claude Code headless session...
Output: PASS: Skill triggered as expected.
Note: Automated CI checks fail immediately if description edits cause trigger regressions.
Execute the headless regression check from your CI pipeline.
Stay updated

Get new guides in your inbox

One task, one guide, done fast. Practical Claude Code skills, zero noise.