git-hooks

Configure Husky Git hooks for pre-commit linting, pre-push testing, and commit message validation.

Updated Nov 13, 2025
One-click install
npx skills add https://github.com/caseymanos/dev-skills-marketplace --skill git-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-hooks
Source: https://github.com/caseymanos/dev-skills-marketplace/tree/main/devEnv/dev-skills-marketplace/skills/git-hooks
Command: npx skills add https://github.com/caseymanos/dev-skills-marketplace --skill git-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires husky, lint-staged, @commitlint/cli, @commitlint/config-conventional, eslint, prettier, @typescript-eslint/parser, @typescript-eslint/eslint-plugin, and includes scripts (resource) components.

What problem does it solve?

Automate code quality enforcement through Git hooks to ensure consistent checks across repositories and teams.

Core Features & Use Cases

  • Pre-commit linting and formatting with Husky and lint-staged.
  • Pre-push tests and commit message validation to maintain code quality and history integrity.
  • Custom hooks for any project and easy integration with ESLint, Prettier, and commitlint.

Quick Start

Configure your project to run linting, tests, and formatting automatically by enabling Husky-based git hooks.

Frequently Asked Questions about git-hooks

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

FAQPage Schema
How do I automate code quality checks with git hooks in a JavaScript project?

Automate code quality checks by configuring Husky-based git hooks to run lint-staged, ESLint, and Prettier automatically. This enforces pre-commit linting, formatting, and commit message validation to maintain consistent code standards across your repository.

How does lint-staged work with Husky for pre-commit linting?

Lint-staged works with Husky by running ESLint and Prettier only on staged files during the pre-commit hook. This ensures formatting and linting checks execute efficiently before changes are committed to the repository.

Can I use commitlint to enforce conventional commit messages with git hooks?

Yes, commitlint integrates with Husky hooks to validate commit messages against the conventional commits configuration. This enforces consistent commit history integrity by rejecting messages that do not match the required format.

Does this git hooks setup support TypeScript projects with ESLint?

Yes, the setup supports TypeScript projects by utilizing the @typescript-eslint/parser and @typescript-eslint/eslint-plugin. It enforces TypeScript-specific linting rules alongside standard JavaScript formatting through the pre-commit hooks.

What's the best way to run tests automatically before pushing code?

The best way to run tests before pushing is by configuring a pre-push hook using Husky. This automates test execution during the push process, preventing unverified or broken code from reaching the remote repository.

Why should I use git hooks instead of manual code formatting?

Git hooks automate enforcement so developers cannot bypass formatting and linting checks. Manual formatting relies on individual discipline, while Husky hooks guarantee consistent code quality and history validation across the entire team.