pre-commit
Skill2 starsChanged 4 months agoMITView on GitHub
Set up or improve pre-commit hooks that lint, format, and check the project before each commit, matching its language and tooling. Use when the user says "set up pre-commit hooks", "add a git hook", "run lint before commit", "configure husky", "add pre-commit", or "block bad commits".
11 other projects use a version of this.
Adopted by
Most recently taken up by
- GoogleCloudPlatform/cloud-solutionstheir own version, first seen Nov 1, 2026
- goulvenclech/dotclaudetheir own version, first seen Oct 13, 2026
- wellwelwel/pokutheir own version, first seen Oct 8, 2026
- mihai-dinculescu/tapotheir own version, first seen Oct 8, 2026
- benyoskovitz/claude-code-workflowtheir own version, first seen Sep 24, 2026
- RealDougEubanks/ClaudeMarketplacetheir own version, first seen Sep 10, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- wellwelwel/poku★ 1.2ksame name
- mihai-dinculescu/tapo★ 870same name
- GoogleCloudPlatform/cloud-solutions★ 139same name
- benyoskovitz/claude-code-workflow★ 8same name
- goulvenclech/dotclaude★ 5same name
- autowarefoundation/autoware-harness★ 4same name
- Cogni-AI-OU/cogni-ai-agent-skills★ 4same name
- alex-voloshin-dev/ai-skills★ 2same name
- flying-dice/pseudoscript★ 2same name
- Docat0209/SoloForge★ 1same name
1 more not listed
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 repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- audit-logSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- profileSkill
- prune-branchesSkill
- rate-limitSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- retrySkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- security-headersSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- squashSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If a framework is already configured, extend its config rather than introducing a second one.
- Distinctive: line 35
Only wire checks the project can actually run — verify the command exists in scripts/manifest before adding it.
- Distinctive: line 36
Don't add new dependencies beyond the hook framework and its standard companions, and call out exactly what gets installed.
- Very specific: line 37
Keep hooks fast and staged-file-scoped.
- Very specific: line 38
Never weaken or auto---no-verify anything.
- Distinctive: line 39
After writing, summarize each hook, the install/activate command, and how to skip a hook in an emergency (git commit --no-verify).
“Common” is measured: kept by at least 6 in 10 of the 11 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
Project + existing hook detection
!ls package.json pyproject.toml Cargo.toml go.mod Gemfile 2>/dev/null
!ls .pre-commit-config.yaml .husky .lefthook.yml lefthook.yml .git/hooks 2>/dev/null
!cat package.json 2>/dev/null | grep -A20 '"scripts"'
Instructions
Set up (or improve) pre-commit hooks for this project. Use the checks/framework in $ARGUMENTS if given; otherwise pick the idiomatic tool for the stack and wire up the checks the project already supports.
Method
- Pick the right framework for the ecosystem, preferring one already in use:
- JS/TS:
husky+lint-staged(run linters/formatters only on staged files). - Python: the
pre-commitframework (.pre-commit-config.yaml). - Polyglot / language-agnostic:
pre-commitorlefthook. - If a framework is already configured, extend its config rather than introducing a second one.
- JS/TS:
- Use the project's real commands. Pull lint/format/typecheck/test commands from the scripts/manifest above (e.g.
eslint,prettier --write,ruff,black,gofmt,cargo fmt). Don't invent script names or add tools the project doesn't have. - Scope to staged files where the tool supports it (lint-staged, pre-commit) so the hook stays fast — a slow hook gets bypassed with
--no-verify. - Order checks fast-to-slow and fail early: format → lint → typecheck → quick tests. Keep the full/slow test suite in CI, not the hook, unless the user asks.
- Write the config to the conventional path and add any needed
prepare/install step (e.g."prepare": "husky"in package.json). Note the one command the user runs to activate hooks locally.
Rules
- Only wire checks the project can actually run — verify the command exists in scripts/manifest before adding it. If a desired check has no tooling yet, say so instead of inventing it.
- Don't add new dependencies beyond the hook framework and its standard companions, and call out exactly what gets installed.
- Keep hooks fast and staged-file-scoped; heavy work belongs in CI (point to the
ci-setupskill). - Never weaken or auto-
--no-verifyanything. The hook should be bypassable by the user, not by default. - After writing, summarize each hook, the install/activate command, and how to skip a hook in an emergency (
git commit --no-verify).
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.

