Setup Pre-Commit (Matt Pocock skill)
Scaffold skill that drops Husky + lint-staged + Prettier + `typecheck` and `test` scripts into the repo's `pre-commit` hook. Detects your package manager (npm, pnpm, yarn, bun), installs deps, inits Husky, writes `.husky/pre-commit`, `.lintstagedrc`, and `.prettierrc` if missing. Run once, the hook runs on every commit thereafter.
Strengths
- Auto-detect package manager, no need to think npm vs pnpm vs bun
- Sensible Prettier defaults (2 spaces, double quotes, trailing comma es5, semi)
- Skips `typecheck` and `test` if package.json lacks the scripts, no broken hook
- Final step = commit that runs the hook itself, smoke test included
Limitations
- Prettier opinions are baked in, if you use Biome (like Coeurdar) you either skip .prettierrc or adapt
- Runs `typecheck` + `test` on EVERY commit, on a big repo it's real friction (Coeurdar itself skips tests for that reason)
- Husky v9+ only, repos on Husky v8 must migrate manually
Best for
- Bootstrap of a fresh repo that wants local CI without thinking
- Devs who push un-Prettier-ed code and want to stop without a team debate
- Side-projects where format rigour matters more than tooling debate