| name | lint |
| description | Run formatting, linting, and type checking. Auto-detects project languages (Python, JS/TS, Bash). Fixes auto-fixable issues and stages changes. |
| argument-hint | [scope] [--fix] |
| disable-model-invocation | true |
Lint
Auto-detects project languages and runs the appropriate formatting, linting, and type checking tools.
Usage
/lint
/lint --fix
/lint backend
/lint frontend
Behavior
1. Determine Scope
git diff --name-only HEAD
- No argument: scope to changed files only
all: scope to the entire codebase (run tools without file args, e.g., ruff check src/ tests/, pyright, tsc --noEmit)
backend or frontend: scope to that workspace
2. Detect Project Languages
Check for these files in the project root (or relevant subdirectory):
| Indicator | Language | Tools |
|---|
pyproject.toml, setup.py, setup.cfg, *.py in diff | Python | ruff, pyright |
package.json, tsconfig.json, *.ts/*.tsx/*.js/*.jsx in diff | JS/TS | prettier, eslint, tsc |
*.sh in diff | Bash | shellcheck |
Run only the tools that apply. If a tool isn't installed, ask the user if they want to install it via AskUserQuestion.
3. Python
Linting (Ruff):
ruff check <changed-py-files>
ruff check --fix <changed-py-files>
Formatting (Ruff):
ruff format --check <changed-py-files>
ruff format <changed-py-files>
If the project uses uv, prefix with uv run (check for uv.lock or project CLAUDE.md instructions).
Stage any fixes:
git add <fixed-files>
Type checking (Pyright):
pyright <changed-py-files>
Or uv run pyright if the project uses uv. Report type errors.
4. JavaScript / TypeScript
Formatting (Prettier):
npx prettier --check <changed-js-ts-files>
If --fix:
npx prettier --write <changed-js-ts-files>
Stage any fixes.
Linting (ESLint):
npx eslint <changed-js-ts-files>
If lint errors, attempt auto-fix:
npx eslint --fix <changed-js-ts-files>
Stage any fixes. Only lint files in the diff.
Type checking (TypeScript):
npx tsc --noEmit --pretty 2>&1
Report type errors.
5. Bash
Linting (shellcheck):
shellcheck <changed-sh-files>
Report issues. shellcheck has no auto-fix mode -- report findings for manual review.
Output
## Lint Results
### Python
- Ruff: PASS / FIXED N files / FAIL (N remaining)
- Pyright: PASS / FAIL (N errors in changed files)
### JavaScript / TypeScript
- Prettier: PASS / FIXED N files / FAIL
- ESLint: PASS / FIXED N errors / FAIL (N remaining)
- TypeScript: PASS / FAIL (N errors in changed files)
### Bash
- shellcheck: PASS / FAIL (N warnings)
- Files staged: N
- Verdict: PASS / FAIL
Only include sections for detected languages.
Rules
- Default scope: changed files only. With
all scope: entire codebase.
- Stage auto-fix changes so the user sees them.
- Fix ALL findings — errors AND warnings — not just the auto-fixable ones. After
--fix, manually resolve everything that remains (lint warnings, type errors, shellcheck warnings) by fixing the underlying code. A clean lint is zero errors and zero warnings.
- Never silence to pass. No inline
eslint-disable, @ts-ignore, @ts-expect-error, # noqa, or # type: ignore. Fix the cause. If a rule is genuinely wrong for this codebase, change the lint config deliberately and say so.
- Report everything — even if all checks pass, show the summary.
- If a tool isn't installed, ask the user if they want to install it via AskUserQuestion.