dev-pre-commit/SKILL.md
Use when setting up pre-commit hooks, configuring Husky, adding lint-staged, or enabling commit-time formatting, type checking, or testing. Installs and wires up Husky v9, lint-staged with Prettier, and optionally typecheck and test scripts.
npx skillsauth add paulund/ai dev-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.
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 prettier
npx husky init
This creates .husky/ and adds prepare: "husky" to package.json.
.husky/pre-commitWrite this file (no shebang needed for Husky v9+):
npx lint-staged
npm run typecheck
npm run test
Adapt: replace npm with the detected package manager. If typecheck or test scripts are absent from package.json, omit those lines and inform the user.
.lintstagedrc{
"*": "prettier --ignore-unknown --write"
}
.prettierrc (if missing)Only create if no Prettier config exists:
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}
.husky/pre-commit exists and is executable.lintstagedrc existsprepare script in package.json is "husky"npx lint-staged to confirm it worksStage all changed/created files and commit with message: Add pre-commit hooks (husky + lint-staged + prettier)
This runs through the new hooks as a smoke test.
MUST DO
prettier --ignore-unknown to skip unparseable files (images, etc.)MUST NOT DO
.husky/pre-commit.prettierrc if a Prettier config already existsdevelopment
Use when the user wants to run the project's lint + types + build sequence as a gate before pushing, opening a PR, or merging. Invoked by chained dev skills between phases. Trigger phrases - "/quality-gate", "run the quality gate", "check it builds".
tools
Use when the user wants to verify a PR's feature works at runtime by booting the dev server, exercising the affected UI via Chrome DevTools MCP, and posting a screenshot summary back to the PR. Idempotent — skips if `verified` or `verify-failed` is already on the PR. Trigger phrases - "/pr-verify", "verify this PR", "runtime check the pr".
testing
Use when the user wants a security-focused review pass on a PR with findings actioned as commits on the same branch. Trigger phrases - "/pr-security-review", "security review and fix".
testing
Use when the user wants to open a pull request for an already-pushed branch that implements a specific issue. Idempotent — returns the existing PR if one is already open for the branch. Trigger phrases - "/pr-open", "open the pr", "create pr for this branch".