setup-pre-commit

Automates Husky and lint-staged setup for JavaScript/TypeScript projects.

40|9|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/akillness/jeo-skills --skill setup-pre-commit-akillness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/akillness/jeo-skills/tree/main/.agent-skills/setup-pre-commit
Command: npx skills add https://github.com/akillness/jeo-skills --skill setup-pre-commit-akillness

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates pre-commit quality checks to ensure code is formatted, typed, and tested before commits.

Core Features & Use Cases

  • Automatically sets up pre-commit hooks for formatting (Prettier), type checking, and tests.
  • Adapts to npm, yarn, pnpm, or bun installations and existing project configurations.
  • Gracefully handles missing scripts or partial configurations to avoid breaking projects.

Quick Start

Run this skill in a Node.js project to install and configure Husky and lint-staged for pre-commit hooks.

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

Automating pre-commit checks involves configuring Husky and lint-staged to run formatting, type checking, and tests automatically before code is committed. This ensures code quality by validating changes locally.

Does Husky and lint-staged work with pnpm or bun?

Yes, Husky and lint-staged work with pnpm and bun. The setup automatically adapts to npm, yarn, pnpm, or bun installations, detecting the active package manager to configure pre-commit hooks correctly.

What happens if my project is missing test scripts when setting up git hooks?

When setting up git hooks, the configuration gracefully handles missing scripts or partial configurations to avoid breaking projects. It adapts to existing setups and skips unavailable quality checks without failing.

How do I configure Husky to run Prettier before committing?

To run Prettier before committing, Husky is configured alongside lint-staged to trigger formatting, type checking, and tests on staged files. This automates quality checks directly within the git workflow.

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

Using lint-staged ensures checks run only on staged files, making the process faster than manual execution. It enforces consistent formatting, type checking, and tests, preventing unformatted code from entering the repository.