write-hook
Installation
SKILL.md
Hook Creator
Create hooks that enforce code quality through static analysis.
Core Principles
- Exit code 2 blocks - Use to prevent bad code from being written
- Fast checks only - Hooks run synchronously; keep under 5 seconds
- JSON stdin/stdout - Hooks receive context, can output structured responses
- Fail safe - Non-zero (except 2) continues execution with warning
- Use Python - Wrap shell commands in Python for cross-platform compatibility
Quick Start
Add a static check hook:
python3 scripts/add_hook.py <hook-name> --type <lint|format|typecheck|custom>