Skill with Tests
When to use this skill
Use this as a reference when adding test scenarios to your own skills. The tests/ directory contains structured test cases that follow the TestScenario format from @skillscraft/spec.
Instructions
- Read
tests/scenarios.jsonto see the test format - Each scenario has a
name,description, and array ofcases - Each case provides an
inputprompt andassertionsto check the output - Assertion types:
contains,not-contains,matches-regex,file-created,file-modified,command-executed,custom - Use this pattern in your own skills to make them testable
Test scenario structure
{
"name": "scenario-name",
"description": "What this scenario tests",
"cases": [
{
"name": "case-name",
"input": "User prompt to test with",
"assertions": [
{ "type": "contains", "value": "expected output text" }
],
"expectedBehavior": "Human-readable description"
}
]
}
Gotchas
- Assertions check the agent's text output, not internal state
- The
matches-regextype uses JavaScript regex syntax file-createdandfile-modifiedassertions check the filesystem after the skill runs- Test scenarios are declarative — you need a test runner to execute them