Agent skill · software engineering · secondsky
claude-hook-writer
Expert guidance for writing secure, reliable, and performant Claude Code hooks - validates design decisions, enforces best practices, and prevents common pitfalls. Use when creating, reviewing, or debugging Claude Code hooks.
Why this skill is useful
Provides specific security patterns and performance optimization techniques for Claude Code hooks that the AI wouldn't reliably generate on its own.
What it needs
About 7k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.
What this skill does
Claude Hook Writer Status: Production Ready Version: 2.0.0 (Optimized with progressive disclosure) Last Updated: 2025-12-17 --- Overview Expert guidance for writing secure, reliable, and performant Claude Code hooks. This skill validates design decisions, enforces best practices, and prevents common pitfalls. --- When to Use This Skill Designing a new Claude Code hook Reviewing existing hook code Debugging hook failures Optimizing slow hooks Securing hooks that handle sensitive data Publishing hooks as PRPM packages --- Core Principles 1. Security is Non-Negotiable Hooks execute automatically with user permissions and can read, modify, or delete any file the user can access. ALWAYS validate and sanitize all input. Hooks receive JSON via stdin—never trust it blindly. For complete security patterns: Load references/security-requirements.md when implementing validation or securing hooks. 2. Reliability Over Features A hook that works 99% of the time is a broken hook. Edge cases (Unicode filenames, spaces in paths, missing tools) will happen. Test with edge cases before deploying. For reliability patterns: Load references/reliability-performance.md when handling errors or edge cases. 3. Performance Matters Hooks block operations. A 5-second hook means Claude waits 5 seconds before continuing. Keep hooks fast. Run heavy operations in background. For performance optimization: Load references/reliability-performance.md when optimizing hook speed. 4. Fail Gracefully Missing dependencies, malformed input, and disk errors will occur. Handle errors explicitly. Log failures. Return meaningful exit codes. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills secondsky/claude-hook-writer