Skip to content

Skill Trigger

The skill-trigger evaluator detects whether a Claude Code agent invoked a specific skill during task execution. Use it to test that an agent correctly recognizes when a skill is applicable and triggers it as its first action.

assertions:
- type: skill-trigger
skill: commit
should_trigger: true
PropertyTypeRequiredDefaultDescription
skillstringYesThe skill name to detect. Case-sensitive substring match against the tool input.
should_triggerbooleanNotrueWhether the skill is expected to trigger. Set to false for negative test cases.

Only the first tool call in the agent’s response is examined. Subsequent tool calls are ignored.

First Tool CallPass Condition
Skill toolinput.skill contains the skill name (case-sensitive substring)
Read toolinput.file_path contains the skill name (case-sensitive substring)
Any other toolNot triggered

When should_trigger: false, the pass/fail logic is inverted — the assertion passes if the skill was not triggered.

Assert that the agent triggers the commit skill when asked to commit changes:

tests:
- id: triggers-skill
input: "Commit my changes"
assertions:
- type: skill-trigger
skill: commit
should_trigger: true

Assert that the agent does not trigger the commit skill for an unrelated prompt:

tests:
- id: no-false-trigger
input: "What time is it?"
assertions:
- type: skill-trigger
skill: commit
should_trigger: false
tests:
- id: triggers-on-commit-request
input: "Commit my changes"
assertions:
- type: skill-trigger
skill: commit
should_trigger: true
- id: no-trigger-on-unrelated-request
input: "What time is it?"
assertions:
- type: skill-trigger
skill: commit
should_trigger: false
- id: triggers-on-push-request
input: "Push my branch"
assertions:
- type: skill-trigger
skill: push
should_trigger: true

The skill-trigger evaluator is the mechanism the EVAL.yaml transpiler uses to route test cases into per-skill evals.json files. When a test case contains a skill-trigger assertion, the transpiler places that test case into the eval file for the named skill, with should_trigger set accordingly.

This makes skill-trigger a first-class part of the EVAL.yaml format for skill-based evaluation workflows.

Example transpiler routing:

A test with type: skill-trigger / skill: commit is placed into the commit skill’s evals.json:

# EVAL.yaml (source)
tests:
- id: commit-trigger
input: "Commit my changes"
assertions:
- type: skill-trigger
skill: commit
should_trigger: true
// .agentv/skills/commit/evals.json (transpiled output)
{
"tests": [
{
"id": "commit-trigger",
"input": "Commit my changes",
"should_trigger": true
}
]
}
OutcomeScore
Skill triggered and should_trigger: true1.0
Skill not triggered and should_trigger: false1.0
Skill triggered and should_trigger: false0.0
Skill not triggered and should_trigger: true0.0