
Description
The setup-pre-commit skill sets up Husky pre-commit hooks in the current repository and connects them to lint-staged. When it runs, it detects the package manager by checking for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn) or bun.lockb (bun), and it uses npm when none is clear. It then installs the dev dependencies and configures a Husky pre-commit hook. lint-staged runs Prettier on every staged file, and the skill adds a Prettier config if the project does not have one. The hook also runs the project's typecheck and test scripts before each commit. Use it when you want to add pre-commit hooks, set up Husky, or configure lint-staged so formatting, type checking and tests run on commit. The skill's instructions are written in Chinese. It is part of the mattpocock-skills-zh-cn collection from vinvcn, and it has been installed about 5,400 times on skills.sh. Its repository has around 5,100 GitHub stars.…
Highlights
- Sets up Husky pre-commit hooks
- lint-staged runs Prettier on staged files
- Detects npm, pnpm, yarn or bun
- Adds a Prettier config if one is missing
- Runs typecheck and test scripts on commit
Ratings & Reviews
No ratings yet
Be the first to rate setup-pre-commit.
People also visit
setup-pre-commit FAQ
What does the setup-pre-commit skill do?
It sets up Husky pre-commit hooks with lint-staged, Prettier, and the project's typecheck and test scripts.
How does it pick a package manager?
It checks for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn) or bun.lockb (bun), and falls back to npm if the choice is unclear.
How do I install it?
Run npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill setup-pre-commit.
What are its security audit results?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best setup-pre-commit alternatives?
Popular alternatives to setup-pre-commit include setup-pre-commit, create-hook and commit. See all setup-pre-commit alternatives


















