pre-commit-setup

Install Husky and configure lint-staged for staged-file checks.

15|5|Updated May 17, 2026
One-click install
npx skills add https://github.com/cropsgg/skills --skill pre-commit-setup-cropsgg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit-setup
Source: https://github.com/cropsgg/skills/tree/main/skills/productivity/pre-commit-setup
Command: npx skills add https://github.com/cropsgg/skills --skill pre-commit-setup-cropsgg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill reduces failed commits by enforcing code quality gates (lint, format, and typecheck) before changes enter the repository, saving time in CI and review cycles.

Core Features & Use Cases

  • Automated hook installation: Detects stack (Node or Python) and installs Husky along with lint-staged.
  • Deterministic pre-commit flow: Configures staged-file linting and format checks while preserving project context.
  • Documentation and safety: Documents how to skip hooks in emergencies and provides a safe, reversible setup.

Quick Start

Install Husky and configure a fast pre-commit workflow that lints, formats, and typechecks only on staged changes.

Frequently Asked Questions about pre-commit-setup

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

FAQPage Schema
How do I set up pre-commit hooks for lint and type checks on staged files?

To set up pre-commit hooks, you need to install Husky and configure lint-staged to run lint, format, and typecheck tasks. This enforces code quality gates on staged changes before they enter the repository.

What is a deterministic pre-commit workflow and how does it work?

A deterministic pre-commit workflow configures staged-file linting and format checks while preserving project context. It ensures consistent code quality validation by running targeted checks only on changed files before a commit is finalized.

Does Husky with lint-staged work with both Node and Python projects?

Yes, the automated hook installation detects whether your project uses Node or Python. It then installs Husky alongside lint-staged to enforce format and type checks for that specific stack.

Can I skip pre-commit hooks in an emergency without breaking my repository?

Yes, the setup includes documentation on how to safely skip pre-commit hooks in emergencies. The configuration is designed to be reversible, allowing you to bypass checks when necessary without permanently altering your repository.

Why should I run lint and format checks on staged changes instead of in CI?

Running lint and format checks on staged changes via pre-commit hooks reduces failed commits and saves time. Catching typecheck and formatting errors locally provides faster feedback than waiting for CI review cycles.