setup-pre-commit
Add formatting and lint checks before each commit
- For people who code
- Nothing to set up
What it does
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.
Instructions the AI follows
This is the skill's own instruction file. It's written for the AI, so it can read like a list of orders. You don't need to read it to use the skill.
- 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
Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun). Use whichever is present. Default to npm if unclear.
Install as devDependencies:
husky lint-staged prettiernpx husky initThis creates .husky/ dir and adds prepare: "husky" to package.json.
Write this file (no shebang needed for Husky v9+):
npx lint-staged
npm run typecheck
npm run testAdapt: Replace npm with detected package manager. If repo has no typecheck or test script in package.json, omit those lines and tell the user.
{
"*": "prettier --ignore-unknown --write"
}Only create if no Prettier config exists. Use these defaults:
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}From skills/misc/setup-pre-commit/SKILL.md in mattpocock/skills · read from GitHub at commit 5beb35b
Try it
- 1Add setup-pre-commit to your AI
- 2Ask for something like this
Set up Husky pre-commit hooks with Prettier, type checking and tests in this project.
Add lint-staged so only changed files get formatted on commit.
Make commits fail if the types don't check.
Example prompts written from the skill's instructions.
Safety
SafeDetails
All three scanners ran and found nothing that could steal your data or hijack your AI.
What it can do- Runs commands on your computer
- Scanners
- SkillSpector 2.12.0 · HoneyBadger 0.8.1 · agentscan 1.2.2
- Version scanned
5beb35bmattpocock/skills/skills/misc/setup-pre-commit- Scanned on
- Nov 10, 2026
- Raw reports
- full report skillspector honeybadger agentscan
- Secret scanPassed
- Dangerous commandsNoticed
SkillSpector: RP1 MEDIUM SKILL.md:32 MCP server referenced without pinned version: 'npx husky'.SkillSpector: RP1 MEDIUM SKILL.md:42 MCP server referenced without pinned version: 'npx lint-staged'.SkillSpector: RP1 MEDIUM SKILL.md:79 MCP server referenced without pinned version: 'npx lint-staged'. - Network callsPassed
- PermissionsPassed
- Prompt injectionPassed
- LicensePassed
- MaintenancePassed
No person has signed this one off yet.
Gives explicit npx husky init and lint-staged install steps in your repo, as described.
An AI reviewer read the files and wrote this. It is not a scan, nobody approved it yet, and it never sets the label above.
Three open-source scanners (SkillSpector, HoneyBadger, agentscan) check this exact version. Heads up means it could steal your data or hijack your AI. What it can do is listed, not warned about. Scanners miss things.
How we check: only harm earns a Heads up, meaning prompt injection (OWASP LLM01) or data leaks (LLM02), in files the skill ships. Abilities like running commands (LLM06) are listed, not warned about. No AI is used for this step. OWASP
Details
- Stars
- 332kwhole repo
- Installs
- 571kon skills.sh
- Last updated
- Nov 24, 2026on GitHub
GitHub and skills.sh numbers are a snapshot from Nov 24, 2026, not live.
Community
Comments
How to add setup-pre-commit to Claude
Press Add to your AI at the top of this page and pick Claude, or do it yourself:
- Download the skill. Keep the .zip as it is.
- On Claude's skills page, click +, then Create skill, then Upload a skill.
- Pick the file you downloaded and switch the skill on.
Works on every Claude plan, Free included. Code execution and file creation need to be on in Claude's settings. How to add a skill to Claude, step by step.
In ChatGPT
Skills are on ChatGPT Business, Enterprise, Healthcare and Edu plans. Download the skill. Keep the .zip as it is. In ChatGPT, open Plugins in the sidebar, then the Skills tab, then Create, then Upload from your computer. Pick the file you downloaded. ChatGPT checks it, then it's ready. More on ChatGPT.
For AI apps and agents: the skill's instructions as plain text, at the version we scanned.