setup-pre-commit
Installation
SKILL.md
Setup Pre-Commit Hooks
What This Sets Up
- Husky pre-commit hook
- lint-staged 对所有 staged files 运行 Prettier
- Prettier config(如果缺失)
- pre-commit hook 中的 typecheck 和 test scripts
Steps
1. Detect package manager
检查 package-lock.json (npm)、pnpm-lock.yaml (pnpm)、yarn.lock (yarn)、bun.lockb (bun)。使用存在的那个。不清楚时默认 npm。
2. Install dependencies
作为 devDependencies 安装: