Implement Git hooks using Husky, pre-commit, and custom scripts. Enforce code quality, linting, and testing before commits and pushes.
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-verifySearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer