setup-pre-commit

Installation
SKILL.md

Set up pre-commit hooks

What you end up with

  • A Husky pre-commit hook
  • lint-staged running Prettier over the staged files
  • A Prettier config, if the repo lacks one
  • typecheck and test scripts invoked from the hook

Steps

1. Detect the package manager

Look for a lockfile: package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), or bun.lockb (bun). Use whichever is present, and fall back to npm when none is clear.

2. Install the dev dependencies

Add as devDependencies:

Installs
2
GitHub Stars
6
First Seen
14 days ago
setup-pre-commit — officialunofficial/skills