From aj-geddes-useful-ai-prompts-4
Configures Git hooks with Husky, pre-commit, and custom scripts to enforce code quality, linting, and testing before commits and pushes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:git-hooks-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Configure Git hooks to enforce code quality standards, run automated checks, and prevent problematic commits from being pushed to shared repositories.
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"
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Husky Installation and Configuration | Husky Installation and Configuration |
| Pre-commit Hook (Node.js) | Pre-commit Hook (Node.js) |
| Commit Message Validation | Commit Message Validation |
| Commitlint Configuration | Commitlint Configuration, Pre-push Hook (Comprehensive) |
| Pre-commit Framework (Python) | Pre-commit Framework (Python) |
| Secret Detection Hook | Secret Detection Hook, Husky in package.json |
--no-verify (rarely)--no-verifynpx claudepluginhub aj-geddes/useful-ai-promptsSets up Git hooks with Husky, lint-staged, pre-commit framework, and commitlint to automate code quality gates, formatting, linting, and commit message enforcement before code reaches CI.
Configures pre-commit or prek git hooks for code quality automation, formatting, linting, and commit message processing across multi-language projects.
Guides configuring pre-commit hooks to run automated checks before commits. Useful for enforcing code quality and consistency in git workflows.