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-code

Installs 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
1davila7 avatarfrontend-to-backend-requirementsdavila7/claude-code-templatesDocument frontend data needs for backend developers. Use when frontend needs to communicate API requirements to backend, or user says 'backend requirements', 'w441skills.sh installs
2incept5 avatareve-web-ui-testing-agent-browserincept5/eve-skillpacksWeb UI testing and browser automation. Use Vercel agent-browser for general apps, or the repo-pinned Playwright wrapper inside Eve Horizon. Use when tasks requi436skills.sh installs
3sickn33 avatarreact-native-architecturesickn33/antigravity-awesome-skillsreact native architecture425skills.sh installs
4ihlamury avatarlinear-ui-skillsihlamury/design-skillsLinear's UI design system. Use when building interfaces inspired by Linear's aesthetic - dark mode, Inter font, 4px grid.417skills.sh installs
5pproenca avatarexpo-react-native-coderpproenca/dot-skillsComprehensive Expo React Native feature development guide. This skill should be used when building mobile app screens, navigation, data fetching, authentication415skills.sh installs
6secondsky avatarnuxt-serversecondsky/claude-skills| Nuxt 4 server-side development with Nitro: API routes, server middleware, database integration, and backend patterns. Use when: creating server API routes, im415skills.sh installs