release/git-hooks
Installs husky and wires four Git hooks to enforce commit conventions and run quality gates before pushing.
| Hook | Action | Details |
|---|---|---|
| commit-msg | commitlint check | Runs commitlint --edit on the commit message |
| prepare-commit-msg | Commit wizard integration | Runs cz --hook if czg or commitizen is detected; no-op otherwise |
| pre-commit | Staged file check | Runs lint-staged if installed, or biome check --write otherwise |
| pre-push | Typecheck + tests | Runs typecheck + test (or check:turbo for Turborepo projects) |
pre-commit behavior
Section titled “pre-commit behavior”In Vite+ projects, the pre-commit hook uses vp staged
instead of lint-staged or Biome. This delegates to Vite+’s own staging pipeline.
pre-push behavior
Section titled “pre-push behavior”The pre-push hook adapts to the project setup:
| Project Type | Command |
|---|---|
| Turborepo monorepo | pnpm check:turbo (or equivalent) |
| TypeScript (non-Turbo) | pnpm typecheck && pnpm test |
| Other | pnpm test |
File Paths
Section titled “File Paths”Hooks are written to .husky/ by default. In Vite+ projects, they are written
to .vite-hooks/ instead.
Details
Section titled “Details”| Property | Value |
|---|---|
| Task ID | release/git-hooks |
| Group | Release |
| Scope | Root (monorepo root only) |
| Applicable When | Always |
| Config Targets | .husky/commit-msg, .husky/prepare-commit-msg, .husky/pre-commit, .husky/pre-push |
| Dependency | husky (dev) - skipped in Vite+ projects |