setup-pre-commit

Automate Husky pre-commit hook setup with lint-staged for Prettier, type checking, and testing.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the setup of Husky pre-commit hooks, making it easy to implement linting, type checking, and testing in a repository.

Core Features & Use Cases

  • Automated Hook Setup: Simplifies the process of adding Husky pre-commit hooks.
  • Linting Support: Integrates Prettier for code formatting.
  • Type Checking & Testing: Sets up scripts for type checking and testing to ensure code quality.
  • Use Case: When a developer wants to ensure that their code is linted, typed, and tested before committing.

Quick Start

Run the 'setup-pre-commit' skill to automatically set up Husky pre-commit hooks in 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 Husky pre-commit hooks for linting and testing?

You can automate Husky pre-commit hooks by running the setup script, which configures lint-staged to run Prettier formatting, type checking, and testing before code is committed to your repository.

What do I need to set up pre-commit hooks with Husky and lint-staged?

To set up pre-commit hooks, your repository requires Husky, lint-staged, and Prettier installed, along with optional type checking or testing scripts already configured in your project environment.

Can I use Prettier and type checking together in a pre-commit hook?

Yes, you can use Prettier and type checking together by integrating them through lint-staged. The setup configures pre-commit hooks to run formatting, type validation, and testing sequentially before allowing a commit.

When do I need to configure pre-commit hooks in my repository?

You need to configure pre-commit hooks when code quality and formatting are crucial for your project, ensuring that every developer's code is automatically linted, type checked, and tested prior to committing changes.

Does Husky pre-commit hook setup work with existing testing scripts?

Yes, the Husky pre-commit hook setup works with existing testing scripts. It integrates your current type checking and testing commands into the lint-staged configuration to execute them automatically on commit.