Pre-commit hook setter
Point it at your repo. Get checks for formatting, types and tests that run before every commit.
Pre-commit hook setter is a free AI skill for the job "Test and fix code". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · MIT licence · Made by Matt Pocock · Thinking: low
Made by Matt Pocock. See the original on GitHub; we copied it as it is, with its licence.
What it does
Checks that run on their own before every commit, so broken or messy code never reaches your repo. You point the skill at your project and it wires everything up. It detects whether you use npm, pnpm, yarn or bun, installs Husky, lint-staged and Prettier, and creates a Prettier config if you lack one. It then writes the pre-commit hook so staged files are formatted, types are checked and tests run. Your package.json scripts are added or reused. You need a Node project with a package.json. You can commit once to see it work.
You give it
- A Node project folder
- Preferred package manager (optional)
- Test and type-check commands (optional)
You get
- Husky pre-commit hook
- lint-staged and Prettier setup
- Typecheck and test scripts
- Short notes on how to use it
Use it when
- Teammates keep committing unformatted code.
- Type errors reach the main branch.
- You want tests to run before anything is saved to history.
- You just started a Node project and want good habits early.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run code and read your project files.