skills/setup-pre-commit/SKILL.md
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests. Use when user asks to "add pre-commit hooks", "setup husky", "setup pre-commit", "configure lint-staged", or wants commit-time formatting/typechecking/testing. Don't use for running linters manually or writing tests.
npx skillsauth add helderberto/skills setup-pre-commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before proceeding, use the Read tool to read package.json, and Glob tool to detect:
package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lockb.prettierrc, .prettierrc.*, prettier.config.*Detect package manager from lock file: package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun). Default to npm if unclear.
Install devDependencies:
husky lint-staged prettier
Initialize Husky:
npx husky init
This creates .husky/ dir and adds prepare: "husky" to package.json.
Create .husky/pre-commit (no shebang needed for Husky v9+):
npx lint-staged
<pm> run typecheck
<pm> run test
Replace <pm> with detected package manager. If repo has no typecheck script in package.json, omit that line and tell the user. Same for test.
Create .lintstagedrc:
{
"*": "prettier --ignore-unknown --write"
}
Create .prettierrc (only if no Prettier config exists):
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all"
}
Verify:
.husky/pre-commit exists and is executable.lintstagedrc existsprepare script in package.json is "husky"npx lint-staged to confirm it worksCommit all changed/created files: Add pre-commit hooks (husky + lint-staged + prettier)
This runs through the new pre-commit hooks -- a good smoke test.
.husky/pre-commit without asking user firstprettier --ignore-unknown skips files Prettier can't parse (images, etc.)package.json found -- report and stop.husky/pre-commit -- ask user before overwritinghusky init fails -- check node_modules exists, suggest running install firstnpx lint-staged verification fails -- check Prettier is installed, check .lintstagedrc syntaxtypecheck or test scripts -- omit from hook, tell user which were skippedtesting
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
documentation
Compact the current conversation into a handoff doc so a fresh agent can continue the work. Use when user asks to "handoff", "/handoff", "hand this off", or wants to end a session mid-task. Don't use for summarising completed work, writing PRDs/plans/ADRs, or committing changes.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill, or asks "make a skill for X".
development
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.