aceternity-ui
100+ animated React components (Aceternity UI) for Next.js with Tailwind. Use for hero sections, parallax, 3D effects, or…
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.
Claude Code
$ npx -y skills add secondsky/claude-skills --skill claude-hook-writer --agent claude-code
Codex
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a codex -y
Cursor
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a cursor -y
Gemini CLI
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a gemini-cli -y
GitHub Copilot
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a github-copilot -y
OpenCode
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a opencode -y
Windsurf
$ npx skills add secondsky/claude-skills --skill claude-hook-writer -a windsurf -y
name: claude-hook-writer description: 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. metadata: version: 2.0.0 author: Claude Skills Maintainers last_verified: 2025-12-17 optimization_date: 2025-12-17 token_savings: ~55% errors_prevented: 5 license: MIT
**Status**: Production Ready **Version**: 2.0.0 (Optimized with progressive disclosure) **Last Updated**: 2025-12-17
---
Expert guidance for writing secure, reliable, and performant Claude Code hooks. This skill validates design decisions, enforces best practices, and prevents common pitfalls.
---
---
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.
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.
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.
Missing dependencies, malformed input, and disk errors will occur.
**Handle errors explicitly. Log failures. Return meaningful exit codes.**
---
Before writing code, answer these questions:
**Common mistake:** Using PostToolUse for validation (too late—tool already ran). Use PreToolUse to block operations.
Be specific. `matcher: "*"` runs on every tool call.
**Good matchers:**
**Bad matchers:**
Different tools provide different input. Check what's available:
# PreToolUse / PostToolUse
{
"input": {
"file_path": "/path/to/file.ts", // Read, Write, Edit
"command": "npm test", // Bash
"old_string": "...", // Edit
"new_string": "..." // Edit
}
}**Validate fields exist before using them:**
FILE=$(echo "$INPUT" | jq -r '.input.file_path // empty') if [[ -z "$FILE" ]]; then echo "No file path provided" >&2 exit 1 fi
**Command hooks** (`type: "command"`):
**Prompt hooks** (`type: "prompt"`):
**Rule of thumb:** Use command hooks unless you need LLM reasoning.
**For PreToolUse hooks:**
**For PostToolUse hooks:**
---
**Error**: Hooks break on filenames with spaces or special characters
**Why**: Unquoted variables split on whitespace
**Example**:
# ❌ WRONG - breaks on "my file.txt" cat $FILE prettier --write $FILE rm $FILE # ✅ RIGHT - handles spaces and special chars cat "$FILE" prettier --write "$FILE" rm "$FILE"
**Why this matters**: Files with spaces (`"my file.txt"`), Unicode (`"文件.txt"`), or special chars (`"file (1).txt"`) are common.
**For quoting best practices**: Load `references/security-requirements.md` for comprehensive input handling patterns.
---
**Error**: Hook executes on malicious or malformed input
**Why**: Not validating JSON fields before using them
**Example**:
# ❌ DANGEROUS - no validation FILE=$(jq -r '.input.file_path') rm "$FILE" # Could delete ../../../etc/passwd # ✅ SAFE - validate first FILE=$(jq -r '.input.file_path // empty') [[ -n "$FILE" ]] || exit 1 [[ "$FILE" == "$CLAUDE_PROJECT_DIR"* ]] || exit 2 [[ "$FILE" != *".."* ]] || exit 2 rm "$FILE"
**Why this matters**: Prevents path traversal attacks, protects files outside project, prevents malformed input crashes.
**For complete security patterns**: Load `references/
145 production-ready skills for Claude Code CLI 🔌 Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).
100+ animated React components (Aceternity UI) for Next.js with Tailwind. Use for hero sections, parallax, 3D effects, or…
Secure API authentication with JWT, OAuth 2.0, API keys. Use for authentication systems, third-party integrations,…
Creates comprehensive API changelogs documenting breaking changes, deprecations, and migration strategies for API consumers. Use…
Verifies API contracts between services using consumer-driven contracts, schema validation, and tools like Pact. Use when testing…
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use…
Implements standardized API error responses with proper status codes, logging, and user-friendly messages. Use when building…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.