Git Workflow

Rule

Commits

  • NEVERAuto-commit changes; allow review first.
  • MUSTStage and review changes before committing.
  • SHOULDUse conventional commit messages when practical.
  • SHOULDUse gh CLI for GitHub operations (PRs, issues, etc.).

Pre-commit Hooks

  • MUSTUse Husky + lint-staged for pre-commit checks.
  • MUSTlint-staged runs format only (biome format --write), not biome check. Lint and typecheck run separately on the full project.
  • SHOULDRun typecheck (tsc --noEmit) on commit for small projects, pre-push for large ones (>200 files).
  • NEVERWrite manual git stash push/pop in hooks — lint-staged handles this safely.
  • NEVERDisable hooks permanently; use --no-verify sparingly for WIP commits.

Claude Code Hooks

  • SHOULDConfigure PostToolUse hooks to run biome check --fix --unsafe on Edit/Write.
  • MUSTUse biome check --fix (combined format + lint), not separate biome format + biome lint.