Write a Git hooks setup
Set up Husky with pre-commit (lint + format), commit-msg (Conventional Commits), and pre-push (tests) hooks. Includes config files and example hook scripts.
Preview
Copy prompt
Set up automated Git hooks for a [Language] project using Husky and lint-staged. Configure a pre-commit hook that runs the linter and formatter only on staged files to keep the hook fast. Add a commit-msg hook that validates every commit message against the Conventional Commits specification and rejects non-conforming messages with a helpful error and example. Add a pre-push hook that runs the full test suite before any push to a remote. Show the complete Husky configuration, the package.json scripts, and an example of each hook script.
More
Git & Version Control
Prompts
