setup-pre-commit

Configure Husky pre-commit hooks with lint-staged, Prettier, type checking, and tests.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/nseluga/os --skill setup-pre-commit-nseluga
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-pre-commit
Source: https://github.com/nseluga/os/tree/main/skills/setup-pre-commit
Command: npx skills add https://github.com/nseluga/os --skill setup-pre-commit-nseluga

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the problem of setting up pre-commit hooks for code quality in a repository, ensuring that code is linted, formatted, and tested before being committed.

Core Features & Use Cases

  • Automated Code Quality Checks: Ensures code quality by running linters, formatters, and tests on commit.
  • Husky Integration: Sets up Husky pre-commit hooks for a streamlined workflow.
  • Customizable: Allows for customization of the scripts run by Husky.
  • Use Case: Use this Skill to set up a pre-commit hook that runs Prettier for formatting, type checking, and tests before each commit.

Quick Start

Run the skill to set up Husky 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 set up Husky pre-commit hooks for code quality checks?

To set up Husky pre-commit hooks for code quality, this Skill installs and configures Husky, lint-staged, and Prettier to automatically run linters, formatters, type checking, and tests before each commit is finalized.

What do pre-commit hooks do and when do I need them in my repository?

Pre-commit hooks enforce code quality standards by running automated checks before code is committed. You need them to ensure code is linted, properly formatted, and tested, preventing broken or unformatted code from entering your repository.

Can I customize the scripts Husky runs for lint-staged and Prettier?

Yes, the Husky pre-commit setup is customizable and allows you to modify the specific scripts run by Husky. You can adapt the lint-staged configuration and Prettier formatting rules to fit your project's testing and type checking requirements.

Does this pre-commit configuration work with lint-staged and Prettier?

Yes, this pre-commit configuration works directly with lint-staged and Prettier. It integrates these dependencies to ensure type checking and automated testing are performed on commit, delivering consistent code formatting across your project.

What is the best way to automate code formatting and testing on commit?

The best way to automate code formatting and testing on commit is by using Husky pre-commit hooks combined with lint-staged. This approach runs Prettier for formatting and executes type checking and tests before allowing a commit to succeed.