Overview
Thetrigger command runs trigger tests to verify that a skill activates correctly for different types of prompts. It tests whether the skill is properly discovered and invoked by the agent runtime.
Usage
Arguments
Path to the skill directory. Defaults to current directory if not specified.
Options
Alias:
-tOnly run tests of a specific trigger type. Filters test execution.Options:explicit- Skill named directly with $ prefiximplicit- Describes exact scenario without naming skillcontextual- Realistic noisy prompt with domain contextnegative- Should NOT trigger (catches false positives)
Alias:
-oOutput file path for JSON report.Alias:
-fOutput format for the report.Options:console- Human-readable terminal output with table formattingjson- Machine-readable JSON output
Trigger Types
The command tests four types of skill activation:Explicit
Skill named directly with$ prefix in the prompt:
Implicit
Describes the exact scenario without naming the skill:Contextual
Realistic prompt with domain context and noise:Negative
Should NOT trigger the skill (prevents false positives):Examples
Run all trigger tests
Run only explicit trigger tests
Run tests with JSON output
Test specific skill
Output Format
Console Output
Displays a formatted table with:- Test name
- Trigger type
- Pass/fail status (✓ or ✗)
- Summary statistics by type
- Overall pass rate and duration
JSON Output
Includes:skill_name: name of the skill testedruntime: runtime used (e.g., “claude”)tests_run: total number of teststests_passed: number of passed testsoverall_pass: booleanduration_ms: execution time in millisecondsresults: array of test resultssummary_by_type: statistics grouped by trigger type
Test Definition Files
Trigger tests must be defined in YAML files located at:.skill-lab/tests/scenarios.yaml(legacy).skill-lab/tests/triggers.yaml(recommended)
sklab generate to create them automatically.
Exit Codes
- 0: All trigger tests passed
- 1: One or more tests failed or error occurred
Notes
Trigger tests require test definitions in
.skill-lab/tests/triggers.yaml. Use sklab generate to auto-generate tests.The Claude runtime requires the Claude CLI to be properly configured. Ensure you have access to Claude’s API.
Related Commands
- sklab generate - Generate trigger tests using LLM
- sklab evaluate - Run static analysis checks