code-quality-hooks
This skill should be used when the user asks to "configure husky", "set up lefthook", "add pre-push hook", "add pre-commit hook", "git hooks not running", "husky not working", "modify git hooks", or needs deep reference for a specific git hook framework.
What this skill does
# Git Hook Framework Reference
Deep reference for managing git hooks across frameworks. Use `/code-quality-setup` for initial setup; this skill is for modifying, extending, or understanding existing hook configurations.
## Framework Selection
| Framework | Best For | Parallel | Staged Files | Install |
|-----------|---------|----------|--------------|---------|
| Husky | JS/TS single-package | No | via lint-staged | npm |
| Lefthook | Monorepos, polyglot | Yes | {staged_files} | standalone/npm |
| Pre-commit | Python, polyglot | Limited | Built-in | pip |
| Shell Scripts | Rust/Go, minimal | No | Manual | None |
---
## Husky (JS/TS Projects)
**Best for:** Single-package JS/TS projects. Most popular in the JS ecosystem.
### Setup
```bash
# Install
npm add -D husky
# Initialize (creates .husky/ directory and adds prepare script)
npx husky init
```
This creates:
- `.husky/pre-commit` -- default pre-commit hook
- `package.json` `"prepare": "husky"` script (runs on `npm install`)
### Hook Scripts
Hook files live in `.husky/` and are plain shell scripts:
**.husky/pre-commit:**
```bash
npx lint-staged
```
**.husky/pre-push:**
```bash
npm run typecheck
npm run build
npm test
```
### Adding a New Hook
```bash
# Create a new hook file
echo "npm test" > .husky/pre-push
```
Husky automatically makes hooks in `.husky/` executable. Supported git hooks: `pre-commit`, `pre-push`, `commit-msg`, `pre-rebase`, `post-merge`, etc.
### Bypassing Hooks
```bash
# Skip hooks for a single operation
git commit --no-verify
git push --no-verify
```
### Troubleshooting
- **Hooks not running after clone:** Run `npm install` (triggers `prepare` script)
- **Permission denied:** `chmod +x .husky/pre-commit`
- **Husky not initialized:** Check `package.json` for `"prepare": "husky"`, then run `npm run prepare`
- **Wrong Node version:** Hooks run in the shell's Node, not the project's. Use `nvm` or specify path.
---
## Other Frameworks
For other frameworks, see:
- [references/lefthook.md](references/lefthook.md) -- Monorepo and polyglot projects
- [references/pre-commit-framework.md](references/pre-commit-framework.md) -- Python and polyglot projects
- [references/shell-hooks.md](references/shell-hooks.md) -- Minimal dependencies, full control
---
## Commit Message Hooks
All frameworks support `commit-msg` hooks for enforcing conventions:
### Conventional Commits with commitlint
```bash
# Install
npm add -D @commitlint/cli @commitlint/config-conventional
```
Create `commitlint.config.js`:
```javascript
export default { extends: ['@commitlint/config-conventional'] };
```
**Husky:** `echo "npx commitlint --edit \$1" > .husky/commit-msg`
**Lefthook:**
```yaml
commit-msg:
commands:
commitlint:
run: npx commitlint --edit {1}
```
**Pre-commit:**
```yaml
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]
```
---
## Reference Files
| File | Contents | Read when... |
|------|----------|-------------|
| [references/lefthook.md](references/lefthook.md) | Full Lefthook setup, config, monorepo patterns | Using Lefthook for monorepo or polyglot projects |
| [references/pre-commit-framework.md](references/pre-commit-framework.md) | Pre-commit framework setup, config, commands | Using pre-commit for Python or polyglot projects |
| [references/shell-hooks.md](references/shell-hooks.md) | Shell script hooks for Rust/Go, team sharing | Using minimal shell scripts for git hooks |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.