setup-pre-commit

Configure Husky pre-commit hooks with lint-staged and Prettier.

46|7|Updated Oct 12, 2025
One-click install
npx skills add https://github.com/adriannoes/awesome-vibe-coding --skill setup-pre-commit-adriannoes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/adriannoes/awesome-vibe-coding/tree/main/cursor-and-claude/skills/matt-pocock/misc/setup-pre-commit
Command: npx skills add https://github.com/adriannoes/awesome-vibe-coding --skill setup-pre-commit-adriannoes

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the setup of pre-commit hooks for code quality and consistency, reducing manual configuration efforts.

Core Features & Use Cases

  • Configures Husky pre-commit hooks to run lint-staged, type checks, and tests automatically before commits.
  • Installs and initializes dependencies like Husky, lint-staged, and Prettier based on your project's package manager.
  • Use Case: Developers aiming to enforce code standards and catch errors early by automatically running formatting, type checks, and tests during commit.

Quick Start

Use the setup-pre-commit skill to automatically configure pre-commit hooks for your existing repository.

Frequently Asked Questions about setup-pre-commit

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

FAQPage Schema
How do I set up pre-commit hooks to automatically format code with Prettier?

Pre-commit hooks automate code formatting by configuring Husky to run lint-staged and Prettier before changes are committed. This ensures consistent code style and catches errors early across your software repository.

Can I use Husky pre-commit hooks with pnpm or bun package managers?

Yes, pre-commit hooks work with pnpm and bun. The setup automatically detects your project's package manager to install and initialize Husky, lint-staged, and Prettier dependencies correctly for npm, yarn, pnpm, or bun.

What is the best way to automate linting and type checks before a Git commit?

The best way to automate linting and type checks before a commit is using Husky pre-commit hooks configured to run lint-staged. This automatically executes formatting, type checks, and tests on staged files during the commit process.

How do I configure lint-staged and Husky in an existing repository?

Configuring lint-staged and Husky in an existing repository involves initializing Husky and adding a pre-commit hook to run lint-staged. The setup verifies the configuration functions correctly with your chosen package manager.

Why do I need lint-staged to run Prettier in my pre-commit hooks?

You need lint-staged to run Prettier in pre-commit hooks because it executes formatting and linting only on staged files. This prevents slow commits by avoiding full-project processing and ensures code quality before changes are committed.