PreCommit
A comprehensive skill for managing pre-commit hooks - the framework for multi-language pre-commit hook management that automates code quality, formatting, linting, and security scanning.
Quick Reference
| Command |
Description |
pre-commit install |
Install git hooks |
pre-commit run --all-files |
Run all hooks on all files |
pre-commit autoupdate |
Update hooks to latest versions |
pre-commit run <hook-id> |
Run specific hook |
Workflow Routing
| Workflow |
Trigger |
File |
| Setup |
"setup pre-commit", "initialize hooks", "create config" |
Workflows/Setup.md |
| AddHooks |
"add hook", "add linting", "add formatter", "add security" |
Workflows/AddHooks.md |
| Troubleshoot |
"fix pre-commit", "hook failing", "debug hooks" |
Workflows/Troubleshoot.md |
| CIIntegration |
"CI pipeline", "GitHub Actions", "GitLab CI" |
Workflows/CIIntegration.md |
| CustomHook |
"create custom hook", "local hook", "write hook" |
Workflows/CustomHook.md |
Documentation
| Document |
Purpose |
QuickStartGuide.md |
Installation and first-time setup |
HooksReference.md |
Comprehensive hook catalog by language/purpose |
ConfigurationGuide.md |
Advanced configuration options |
SecurityHooks.md |
Secret detection and security scanning |
Tools
| Tool |
Purpose |
Tools/PreCommitManager.ts |
CLI for managing pre-commit configurations |
Tools/HookGenerator.ts |
Generate .pre-commit-config.yaml templates |
Tools/HookValidator.ts |
Validate hook configurations |
Examples
Example 1: Setup pre-commit for a new project
User: "Setup pre-commit for my Python project"
→ Invokes Setup workflow
→ Creates .pre-commit-config.yaml with Python hooks (black, isort, flake8)
→ Runs pre-commit install
Example 2: Add Terraform hooks
User: "Add Terraform validation hooks"
→ Invokes AddHooks workflow
→ Adds terraform_fmt, terraform_validate, terraform_docs hooks
→ Configures tflint and checkov integration
Example 3: Add security scanning
User: "Add secret detection to pre-commit"
→ Invokes AddHooks workflow
→ Adds gitleaks, detect-secrets, trufflehog hooks
→ Configures appropriate exclusion patterns
Example 4: Debug failing hook
User: "My eslint pre-commit hook is failing"
→ Invokes Troubleshoot workflow
→ Checks hook configuration and dependencies
→ Provides fix recommendations
Supported Hook Categories
- Python: black, isort, flake8, mypy, bandit, pyupgrade
- JavaScript/TypeScript: prettier, eslint, biome
- Infrastructure: terraform, terragrunt, helm, kustomize
- Kubernetes: kubeconform, kubeval, checkov
- Security: gitleaks, detect-secrets, trufflehog, trivy
- General: yamllint, jsonlint, shellcheck, markdownlint
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: precommit-33description: Pre-commit hooks framework for multi-language code quality automation. USE WHEN setting up pre-commit OR configuring git hooks OR adding linting OR code formatting OR security scanning OR Terraform validation OR Kubernetes manifests OR Helm charts OR Python linting OR JavaScript formatting. Manages .pre-commit-config.yaml, hook installation, and CI integration. Use when this capability is needed.4---56# PreCommit78A comprehensive skill for managing [pre-commit](https://pre-commit.com/) hooks - the framework for multi-language pre-commit hook management that automates code quality, formatting, linting, and security scanning.910## Quick Reference1112| Command | Description |13|---------|-------------|14| `pre-commit install` | Install git hooks |15| `pre-commit run --all-files` | Run all hooks on all files |16| `pre-commit autoupdate` | Update hooks to latest versions |17| `pre-commit run <hook-id>` | Run specific hook |1819## Workflow Routing2021| Workflow | Trigger | File |22|----------|---------|------|23| **Setup** | "setup pre-commit", "initialize hooks", "create config" | `Workflows/Setup.md` |24| **AddHooks** | "add hook", "add linting", "add formatter", "add security" | `Workflows/AddHooks.md` |25| **Troubleshoot** | "fix pre-commit", "hook failing", "debug hooks" | `Workflows/Troubleshoot.md` |26| **CIIntegration** | "CI pipeline", "GitHub Actions", "GitLab CI" | `Workflows/CIIntegration.md` |27| **CustomHook** | "create custom hook", "local hook", "write hook" | `Workflows/CustomHook.md` |2829## Documentation3031| Document | Purpose |32|----------|---------|33| `QuickStartGuide.md` | Installation and first-time setup |34| `HooksReference.md` | Comprehensive hook catalog by language/purpose |35| `ConfigurationGuide.md` | Advanced configuration options |36| `SecurityHooks.md` | Secret detection and security scanning |3738## Tools3940| Tool | Purpose |41|------|---------|42| `Tools/PreCommitManager.ts` | CLI for managing pre-commit configurations |43| `Tools/HookGenerator.ts` | Generate .pre-commit-config.yaml templates |44| `Tools/HookValidator.ts` | Validate hook configurations |4546## Examples4748**Example 1: Setup pre-commit for a new project**49```50User: "Setup pre-commit for my Python project"51→ Invokes Setup workflow52→ Creates .pre-commit-config.yaml with Python hooks (black, isort, flake8)53→ Runs pre-commit install54```5556**Example 2: Add Terraform hooks**57```58User: "Add Terraform validation hooks"59→ Invokes AddHooks workflow60→ Adds terraform_fmt, terraform_validate, terraform_docs hooks61→ Configures tflint and checkov integration62```6364**Example 3: Add security scanning**65```66User: "Add secret detection to pre-commit"67→ Invokes AddHooks workflow68→ Adds gitleaks, detect-secrets, trufflehog hooks69→ Configures appropriate exclusion patterns70```7172**Example 4: Debug failing hook**73```74User: "My eslint pre-commit hook is failing"75→ Invokes Troubleshoot workflow76→ Checks hook configuration and dependencies77→ Provides fix recommendations78```7980## Supported Hook Categories8182- **Python**: black, isort, flake8, mypy, bandit, pyupgrade83- **JavaScript/TypeScript**: prettier, eslint, biome84- **Infrastructure**: terraform, terragrunt, helm, kustomize85- **Kubernetes**: kubeconform, kubeval, checkov86- **Security**: gitleaks, detect-secrets, trufflehog, trivy87- **General**: yamllint, jsonlint, shellcheck, markdownlint8889---90> Converted and distributed by [TomeVault](https://tomevault.io/claim/julianobarbosa) — claim your Tome and manage your conversions.91<!-- tomevault:4.0:skill_md:2026-04-11 -->