setup-pre-commit

setup pre commit

mattpocock ↓ 152k
Claude Code
View source ↗

What it does

  • 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
  • [ ] .husky/pre-commit exists and is executable
  • [ ] .lintstagedrc exists
  • [ ] prepare script in package.json is "husky"

Requirements & configuration

  • Husky v9+ doesn't need shebangs in hook files

Derived from the skill's own SKILL.md documentation · extracted 2026-07-23

setup pre commit

Source

Repository: https://github.com/mattpocock/skills

setup-pre-commit FAQ

What does the setup-pre-commit skill do?

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing. Husky pre-commit hook lint-staged running Prettier on all staged files

What does setup-pre-commit require?

Husky v9+ doesn't need shebangs in hook files

How do I install setup-pre-commit?

Run: npx -y skills add https://github.com/mattpocock/skills --skill setup-pre-commit --agent claude-code — the source lives at github.com/mattpocock/skills.

Maintain setup-pre-commit?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

setup-pre-commit on getagentictools
[![setup-pre-commit on getagentictools](https://getagentictools.com/badge/skills/mattpocock-skills-setup-pre-commit.svg)](https://getagentictools.com/skills/mattpocock-skills-setup-pre-commit?ref=badge)
npx agentictools info skills/mattpocock-skills-setup-pre-commit

The second line is the CLI lookup for this page — handy in READMEs and docs.