| name | setup-linter |
| description | USE WHEN setup automatic linting, add linter hook, configure code formatting on completion, enable lint on save. Auto-detects project type (JS/Python/Rust/Go/Deno/Biome), installs linter if missing, creates config with sensible defaults, wires a Stop hook in .claude/settings.json. |
Setup Linter Hook
Auto-detect, install, and configure project-specific linting with a Stop hook.
Quick Start
Just run without arguments - it auto-detects everything:
~/.claude/skills/setup-linter/scripts/setup.sh
Or specify a custom command:
~/.claude/skills/setup-linter/scripts/setup.sh "yarn lint:fix"
What It Does
- Auto-detects project type from config files
- Installs linter if not present (eslint, ruff, etc.)
- Creates config file with sensible defaults
- Adds lint scripts to package.json (JS projects)
- Sets up Stop hook in
.claude/settings.json
- Adds clean-code-reviewer instruction to project
CLAUDE.md
Supported Project Types
| Project | Detection | Linter | Config Created |
|---|
| JavaScript/React | package.json | ESLint | eslint.config.js |
| Python | pyproject.toml, *.py | Ruff | ruff.toml |
| Rust | Cargo.toml | rustfmt + clippy | (built-in) |
| Go | go.mod | golangci-lint | (optional) |
| Deno | deno.json | deno lint/fmt | (built-in) |
| Biome | biome.json | Biome | (existing) |
JavaScript/TypeScript Details
- Detects package manager (yarn, pnpm, bun, npm)
- Detects React projects and adds react-hooks plugin
- Creates flat config format (
eslint.config.js)
- Adds
lint and lint:fix scripts to package.json
- Ignores: node_modules, dist, .vite, .storybook, .ai
Python Details
- Uses Ruff (fastest Python linter/formatter)
- Supports uv, pip, or poetry for installation
- Creates
ruff.toml with sensible defaults if missing
- Enables: E, F, W, I, N, UP, B, C4 rules
Hook Behavior
The Stop hook runs <linter> > /dev/null 2>&1 || true to:
- Suppress all output (prevents terminal rendering issues)
- Never block Claude even if linting fails
- Auto-fix what it can on every response
Examples
~/.claude/skills/setup-linter/scripts/setup.sh
~/.claude/skills/setup-linter/scripts/setup.sh "ruff check --fix . && ruff format ."
~/.claude/skills/setup-linter/scripts/setup.sh "yarn lint:fix src/ server/"
After Setup
Restart Claude Code for the Stop hook to take effect.