husky

Configure Husky pre-commit hooks to run linting, tests, and formatting.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill husky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: husky
Source: https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template/tree/main/.github/agents/app-starter/agents-context/skills/husky
Command: npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill husky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually enforcing code quality before commits is error-prone; this Skill automates pre-commit checks by configuring Husky hooks to run linting, tests, and formatting.

Core Features & Use Cases

  • Automatic Husky initialization during npm install.
  • Create and customize the .husky/pre-commit hook to run linting, tests, and formatting.
  • Ensure the pre-commit hook is executable and wired to run on commit.

Quick Start

Initialize Husky during npm install and replace the .husky/pre-commit hook with the required checks.

Frequently Asked Questions about husky

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

FAQPage Schema
How do I configure pre-commit hooks to run linting and tests automatically?

You can configure pre-commit hooks by initializing Husky using the npm install prepare script and creating an executable .husky/pre-commit file to run linting, tests, and formatting automatically before commits.

What is the best way to automate code quality checks before a git commit?

Automating code quality checks before a git commit is best handled by configuring Husky hooks to enforce linting, testing, and formatting gates, eliminating the error-prone nature of manual quality enforcement.

Does Husky work with npm to enforce code quality in JavaScript projects?

Yes, Husky works with JavaScript and TypeScript projects using npm by automating Husky initialization during npm install and wiring the .husky/pre-commit hook to enforce code quality gates.

How do I set up a prepare script to initialize Husky during npm install?

To set up Husky during npm install, you configure the prepare script in your package.json, which initializes Husky and ensures the .husky/pre-commit hook exists and is executable for running quality checks.

Why is my pre-commit hook not running formatting and tests before commits?

Your pre-commit hook may not be running formatting and tests if the .husky/pre-commit file is missing, not executable, or if Husky was not properly initialized via the npm install prepare script.

Can I customize the .husky/pre-commit hook to run specific formatting checks?

Yes, you can customize the .husky/pre-commit hook to run specific formatting checks by replacing its contents with the required linting, testing, and formatting commands after Husky is initialized.