Browse / Security Testing / Pre-Commit Validator

Pre-Commit Validator

Automates pre-commit checks for TypeScript type safety, test execution, code coverage, and Git branch compliance.

SkillSecurity TestingUnit TestingComplianceGithub

The source repository doesn't declare a license. Check its terms before reusing the code.

Key features

  • Provides clear success or failure reports with actionable feedback
  • Executes the Jest test suite and validates code coverage against an 80% project threshold
  • Verifies compliance with Git branch strategy, preventing direct commits to main or master
  • Enforces TypeScript type safety by running the compiler in check mode
  • Automates a multi-step validation workflow for pre-commit checks

Use cases

  • Running a full suite of project-specific checks before pushing to a remote repository.
  • Ensuring new contributions meet project standards for type safety and testing.
  • Validating code quality and readiness before committing changes.

FAQ

How does this skill improve my workflow?

It saves time by automating tedious manual checks. By catching errors, test failures, and policy violations early, it prevents broken builds and ensures only high-quality code is committed, improving overall project stability.

What specific checks does this skill perform?

The skill runs four key checks: 1) TypeScript type safety, 2) Jest test suite execution, 3) Code coverage validation against an 80% minimum, and 4) Git branch compliance to prevent commits to main/master.

What does the Pre-Commit Validator skill do?

It automates a multi-step pre-commit validation process. It checks for TypeScript errors, runs all tests, verifies code coverage meets an 80% threshold, and ensures you aren't committing directly to a protected branch like 'main'.

When should I use this skill?

Use this skill right before you commit your code. You can ask Claude to "run pre-commit checks" to ensure your changes meet all project quality standards before they are added to the repository.