pre-commit

Configure Git pre-commit hooks for multi-language projects.

3|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/HouseGarofalo/claude-code-base --skill pre-commit-housegarofalo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit
Source: https://github.com/HouseGarofalo/claude-code-base/tree/main/.claude/skills/pre-commit
Command: npx skills add https://github.com/HouseGarofalo/claude-code-base --skill pre-commit-housegarofalo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates code quality, linting, formatting, and security checks directly within your Git workflow, ensuring code standards are met before commits are even made.

Core Features & Use Cases

  • Pre-commit Hooks: Integrates with popular hook frameworks like pre-commit (Python), husky + lint-staged (Node.js), and lefthook (Go).
  • Multi-language Support: Provides configurations for Python, JavaScript/TypeScript, Go, and Terraform projects.
  • Security Scanning: Includes hooks for detecting secrets and vulnerabilities (e.g., detect-secrets, gitleaks, trivy).
  • CI Integration: Offers examples for GitHub Actions and pre-commit.ci for consistent checks in CI environments.
  • Use Case: Ensure all Python code adheres to PEP 8, all JavaScript is linted by ESLint, and no secrets are accidentally committed, all before a commit is finalized.

Quick Start

Run pre-commit install in your repository to set up the Git hooks.

Frequently Asked Questions about pre-commit

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

FAQPage Schema
How do I automate code quality and security checks before making a Git commit?

Automate code quality checks by configuring Git pre-commit hooks using frameworks like pre-commit, husky, or lefthook. This ensures linting, formatting, and security scanning run automatically before a commit is finalized.

Can I use pre-commit hooks for both Python and JavaScript projects?

Yes, pre-commit hooks support multi-language projects including Python, JavaScript, TypeScript, Go, and Terraform. You can enforce PEP 8 for Python and run ESLint for JavaScript simultaneously within the same workflow.

How do I prevent secrets and vulnerabilities from being committed to my repository?

Prevent secret leaks by integrating security scanning hooks like detect-secrets, gitleaks, and trivy into your Git workflow. These tools automatically scan staged files for sensitive data before the commit is allowed.

What is the best way to run pre-commit checks in CI environments?

The best way to run pre-commit checks in CI is using GitHub Actions or pre-commit.ci. This ensures consistent code quality and security enforcement across local development and continuous integration pipelines.

Does this work with Go and Terraform projects?

Yes, this supports Go and Terraform projects by utilizing the lefthook framework for Go and providing specific configurations for Terraform, ensuring code standards are maintained across different infrastructure and backend languages.

How do I set up Git hooks in my repository?

Set up Git hooks by running the pre-commit install command in your repository. This automatically configures the local Git hooks to execute your defined linting and security checks on every commit attempt.