pre-commit-checks

Automates Pre-Start checks for JavaScript, ensuring type safety and linting pass before commit.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/kabaka/cpap-analyzer --skill pre-commit-checks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit-checks
Source: https://github.com/kabaka/cpap-analyzer/tree/main/.github/skills/pre-commit-checks
Command: npx skills add https://github.com/kabaka/cpap-analyzer --skill pre-commit-checks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the pre-commit quality checks to prevent broken commits and flaky CI by ensuring code meets lint, type, and test standards before being committed.

Core Features & Use Cases

  • Lint-staged integration to format and lint staged files.
  • Type-checking with TypeScript to catch type errors early.
  • Unit test verification with Vitest to ensure new changes pass tests locally.

Quick Start

Install dependencies and run the local pre-commit flow to verify your changes.

Frequently Asked Questions about pre-commit-checks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run pre-commit checks for TypeScript, ESLint, and Vitest?

To run pre-commit checks, you use lint-staged to format and lint staged files, run TypeScript type checks, and execute Vitest unit tests on staged changes to ensure code quality locally.

Why does my pre-commit hook fail during lint-staged execution?

Your pre-commit hook fails during lint-staged execution due to linting errors, TypeScript type mismatches, or failing Vitest unit tests, which you can resolve using the provided troubleshooting steps and standardized diagnostics.

How do I automate TypeScript type checking on staged files before committing?

You automate TypeScript type checking on staged files by configuring pre-commit hooks with lint-staged, catching type errors early to prevent broken commits and flaky CI pipelines.

Can I use Vitest unit tests to validate staged changes locally?

Yes, you can use Vitest unit tests to validate staged changes locally by integrating them into your pre-commit hooks, ensuring new changes pass tests before being committed to the repository.

What is the best way to prevent broken commits in a local repository?

The best way to prevent broken commits is to enforce deterministic pre-commit quality checks, including lint-staged formatting, TypeScript type checking, and Vitest unit tests, with clear failure diagnostics.