setup-pre-commit
Skill2 starsChanged 9 days agoMITView on GitHub
Set up Husky pre-commit hooks with lint-staged (Prettier) and type checking in the current repo, leaving tests to CI. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
124 other projects use a version of this, 114 of them edited.
Adopted by
Most recently taken up by
- 5thlayer/skillworksedited, first seen Nov 8, 2026
- dfirmin/compassedited, first seen Nov 8, 2026
- op3616windows/skillsedited, first seen Nov 8, 2026
- kazemcodes/skill-treeedited, first seen Nov 8, 2026
- shkodnik1917/claude-brainlabedited, first seen Nov 8, 2026
- Tresnanda/kybernedited, first seen Nov 8, 2026
Used with
Projects with it also use migrate-to-shoehorn, writing-beats and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
simo97Skillmigrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Also in 73 projects that use this
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 63 projects that use this
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 41 projects that use this
LesaniSkillwriting-shape
Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
Also in 63 projects that use this
simo97Skilledit-article
The user will invoke this skill to help them edit an article.
Also in 38 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 52 projects that use this
- +3 more from simo97
- +1 more from Lesani
Other versions124 projects use a version of this.
Word for word · 0
None found.
Edited · 114
- mattpocock/skills★ 309k84% same
- vinvcn/mattpocock-skills-zh-CN★ 5.5k15% same
- devcxl/mattpocock-skills-zh★ 52216% same
- amazingloft999-droid/mattpocock-skills★ 42284% same
- InditexTech/weavejs★ 26684% same
- loulanyue/skills★ 23184% same
- tt-a1i/matt-skills-with-to-goal★ 19284% same
- aurorasoft2/Matt_Pocock_Skills★ 13384% same
- Tresnanda/kybern★ 8384% same
- VisualxIntelligence/mattpocok-skills★ 5584% same
104 more not listed
Wrote their own version · 10
- jrjsmrtn/project-orchestration-skills★ 17same name
- josortmel/EcoRelay★ 15same name
- imMamdouhaboammar/matts-skills-into-chatgpt★ 8same name
- Boom-Vitt/skills-thai★ 5same name
- chrislacey89/skills★ 4same name
- christofferbergj/agent-skills★ 1same name
- manastalukdar/ai-devstudio★ 1same name
- snowfluke/engineering-skills★ 1same name
- Thalisu/SKILLS★ 1same name
- chieaid24/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- code-commentsSkill
- dev-stackSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- prose-styleSkill
- prototypeSkill
- prSkill
- review-changesSkill
- tddSkill
- ui-designSkill
- worktreesSkill
- check-sdlcSkill
- deslopSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- refresh-specSkill
- retroSkill
- setup-sdlcSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- update-designSkill
- codebase-designSkill
- grillingSkill
- run-reportSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
3 rules. 2 are common, 0 are distinctive, and 1 is very specific to this project.
2
Common
Most of the 112 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun).
- Common: line 41
Write this file (no shebang needed for Husky v9+):
- Common: line 62
Only create if no Prettier config exists.
“Common” is measured: kept by at least 6 in 10 of the 112 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Setup Pre-Commit Hooks
What This Sets Up
- Husky pre-commit hook
- lint-staged running Prettier on all staged files
- Prettier config (if missing)
- the typecheck script in the pre-commit hook
Tests don't run on commit. A full test run on every commit slows each commit by however long the suite takes, and CI runs it anyway as the check that blocks a merge.
Steps
1. Detect package manager
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.
2. Install dependencies
Install as devDependencies:
husky lint-staged prettier3. Initialize Husky
npx husky initThis creates .husky/ dir and adds prepare: "husky" to package.json.
4. Create .husky/pre-commit
Write this file (no shebang needed for Husky v9+):
npx lint-staged
npm run typecheckAdapt: Replace npm with detected package manager. If repo has no typecheck script in package.json, omit that line and tell the user.
Then check that CI runs the test script on pull requests. If it doesn't, tell the user the tests run nowhere and offer to add a CI job, or to put npm run test in .husky/pre-push as a stopgap.
5. Create .lintstagedrc
{
"*": "prettier --ignore-unknown --write"
}6. Create .prettierrc (if missing)
Only create if no Prettier config exists. Use these defaults:
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}7. Verify
.husky/pre-commitexists and is executable.lintstagedrcexistspreparescript in package.json is"husky"prettierconfig exists- Run
npx lint-stagedto verify it works
8. Commit
Stage all changed/created files and commit with message: Add pre-commit hooks (husky + lint-staged + prettier)
This will run through the new pre-commit hooks: a good smoke test that everything works.
Notes
- Husky v9+ doesn't need shebangs in hook files
prettier --ignore-unknownskips files Prettier can't parse (images, etc.)- The pre-commit runs lint-staged first (fast, staged-only), then a full typecheck
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

