setup-pre-commit

Configure Husky and lint-staged pre-commit hooks for linting, type checking, and tests.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Lev-it/lev-skills --skill setup-pre-commit-lev-it
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/Lev-it/lev-skills/tree/main/.claude/skills/setup-pre-commit
Command: npx skills add https://github.com/Lev-it/lev-skills --skill setup-pre-commit-lev-it

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps manage code quality and reduce merge conflicts by setting up pre-commit hooks with lint-staged, type checking, and tests.

Core Features & Use Cases

  • Pre-commit Hooks: Integrates Husky and lint-staged for formatting and linting on commit.
  • Type Checking: Executes type checking scripts.
  • Testing: Runs test scripts to ensure code quality.
  • Use Case: For developers aiming to maintain code quality standards and automate code reviews.

Quick Start

Initialize Husky and set up pre-commit hooks with lint-staged, type checking, and tests.

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 for linting and type checking?

Set up pre-commit hooks by integrating Husky and lint-staged to automate formatting, linting, type checking, and testing. This enforces code quality standards and streamlines the commit process with automated checks before code is committed.

What is the best way to automate code quality checks before committing?

Automating code quality checks is best achieved using Husky with lint-staged. This combination runs targeted formatting, linting, type checking, and tests on staged files, reducing merge conflicts and ensuring only validated code gets committed.

Can I use Husky and lint-staged to run tests on staged files?

Yes, you can use Husky and lint-staged to run tests on staged files. This Skill configures pre-commit hooks to execute test scripts alongside linting and type checking, ensuring code quality standards are met before the commit finalizes.

Does pre-commit type checking work with TypeScript and Prettier?

Pre-commit type checking works seamlessly with TypeScript and Prettier. The setup configures Husky and lint-staged to execute TypeScript type checking and Prettier formatting, automating code reviews and maintaining standards during the commit process.

Why should I use lint-staged instead of running scripts manually?

Use lint-staged instead of manual scripts to streamline commit time and enforce code quality. Lint-staged runs automated checks only on staged files, preventing unverified code from entering the repository and reducing merge conflicts without slowing down development.

When do I need pre-commit hooks for my codebase?

You need pre-commit hooks when aiming to maintain code quality standards and automate code reviews. Setting up Husky with lint-staged ensures formatting, type checking, and testing execute automatically, catching errors before they cause merge conflicts.