write-hook

Generate Claude Code hooks for linting, formatting, and type checks.

16|5|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/wayne930242/Reflexive-Claude-Code --skill write-hook
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-hook
Source: https://github.com/wayne930242/Reflexive-Claude-Code/tree/main/skills/write-hook
Command: npx skills add https://github.com/wayne930242/Reflexive-Claude-Code --skill write-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a Hook Creator to generate Claude Code hooks for static analysis and code quality, enabling teams to enforce standards with pre-built linting, formatting, and type-checking hooks. Use when setting up project quality gates or adding pre-commit style checks.

Core Features & Use Cases

  • Hook Templates: Pre-built templates for lint, format, and type-check hooks.
  • Deterministic Execution: Hooks run synchronously and quickly to minimize dev friction.
  • Cross-Platform: Python-based wrappers for cross-platform compatibility.

Quick Start

Create a lint/format/type-check hook: python3 scripts/add_hook.py <hook-name> --type <lint|format|typecheck|custom>

Example: python3 scripts/add_hook.py pre-commit-eslint --type lint

Frequently Asked Questions about write-hook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate code quality checks in my JavaScript or Python project?▼

Create Claude Code hooks to automate linting, formatting, and type checking. This Skill generates pre-built hooks for ESLint, Prettier, tsc, Ruff, Mypy, and Bandit that run synchronously during Write/Edit operations, blocking violations with exit code 2 and completing within five seconds.

Can I use pre-commit hooks with Claude Code for multiple languages?▼

Yes. This Skill provides cross-platform Python-wrapped hooks supporting JavaScript, TypeScript, Python, and Markdown. Configure lint, format, and type-check templates for each language and apply them in project setup or pre-commit/CI workflows.

How do I set up a linting hook for my project?▼

Run `python3 scripts/add_hook.py <hook-name> --type lint` to generate a hook. The Skill creates a ready-to-use hook that communicates via JSON stdin/stdout, enforces standards deterministically, and integrates into your development workflow immediately.

What languages and tools does this hook support?▼

Hooks support JavaScript and TypeScript via ESLint and Prettier, Python via Ruff, Mypy, and Bandit, and Markdown formatting. Each language has configurable templates for linting, formatting, and type checking.

Do I need to configure hooks for each project, or can I reuse them?▼

Hooks are generated per project using configurable templates and settings. The Skill creates language-specific hooks tailored to your project structure; you can customize templates for consistent enforcement across multiple projects.

What happens if a hook detects a code quality violation?▼

Hooks block execution and exit with code 2 on violations, halting Write/Edit operations. Non-violations exit safely without blocking. This ensures violations are caught before code is committed while maintaining fast, friction-free workflows.