setup-pre-commit

Automate pre-commit hook setup with Husky, lint-staged, and Prettier.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mnadalc/dotfiles --skill setup-pre-commit-mnadalc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/mnadalc/dotfiles/tree/main/.ai/project-specific-skills/setup-pre-commit
Command: npx skills add https://github.com/mnadalc/dotfiles --skill setup-pre-commit-mnadalc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires husky, lint-staged, prettier, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the setup of pre-commit hooks using Husky and lint-staged, ensuring code quality and consistency before commits are even made.

Core Features & Use Cases

  • Husky Initialization: Sets up Husky for managing Git hooks.
  • lint-staged Configuration: Integrates lint-staged to run linters and formatters on staged files.
  • Prettier Integration: Automatically formats staged code with Prettier.
  • Type Checking & Testing: Includes commands to run type checks and tests as part of the commit process.
  • Use Case: When starting a new project or onboarding a new developer, use this Skill to quickly establish a robust commit-time code quality workflow.

Quick Start

Run the setup-pre-commit skill to add Husky, lint-staged, and Prettier to your project.

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 with Husky and lint-staged?

Automating pre-commit hooks with Husky and lint-staged ensures code quality by running linters and formatters on staged files before they are committed. This tool manages package manager detection, dependency installation, and configuration file creation automatically.

Can I use Prettier to automatically format staged code before committing?

Integrating Prettier with lint-staged automatically formats staged code during the pre-commit workflow. This ensures code consistency and quality by running formatting checks on staged files before they are committed.

Does Husky support running type checks and tests in git hooks?

Husky supports running type checks and tests by executing them within the pre-commit hook configuration. This integrates type checking and testing directly into your commit workflow to prevent breaking changes from entering the repository.

What is the best way to automate code quality checks for JavaScript and TypeScript projects?

Setting up pre-commit hooks using Husky and lint-staged is a highly effective way to automate code quality checks for JavaScript and TypeScript projects. This approach runs linting, formatting, type checking, and testing on staged files, ensuring consistency before commits are made.

Do I need to manually configure lint-staged for different package managers?

Manual configuration of lint-staged for different package managers is unnecessary because this tool manages package manager detection automatically. It handles dependency installation and configuration file creation to provide a seamless setup experience.