
Git Hooks Setup
Sets up Git hooks using Husky or pre-commit to catch issues before they hit your repo. You get pre-commit linting and formatting, commit message validation with commitlint, secret detection, and pre-push testing. The quick start gives you a basic Husky setup in under ten lines, and the reference guides cover both Node.js and Python ecosystems. The best practices are practical: keep hooks under 5 seconds, provide clear error messages, and yes, document when it's okay to use --no-verify. Good for enforcing team standards without becoming the code police.
- skills.sh installs
- 450
- GitHub stars
- 379
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill git-hooks-setup --agent claude-codeInstalls into .claude/skills of the current project.
Files
Git Hooks Setup
Table of Contents
Overview
Configure Git hooks to enforce code quality standards, run automated checks, and prevent problematic commits from being pushed to shared repositories.
When to Use
- Pre-commit code quality checks
- Commit message validation
- Preventing secrets in commits
- Running tests before push
- Code formatting enforcement
- Linting configuration
- Team-wide standards enforcement
Quick Start
Minimal working example:
#!/bin/bash
# setup-husky.sh
# Install Husky
npm install husky --save-dev
# Initialize Husky
npx husky install
# Create pre-commit hook
npx husky add .husky/pre-commit "npm run lint"
# Create commit-msg hook
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
# Create pre-push hook
npx husky add .husky/pre-push "npm run test"
# Create post-merge hook
npx husky add .husky/post-merge "npm install"
Reference Guides
Detailed implementations in the references/ directory:
Sponsors
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Frontend Development, Testing & QA, Git & Pull Requests, Code Review & Quality, AI & Agent Building
- First seen
- Jun 3, 2026
More from aj-geddes/useful-ai-prompts
All 258- Cloud Storage Optimization449
- Performance Regression Debugging449
- Secrets Management449
- Configuration Management448
- Alert Management447
- Cloud Cost Management447
- Troubleshooting Guide447
- Vue Application Structure447
- Database Sharding446
- Network Security Groups446
- Azure App Service445
- Feature Flag System445
- Infrastructure Cost Optimization445
- Capacity Planning444
- Container Registry Management444
- Third Party Integration443
- Continuous Testing441
- Dependency Tracking440
- Artifact Management439
- Graceful Shutdown439
- Blue Green Deployment437
- Disaster Recovery Testing437
- Release Planning436
- Intermittent Issue Debugging433