setup-pre-commit

Configure Husky pre-commit hooks and lint-staged for JavaScript and TypeScript projects.

45|2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/hachej/boring-ui --skill setup-pre-commit-hachej
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/hachej/boring-ui/tree/main/.agents/skill-library/miscellaneous/setup-pre-commit
Command: npx skills add https://github.com/hachej/boring-ui --skill setup-pre-commit-hachej

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires husky, lint-staged, prettier.

What problem does it solve?

This Skill eliminates the manual overhead of ensuring code quality by automating the enforcement of linting, type checking, and testing before every commit.

Core Features & Use Cases

  • Automated Quality Gates: Integrates Husky and lint-staged to run checks only on changed files, ensuring fast feedback loops.
  • Standardized Formatting: Automatically applies Prettier configuration to maintain consistent code style across the entire team.
  • Use Case: Use this when you want to prevent broken code or unformatted files from entering your repository history by setting up a robust pre-commit pipeline.

Quick Start

Run the setup-pre-commit skill to initialize Husky and lint-staged in the current 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 automate code quality checks with pre-commit hooks in a JavaScript project?

Setting up pre-commit hooks involves configuring Husky and lint-staged to intercept git commits. This Skill automates that setup by installing the required development dependencies and generating configuration files for Prettier, type checking, and test suites.

What does lint-staged do when integrated with Husky pre-commit hooks?

Lint-staged runs checks only on changed files staged in git, ensuring fast feedback loops. When integrated with Husky pre-commit hooks, it automatically executes Prettier formatting, type checking, and test suites on those specific files before the commit is finalized.

Can I use this pre-commit setup to enforce Prettier formatting across my team?

Yes, this pre-commit setup enforces Prettier formatting across your team by applying standard configuration automatically. By integrating these checks into the git commit process via Husky, it prevents unformatted files and inconsistent code styles from entering the repository history.

Do I need to manually install Husky and lint-staged before running this setup?

No, manual installation is not required. This Skill manages the installation of development dependencies like Husky, lint-staged, and Prettier, while also creating the configuration files needed to activate the pre-commit pipeline in your current repository.

Why should I use Husky and lint-staged instead of running tests manually before commits?

Using Husky and lint-staged eliminates the manual overhead of ensuring code quality by automating enforcement before every commit. Running checks only on staged files provides fast feedback, preventing broken code and unformatted files from entering your repository history.