Defined in hooks/hooks.json
{
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/run-tests.sh",
"timeout": 60
}
],
"matcher": "Write|Edit"
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "🧪 TEST QUALITY VALIDATOR\n\nContext: $ARGUMENTS\n\nEvaluate test quality and comprehensiveness:\n\n1️⃣ EDGE CASE COVERAGE\n - Happy path tested?\n - Error conditions tested?\n - Boundary values tested?\n - Null/empty inputs tested?\n ⚠️ BLOCK if edge cases missing\n\n2️⃣ TEST NAMING\n - Descriptive names (test_should_xxx_when_yyy)?\n - Clear intent from name?\n - Follows project conventions?\n ⚠️ BLOCK if names unclear\n\n3️⃣ ASSERTION QUALITY\n - Meaningful assertions (not just assert True)?\n - Specific expected values?\n - Clear failure messages?\n - One concept per test?\n ⚠️ BLOCK if assertions weak\n\n4️⃣ TEST RELIABILITY\n - No flaky tests?\n - No timing dependencies?\n - No random data without seeding?\n - Deterministic results?\n ⚠️ BLOCK if tests flaky\n\n5️⃣ TEST PERFORMANCE\n - Unit tests < 1s each?\n - Integration tests reasonable?\n - No unnecessary delays?\n ⚠️ WARN if tests slow\n\n6️⃣ TEST MAINTENANCE\n - No skipped/ignored tests without reason?\n - Tests independent (no order dependency)?\n - Clear setup/teardown?\n - No test code duplication?\n\n7️⃣ MOCKING STRATEGY\n - Appropriate use of mocks?\n - Not over-mocked?\n - Integration points tested?\n - Mock behavior realistic?\n\n8️⃣ COVERAGE\n - Critical paths covered?\n - Error handling tested?\n - All public APIs tested?\n\n🚫 BE STRICT on test quality.\n🚫 Poor tests are worse than no tests.\n\nReturn JSON:\n{\n \"decision\": \"approve\" or \"block\",\n \"reason\": \"Detailed test quality assessment with specific improvements needed if blocking, or confirmation of excellent test quality if approving\"\n}",
"timeout": 30
}
]
}
]
}{
"riskFlags": {
"touchesBash": false,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 1,
"command": 1
},
"eventStats": {
"PostToolUse": 1,
"SubagentStop": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 1,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}