pre-commit

Block git commits when Python lint, tests, or security checks fail.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a guarded, automated gate that blocks commits when critical quality checks fail, ensuring only compliant code reaches the shared repository.

Core Features & Use Cases

  • Deterministic checks: runs Python linting, import validation, and a quick test suite on changed files.
  • Security and integrity: performs a fast security scan and audit-chain verification to prevent secrets leakage or tampering.
  • Use Case: integrate into any git workflow to automatically halt non-compliant commits during development or PRs.

Quick Start

Install and enable the pre-commit hook in your repository, then commit to automatically run the quality checks before every commit.

Frequently Asked Questions about pre-commit

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

FAQPage Schema
How do I block git commits when Python linting or tests fail?

A pre-commit quality gate runs lint, import validation, fast tests, security scans, and audit chain validation on changed files, blocking any git commit that fails these critical checks.

How do I prevent secrets leakage during a git commit?

To prevent secrets leakage during a git commit, configure a pre-commit hook to perform a fast security scan and audit-chain verification on your changed files before allowing the commit to proceed.

Can I run pytest on changed files automatically before committing?

Yes, you can run pytest automatically on changed files by integrating a pre-commit hook that executes a quick test suite as part of its deterministic checks, blocking the commit if tests fail.

Does the pre-commit quality gate work with existing Python git workflows?

Yes, the pre-commit quality gate integrates into any Python git workflow to automatically halt non-compliant commits during local development or pull requests by running deterministic tool-driven checks.

What happens when a security scan fails during pre-commit?

When a security scan fails during pre-commit, the deterministic gate blocks the code commit, ensuring only compliant code that passes the audit-chain verification reaches the shared repository.