pre-commit

Scan staged changes for secrets, HIGH findings, and test failures.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/ToanPV90/dotfiles --skill pre-commit-toanpv90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit
Source: https://github.com/ToanPV90/dotfiles/tree/main/claude/.claude/skills/pre-commit
Command: npx skills add https://github.com/ToanPV90/dotfiles --skill pre-commit-toanpv90

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents broken code, test regressions, and accidental secrets from being committed by running staged-file checks before a commit is finalized.

Core Features & Use Cases

  • Staged secrets scan: Detects common secret patterns in staged diffs and stops the commit when a match is found.
  • Markdown linting (non-blocking): Flags markdown issues in staged files so they can be cleaned up after the commit if needed.
  • Code auditing on staged changes: Reviews only the staged files and reports HIGH severity issues that block the commit.
  • Test execution: Runs the project’s available test suite and blocks the commit on test failures.

Use case: Before committing a feature branch that touches multiple files, this gate ensures you don’t accidentally commit an API token in a config or break unit tests.

Quick Start

Run the pre-commit skill in your Claude Code workflow before issuing the commit command so the gate checks staged files and blocks unsafe changes.

Frequently Asked Questions about pre-commit

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

FAQPage Schema
How do I prevent secrets from being committed to my git repository?

Pre-commit secret scanning detects common secret patterns in staged git diffs and blocks the commit automatically when a match is found. This staged-file discovery mechanism ensures sensitive data never enters your git history.

Can I run tests and block git commits on test failures?

Yes, pre-commit test execution runs your project's available test suite and blocks the commit on test failures. This gating mechanism runs alongside secret detection and code auditing during your workflow before issuing the commit command.

How do I check staged code changes for high severity issues before committing?

Code auditing on staged changes reviews only the files in your staged diff and reports HIGH severity findings that block the commit. This code-auditor HIGH-only review prevents broken code from being committed to git.

Does markdown linting block git commits for formatting issues?

Markdown linting is advisory and non-blocking, flagging markdown issues in staged files without stopping the commit. You can clean up flagged markdown formatting after the commit is finalized, keeping your workflow smooth.

What do I need to run pre-commit checks on staged diffs in my workflow?

You need staged git changes in a project with an available test suite. Run the pre-commit skill in your Claude Code workflow before issuing the commit command so the gate checks staged files and blocks unsafe changes.