ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Husky v9 setup, lint-staged v16 patterns, commitlint with conventional commits, CI/production handling, monorepo setup, migration from v8
$ npx -y skills add agents-inc/skills --skill shared-tooling-git-hooks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/shared-tooling-git-hooksContext preview
The summary Claude sees to decide when to auto-load this skill.
Husky v9 setup, lint-staged v16 patterns, commitlint with conventional commits, CI/production handling, monorepo setup, migration from v8
name: shared-tooling-git-hooks description: Husky v9 setup, lint-staged v16 patterns, commitlint with conventional commits, CI/production handling, monorepo setup, migration from v8
> **Quick Guide:** Husky v9 for git hooks with `"prepare": "husky"` (NOT `"husky install"`). lint-staged v16 for staged-only linting. commitlint for conventional commit messages. Pre-commit hooks should take < 10 seconds. Set `HUSKY=0` in CI/production.
---
<critical_requirements>
> **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants)
**(You MUST use `"prepare": "husky"` in package.json - NOT the deprecated `"husky install"`)**
**(You MUST only lint staged files via lint-staged - NEVER lint the entire codebase in pre-commit)**
**(You MUST set `HUSKY=0` in CI/production environments to disable hooks)**
**(You MUST use plain hook files in `.husky/` directory - NO shebang lines or husky.sh sourcing in v9)**
**(You MUST keep pre-commit hooks under 10 seconds - move slow tasks to pre-push or CI)**
</critical_requirements>
---
**Auto-detection:** Husky, husky init, .husky/, pre-commit hook, lint-staged, commitlint, conventional commits, commit-msg hook, git hooks, prepare script
**When to use:**
**When NOT to use:**
**Key patterns covered:**
**Detailed Resources:**
---
<philosophy>
Git hooks are a **developer workflow tool** - they catch issues early while staying fast and non-blocking. The goal is fast feedback (< 10 seconds) on staged files only. Hooks are optional infrastructure; many projects work fine without them.
**When to use git hooks:**
**When NOT to use:**
</philosophy>
---
<patterns>
Husky v9 uses plain shell scripts in `.husky/` directory. No shebang lines needed. The `prepare` script auto-installs hooks for all team members.
# Full setup in 4 commands bun add -D husky bunx husky init # Creates .husky/ and adds "prepare": "husky" to package.json bun add -D lint-staged echo "bunx lint-staged" > .husky/pre-commit
**Key points:**
See [examples/core.md](examples/core.md) for full setup and package.json configuration.
---
lint-staged v16 runs commands only on staged files. Uses `picomatch` for glob matching (replaced `micromatch`).
// lint-staged.config.mjs
export default {
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{css,scss}": ["prettier --write"],
};Type checking requires function syntax (runs on ALL files, not just staged):
// lint-staged.config.mjs — with type checking
export default {
"*.{ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{ts,tsx,js,jsx}": () => "tsc --noEmit",
};**Why good:** Only staged files, auto-fix reduces manual work, fast feedback
**v16 breaking changes:** `--shell` flag removed (use shell scripts instead), requires Node.js 20.18+
See [examples/core.md](examples/core.md) for multiple file type patterns and v16 migration details.
---
commitlint v20+ validates commit messages. ESM-native - use `.mjs` config extension.
bun add -D @commitlint/cli @commitlint/config-conventional
# .husky/commit-msg bunx commitlint --edit $1
// commitlint.config.mjs (MUST be .mjs for Node v24 compatibility)
export default {
extends: ["@commitlint/config-conventional"],
};Format: `type(scope): description` - types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, etc.
See [examples/core.md](examples/core.md) for v20 changes and advanced configuration.
---
Disable Husky where hooks should not run.
# CI pipelines HUSKY=0 npm install # GitHub Actions env: HUSKY: 0
**Why:** Prevents hook installation failures when `devDependencies` not installed in production.
See [examples/core.md](examples/core.md) for conditional prepare script alternatives.
---
For monorepos where package.json is not at the repository root.
// apps/frontend/package.json
{
"scripts": {
"prepare": "cd ../.. && husky apps/frontend/.husky"
}
}**Key:** Navigate to repo
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…