| name | git-hooks |
| description | Git hooks with Husky setup, pre-commit with lint-staged, commit-msg with commitlint, pre-push checks, and conventional commits enforcement |
| layer | utility |
| category | devops |
| triggers | ["git hooks","husky","pre-commit","lint-staged","commitlint","conventional commits","pre-push","commit message format"] |
| inputs | ["package manager","linters/formatters in use","commit convention","CI pipeline"] |
| outputs | ["husky config","lint-staged config","commitlint config","hook scripts"] |
| linksTo | ["cicd","dev-workflow","git-workflow"] |
| linkedFrom | ["bootstrap","code-review","ship"] |
| preferredNextSkills | ["cicd","dev-workflow"] |
| fallbackSkills | ["git-workflow","shell-scripting"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | none |
| sideEffects | ["Adds husky, lint-staged, commitlint dependencies","Creates .husky/ directory with hook scripts","Modifies package.json (prepare script, lint-staged config)"] |
Git Hooks Skill
Purpose
Automate code quality enforcement at commit and push time. Catch lint errors, formatting issues, and bad commit messages before they enter the repository -- not in CI where feedback is slow.
Setup
Husky + lint-staged + commitlint (Full Stack)
pnpm add -D husky lint-staged @commitlint/cli @commitlint/config-conventional
pnpm exec husky init
Package.json Config
{
"scripts": {
"prepare": "husky"
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix --max-warnings 0",
"prettier --write"
],
"*.{json,md,css}": [
"prettier --write"
]
}
}
Hook Scripts
Pre-Commit: Lint Staged Files Only
pnpm exec lint-staged
import type { Config } from "lint-staged";
const config: = {
: [
,
,
,
],
: [],
: [],
};
config;