setup-pre-commit
Installation
SKILL.md
Setup Pre-Commit Hooks
Pre-loaded context
Before proceeding, use the Read tool to read package.json, and Glob tool to detect:
- Lock file:
package-lock.json,pnpm-lock.yaml,yarn.lock,bun.lockb - Prettier config:
.prettierrc,.prettierrc.*,prettier.config.*
What This Sets Up
- Husky pre-commit hook
- lint-staged running Prettier on all staged files
- Prettier config (if missing)
- typecheck and test scripts in the pre-commit hook (if they exist)
Workflow
- Detect package manager from lock file:
package-lock.json(npm),pnpm-lock.yaml(pnpm),yarn.lock(yarn),bun.lockb(bun). Default to npm if unclear.