setup-pre-commit

Set up Husky pre-commit hooks with lint-staged, Prettier, typecheck, and tests.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/Jmarques/orford-sur-le-lac_embarcations --skill setup-pre-commit-jmarques
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/Jmarques/orford-sur-le-lac_embarcations/tree/main/.agents/skills/setup-pre-commit
Command: npx skills add https://github.com/Jmarques/orford-sur-le-lac_embarcations --skill setup-pre-commit-jmarques

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill streamlines the process of setting up Husky pre-commit hooks with lint-staged for Prettier, type checking, and tests, ensuring code quality and consistency.

Core Features & Use Cases

  • Automate Code Linting: Sets up Husky hooks to run lint-staged on all staged files for formatting and style consistency.
  • Enforce Code Standards: Implements Prettier to enforce consistent coding standards and improve readability.
  • Pre-commit Testing: Automates test and type-checking scripts in the pre-commit phase, reducing the chance of merge conflicts.
  • Use Case: Perfect for teams or individual developers who want to establish a robust code quality and testing workflow in their repositories.

Quick Start

Run the setup-pre-commit skill to install necessary dependencies and configure pre-commit hooks for your 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 pre-commit hooks for Prettier and tests in a Git repository?

You can automate pre-commit hooks by using Husky and lint-staged to run Prettier formatting, type checking, and tests on staged files before commit time. This ensures consistent coding standards automatically.

What is the best way to run lint-staged with Husky to enforce code quality?

Using Husky with lint-staged is an effective approach to enforce code quality. It automatically runs Prettier formatting and test scripts on staged files, preventing unformatted or failing code from being committed.

Do I need existing test and typecheck scripts to set up pre-commit hooks?

Yes, you need existing test and typecheck scripts in your project. The pre-commit hook setup integrates these scripts with lint-staged and Husky to execute them automatically during the commit phase.

Can I use Husky pre-commit hooks for solo developer workflows?

Yes, Husky pre-commit hooks work perfectly for solo developers. Automating Prettier formatting and testing maintains consistent coding standards and reduces merge conflicts even in individual repositories.

Why set up pre-commit testing instead of running tests manually?

Pre-commit testing automates type checking and test execution at commit time, reducing the chance of merge conflicts. It enforces code quality consistently without relying on manual intervention.

Does this pre-commit setup work with Prettier for code formatting?

Yes, the setup implements Prettier through lint-staged to enforce consistent coding standards. It formats staged files automatically before they are committed to the repository.