Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →LLM-powered quality verification using prompt hooks. Validates commit messages, code patterns, and conventions using AI before allowing operations. Use to set up intelligent guardrails.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -23% | 0% |
Use Claude Code's type: "prompt" hooks to create intelligent quality gates that use AI to verify operations.
Use when:
Claude Code supports hooks with type: "prompt" that run a small LLM (Haiku by default) to verify conditions:
json{ "PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "prompt", "if": "Bash(git commit*)", "prompt": "Check if this git commit follows conventional commit format (<type>(<scope>): <summary>). The commit command is: $ARGUMENTS. Return {\"ok\": true} if valid, {\"ok\": false, \"reason\": \"...\"} if not.", "model": "haiku", "timeout": 15 }] }] }
The hook:
$ARGUMENTS with the JSON hook input{"ok": true} or {"ok": false, "reason": "..."}json{ "type": "prompt", "if": "Bash(git commit*)", "prompt": "Verify this git commit follows conventional commits: type(scope): summary. Types: feat,fix,refactor,test,docs,chore,perf,ci. Summary under 72 chars. Input: $ARGUMENTS", "model": "haiku" }
json{ "type": "prompt", "if": "Bash(rm *)", "prompt": "Check if this rm command is safe. Flag if it uses -rf on important directories (src/, node_modules/, .git/). Input: $ARGUMENTS", "model": "haiku" }
json{ "type": "prompt", "matcher": "Write", "prompt": "Check if this file write contains hardcoded API keys, secrets, passwords, or tokens. Input: $ARGUMENTS. Return ok:false if secrets found.", "model": "haiku" }
For complex verification, use type: "agent" (runs a full agent):
json{ "type": "agent", "if": "Bash(git push*)", "prompt": "Review all staged changes for security issues before pushing. Check for: hardcoded secrets, SQL injection, XSS vulnerabilities, exposed internal URLs.", "model": "haiku", "timeout": 60 }
if condition to avoid running on every tool callOther measured skills in the registry, with their headline benchmark lift.