.claude/skills/ln-742-precommit-setup/SKILL.md
Configures Husky, lint-staged, commitlint, and Python pre-commit
npx skillsauth add cbbkrd-tech/jl-finishes ln-742-precommit-setupInstall 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.
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-740-quality-setup
Sets up Git hooks for automated code quality enforcement before commits.
Does:
Does NOT:
| Technology | Hook Manager | Staged Linting | Commit Validation | |------------|--------------|----------------|-------------------| | Node.js | Husky | lint-staged | commitlint | | Python | pre-commit | pre-commit hooks | pre-commit hook | | Mixed | Both (if needed) | Stack-specific | commitlint |
Before installing, check for existing hook configurations.
Files to Check:
| Tool | Indicators |
|------|------------|
| Husky | .husky/ directory, husky in package.json |
| pre-commit | .pre-commit-config.yaml |
| lint-staged | lint-staged in package.json or .lintstagedrc* |
| commitlint | commitlint.config.*, .commitlintrc* |
Decision Logic:
npm install -D husky
npx husky init
This creates:
.husky/ directory.husky/pre-commit hook fileprepare script to package.jsonpip install pre-commit
# OR with uv:
uv add --dev pre-commit
pre-commit install
This creates:
.git/hooks/pre-commit (managed by pre-commit).pre-commit-config.yaml for configurationnpm install -D lint-staged
Create configuration (.lintstagedrc.mjs or in package.json):
Key Rules:
CRITICAL FIX: For .NET files, use correct syntax:
"*.cs": "dotnet format --include"is WRONG Use:"*.cs": "dotnet format whitespace --include"or run dotnet format separately
Configuration in .pre-commit-config.yaml:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
npm install -D @commitlint/cli @commitlint/config-conventional
Create commitlint.config.mjs with:
Add commit-msg hook:
echo 'npx --no -- commitlint --edit "$1"' > .husky/commit-msg
Add to .pre-commit-config.yaml:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Verify hooks work correctly.
Test 1: Lint-staged triggers
# Create a file with lint issues
echo "const x=1" > test-file.ts
git add test-file.ts
git commit -m "test: verify hooks"
# Expected: lint-staged runs, either fixes or blocks
Test 2: Commit message validation
git commit --allow-empty -m "bad message"
# Expected: commitlint rejects
git commit --allow-empty -m "test: valid message format"
# Expected: commit succeeds
Cleanup:
rm test-file.ts
git reset HEAD~1 # If test commit was made
RULE 1: Husky requires Git repository (
git initfirst).
RULE 2: lint-staged MUST have linters configured first (run ln-741 before ln-742).
RULE 3: Document
--no-verifyescape hatch for emergency commits.
RULE 4: pre-commit hooks should auto-fix when possible (
--fixflag).
git commit --no-verify)| File | Purpose | |------|---------| | husky_precommit_template.sh | Husky pre-commit hook | | husky_commitmsg_template.sh | Husky commit-msg hook | | lintstaged_template.mjs | lint-staged configuration | | commitlint_template.mjs | commitlint configuration | | precommit_config_template.yaml | Python pre-commit config | | hooks_guide.md | Detailed hooks guide |
| Error | Cause | Resolution |
|-------|-------|------------|
| Husky not running | Missing prepare script | Run npx husky init again |
| lint-staged fails | Missing linter | Run ln-741 first |
| pre-commit not found | Not in PATH | pip install pre-commit |
| Hooks not triggering | Git hooks disabled | Check .git/hooks/ permissions |
| Windows path issues | Shell script format | Use cross-platform syntax |
Document for users:
# Skip all hooks (use sparingly!)
git commit --no-verify -m "emergency: bypass hooks"
# Skip only pre-commit (keeps commit-msg)
HUSKY=0 git commit -m "fix: urgent hotfix"
Version: 2.0.0 Last Updated: 2026-01-10
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.