hook-development-pipeline
Hook Development Pipeline
Operator Context
This skill wraps the hook-development-engineer with explicit phase gates that enforce the requirements the engineer cannot enforce alone: a reviewed spec before any code is written, a mandatory sub-50ms timing test before the hook is registered, and a registration step that makes "done" mean "live and documented" rather than just "written."
Hooks fire on every tool use in a live Claude Code session. A slow hook is not an acceptable hook — it degrades every tool call permanently. The performance gate in Phase 3 exists precisely because "should be fast" is not the same as "was measured."
Hardcoded Behaviors (Always Apply)
- Spec Before Code: Phase 1 must produce a written spec with all decisions recorded before Phase 2 begins. Never skip to implementation.
- ADR Session Awareness: In Phase 1 (SPEC), check for active ADR session (
.adr-session.json). If found, read hook requirements from the ADR viapython3 scripts/adr-query.py context --adr {adr_path} --role script-creator. Include ADR-specified event types, matchers, and behavioral requirements in the spec. Runadr-query.py listto check for related ADRs. - Performance Gate is Blocking: If
time python3 hooks/{name}.py < /dev/nullreads ≥ 50ms, return to Phase 2. Do not proceed to Phase 4. No exceptions, no "close enough." - Non-Blocking Gate is Blocking: If the hook exits non-zero on invalid input, return to Phase 2. A crashing hook is worse than no hook.
- Registration is Part of Done: A hook not registered in
settings.jsonis not done. Phase 4 is mandatory. - Lazy Imports Only: All non-stdlib imports must be inside functions. Top-level imports add cold-start time and kill the performance budget.
- Exit 0 Always: The hook's
__main__block must end withsys.exit(0)inside afinallyclause. Not optional.
Default Behaviors (ON unless disabled)
More from notque/claude-code-toolkit
generate-claudemd
Generate project-specific CLAUDE.md from repo analysis.
12fish-shell-config
Fish shell configuration and PATH management.
12pptx-generator
PPTX presentation generation with visual QA: slides, pitch decks.
12codebase-overview
Systematic codebase exploration and architecture mapping.
10image-to-video
FFmpeg-based video creation from image and audio.
9data-analysis
Decision-first data analysis with statistical rigor gates.
9