{
"version": 1,
"setup": [["node", "fixtures/setup.mjs"]],
"after_response": {
"approve": [["node", "fixtures/apply-approval.mjs"]]
},
"teardown": [["node", "fixtures/teardown.mjs"]]
}Testing / Deterministic effects
Make fixture side effects explicit.
yskill test runs commands for real. Fixture hooks prepare only the state a saved agent or user response would have changed.
Declare setup, response effects, and cleanup.
Read the accepted response from standard input.
Each after_response command receives that fixture response as JSON on stdin. Hooks run without a shell.
const chunks = []
for await (const chunk of process.stdin) chunks.push(chunk)
const response = JSON.parse(Buffer.concat(chunks).toString())
if (response.value !== "yes") process.exit(1)
// Create only the deterministic state the approved step needs.Cleanup runs after success or failure.
- Setup runs firstPrepare isolated fixture state before the workflow starts.
- Response effects run after admissionChange state only after Yield accepts the named answer.
- Teardown always runsRemove test state after a completed or failed test.
- Every hook gets YIELD_FIXTURE=1Keep test-only behavior out of live runs.
Keep the workflow real.Hooks should prepare or clean fixture state. They should not replace the workflow behavior being tested.
Rust: fixture helpers may add another binary under src/bin/. New workflows name the primary workflow binary in skill.json, so Cargo runs the workflow without asking you to choose one.