typescript-hook-writer

Build, compile, test, and package TypeScript Claude Code hooks with esbuild and Vitest.

121|16|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/pr-pm/prpm --skill typescript-hook-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-hook-writer
Source: https://github.com/pr-pm/prpm/tree/main/.claude/skills/typescript-hook-writer
Command: npx skills add https://github.com/pr-pm/prpm --skill typescript-hook-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires esbuild, tsx, vitest, typescript, and includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the complexity and error-proneness of developing Claude Code hooks by providing a complete TypeScript development environment with shared utilities, testing, and compilation.

Core Features & Use Cases

  • Type-Safe Development: Catch errors at compile time with full TypeScript support.
  • Shared Utilities: Reduce code duplication with reusable functions for common hook operations.
  • Use Case: Imagine you need to create a security hook that blocks modifications to sensitive files. Use this Skill to build it with proper validation, testing, and distribution as a single JavaScript file.

Quick Start

Use the typescript-hook-writer skill to create a new TypeScript hook that automatically formats code files after Claude edits them.

Frequently Asked Questions about typescript-hook-writer

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

FAQPage Schema
How do I build TypeScript Claude Code hooks with testing and compilation?

TypeScript hook development with this Skill provides type-safe compilation using esbuild, integrated testing via Vitest, and shared utilities to reduce duplication. It bundles your hooks into single JavaScript files ready for distribution, catching errors at compile time rather than runtime.

Can I use esbuild and TypeScript together to create Claude Code hooks?

Yes. This Skill combines esbuild bundling with full TypeScript strictness to compile hook source code into a single optimized JavaScript bundle. Shared utilities prevent code duplication across multiple hooks in the same project.

What's the best way to test TypeScript hooks before distributing them?

Vitest integration lets you write and run tests alongside your TypeScript hook code. Tests execute before bundling, catching logic errors early and ensuring hooks behave correctly when deployed as JavaScript packages.

Do I need to manually configure esbuild and Vitest for hook development?

No. This Skill provides a reproducible pipeline with esbuild and Vitest pre-configured for hook compilation and testing. You write TypeScript; the Skill handles building, testing, and packaging into per-hook distributions automatically.

How do I share common functions across multiple Claude Code hooks?

Shared utilities are built into this Skill's workflow, letting you define reusable functions once and import them across hooks. The bundling process includes these utilities in each hook's output without duplication.

What happens to my TypeScript code when the Skill packages a hook?

Your TypeScript compiles to JavaScript via esbuild, bundles with dependencies and shared utilities into a single file, then outputs to per-hook dist directories ready for PRPM packaging and deployment.