Skip to main content

Overview

The trigger 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
Path to the skill directory. Defaults to current directory if not specified.

Options

string
Alias: -tOnly run tests of a specific trigger type. Filters test execution.Options:
  • explicit - Skill named directly with $ prefix
  • implicit - Describes exact scenario without naming skill
  • contextual - Realistic noisy prompt with domain context
  • negative - Should NOT trigger (catches false positives)
Path
Alias: -oOutput file path for JSON report.
string
default:"console"
Alias: -fOutput format for the report.Options:
  • console - Human-readable terminal output with table formatting
  • json - 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 tested
  • runtime: runtime used (e.g., “claude”)
  • tests_run: total number of tests
  • tests_passed: number of passed tests
  • overall_pass: boolean
  • duration_ms: execution time in milliseconds
  • results: array of test results
  • summary_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)
If no test files are found, the command suggests using 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.