/officialunofficial-skills:setup-pre-commitfrom Official Unofficial Skills
Adds a Husky pre-commit hook backed by lint-staged (Prettier), plus type checking and tests, to the current repo.
Ships in Official Unofficial Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Look for a lockfile: package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), or bun.lockb (bun). Use whichever is present, and fall back to npm when none is clear.
Add as devDependencies:
husky lint-staged prettier
npx husky init
This creates the .husky/ directory and adds a prepare: "husky" script to package.json.
.husky/pre-commitHusky v9+ needs no shebang:
npx lint-staged
npm run typecheck
npm run test
Adapt it: swap npm for the detected package manager. If package.json has no typecheck or test script, drop the matching line and tell the user it was left out.
.lintstagedrc{
"*": "prettier --ignore-unknown --write"
}
.prettierrc, only if none existsSkip this when the repo already has a Prettier config. Otherwise use these defaults:
{
"useTabs": false,
"tabWidth": 2,
"printWidth": 80,
"singleQuote": false,
"trailingComma": "es5",
"semi": true,
"arrowParens": "always"
}
.husky/pre-commit exists and is executable.lintstagedrc exists"prepare": "husky"npx lint-staged runs cleanlyStage everything you created or changed and commit with: Add pre-commit hooks (husky + lint-staged + prettier). The commit itself flows through the new hook, which doubles as the first smoke test.
prettier --ignore-unknown passes over files Prettier cannot parse, such as images.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub officialunofficial/skills --plugin officialunofficial-skills85 skills in this plugin
/alignmentMeasures a running page for edges, gaps, centres and radii that miss by a pixel or two, judges visual weight, and returns a numbered report with proof./animateBuilds a web animation from scratch and writes the code. Decides in order whether it should animate at all, its purpose, the tool, the properties, the easing and duration or spring, how it interrupts and exits, and reduced motion. Use when asked to animate something, add motion, build a transition, or make a component feel alive. For React Native or Expo use animate-expo. To critique existing motion use review-animations. To audit a whole codebase use improve-animations./animate-expo