setup-pre-commit
Skill1 starsChanged 5 months agoMITView on GitHub
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.
124 other projects use a version of this, 64 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
- shkodnik1917/claude-brainlabedited, first seen Nov 8, 2026
- Tresnanda/kybernedited, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemonedited, first seen Nov 6, 2026
Used with
Projects with it also use migrate-to-shoehorn, writing-beats and 9 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
- +2 more from simo97
- +1 more from Lesani
Other versions124 projects use a version of this.
Word for word · 51
- amazingloft999-droid/mattpocock-skills★ 422100% same
- InditexTech/weavejs★ 266100% same
- loulanyue/skills★ 231100% same
- aurorasoft2/Matt_Pocock_Skills★ 133100% same
- VisualxIntelligence/mattpocok-skills★ 55100% same
- metrogg/AgentHub★ 19100% same
- uwvwko-zzz/mattpocock-skills-openclaw★ 9100% same
- panando/APIBypass★ 8100% same
- GAGAA-HUE/ASHUO-claude-skills★ 5100% same
- Roentek/Claude_Code_Boilerplate_Framework★ 4100% same
41 more not listed
Edited · 64
- mattpocock/skills★ 309k100% same
- vinvcn/mattpocock-skills-zh-CN★ 5.5k17% same
- devcxl/mattpocock-skills-zh★ 52218% same
- tt-a1i/matt-skills-with-to-goal★ 192100% same
- Tresnanda/kybern★ 83100% same
- romiluz13/mifal★ 4484% same
- shkodnik1917/claude-brainlab★ 3594% same
- Vepricov/claude-brainlab★ 3594% same
- VoDaiLocz/kilo-kit-mcp★ 28100% same
- WenWuZhiDao/mattpocock-skills-zh★ 2718% same
54 more not listed
Wrote their own version · 9
- jrjsmrtn/project-orchestration-skills★ 17same name
- josortmel/EcoRelay★ 15same name
- imMamdouhaboammar/matts-skills-into-chatgpt★ 8same 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 repository84 other files it gives its agents.
- api-design-reviewerSkill
- api-test-suite-builderSkill
- ask-mattSkill
- aws-solution-architectSkill
- captureSkill
- changelog-generatorSkill
- ci-cd-pipeline-builderSkill
- cloud-securitySkill
- codebase-designSkill
- codebase-onboardingSkill
- code-reviewerSkill
- context-compressSkill
- context-modeSkill
- database-designerSkill
- database-schema-designerSkill
- dependency-auditorSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- env-secrets-managerSkill
- finish-branchSkill
- firecrawlSkill
- focused-fixSkill
- frontend-designSkill
- get-shit-doneSkill
- git-guardrails-claude-codeSkill
- git-worktree-managerSkill
- git-worktreesSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- improve-codebase-architectureSkill
- incident-commanderSkill
- incident-responseSkill
- mcp-builderSkill
- memSkill
- migration-architectSkill
- monorepo-navigatorSkill
- observability-designerSkill
- performance-profilerSkill
- playwright-testingSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-gainSkill
- ponytail-helpSkill
- ponytail-reviewSkill
- ponytailSkill
- prompt-engineeringSkill
- prototypeSkill
- pr-review-expertSkill
- rag-architectSkill
- red-teamSkill
- reflectSkill
- resolving-merge-conflictsSkill
- root-cause-tracingSkill
- runbook-generatorSkill
- self-evalSkill
- senior-architectSkill
- senior-backendSkill
- The first 60 shown.
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 61 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 19
Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun).
- Common: line 39
Write this file (no shebang needed for Husky v9+):
- Common: line 59
Only create if no Prettier config exists.
“Common” is measured: kept by at least 6 in 10 of the 61 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)
- typecheck and test scripts in the pre-commit hook
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 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.
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 full typecheck and tests
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

