Code Linting
Run all appropriate linters according to repository guidelines.
When to Use This Skill
Use this skill:
- Immediately after creating new source code files
- Immediately after modifying existing code (functions, classes, imports, etc.)
- Immediately after completing a feature, refactor, or bug fix
- Before staging files for commit
- When build/compilation succeeds but linting hasn't been checked
- Proactively, whenever code changes are made
Don't use:
- When you've already run linting and it passed
Linter Discovery
First look for linting commands in the following order:
- Directives to AI agents (
CLAUDE.md, .cursorrules, .ai-rules,
AGENTS.md, AGENT.md, GEMINI.md, and similar)
- Repository documentation (
README.md, docs/, etc.)
- Package configuration (
package.json, Makefile, pyproject.toml, etc.)
- Standard linter patterns for the project type
If no linting guidelines are found or they are unclear, ask the user
for clarification.
Common Linter Commands
# JavaScript/TypeScript
npm run lint
yarn run lint
pnpm run lint
npx eslint .
# Python
ruff check .
pylint .
flake8 .
black --check .
make lint
# Shell
shellcheck .
# Multiple/Generic
npm run format
yarn run format
pnpm run format
Linting Process
For each linter found:
- If it has an auto-fix mode (e.g.,
prettier, eslint --fix, black, ruff check --fix), run that first
- Run the linter in check mode to see if there are any remaining issues
- If issues can't be fixed automatically, report them clearly
Important Rules
CRITICAL: Do NOT ignore unfixed issues!
- All linting issues MUST be resolved before considering the task complete
- The only exception is if the user explicitly gives permission to defer resolution
- Document any issues that couldn't be auto-fixed for the user to review
Output
Report results organized by:
- Auto-fixed issues: What was automatically corrected
- Remaining issues: Issues requiring manual attention (list each with file, line, and description)
- Recommendation: What the developer should do next
If all linting passes, simply confirm: "All linters passed."
1---2name: code-linting3description: Run linters according to repository guidelines. Use immediately after creating or modifying code, or before committing changes.4---5
6# Code Linting
7
8Run all appropriate linters according to repository guidelines.
9
10## When to Use This Skill
11
12Use this skill:
13- Immediately after creating new source code files
14- Immediately after modifying existing code (functions, classes, imports, etc.)
15- Immediately after completing a feature, refactor, or bug fix
16- Before staging files for commit
17- When build/compilation succeeds but linting hasn't been checked
18- Proactively, whenever code changes are made
19
20**Don't use:**
21- When you've already run linting and it passed
22
23## Linter Discovery
24
25First look for linting commands in the following order:
26
271. Directives to AI agents (`CLAUDE.md`, `.cursorrules`, `.ai-rules`,
28 `AGENTS.md`, `AGENT.md`, `GEMINI.md`, and similar)
292. Repository documentation (`README.md`, `docs/`, etc.)
303. Package configuration (`package.json`, `Makefile`, `pyproject.toml`, etc.)
314. Standard linter patterns for the project type
32
33If no linting guidelines are found or they are unclear, ask the user
34for clarification.
35
36## Common Linter Commands
37
38```bash
39# JavaScript/TypeScript
40npm run lint
41yarn run lint
42pnpm run lint
43npx eslint .
44
45# Python
46ruff check .
47pylint .
48flake8 .
49black --check .
50make lint
51
52# Shell
53shellcheck .
54
55# Multiple/Generic
56npm run format
57yarn run format
58pnpm run format
59```
60
61## Linting Process
62
63For each linter found:
64
651. If it has an auto-fix mode (e.g., `prettier`, `eslint --fix`, `black`, `ruff check --fix`), run that first
662. Run the linter in check mode to see if there are any remaining issues
673. If issues can't be fixed automatically, report them clearly
68
69## Important Rules
70
71**CRITICAL: Do NOT ignore unfixed issues!**
72
73- All linting issues MUST be resolved before considering the task complete
74- The only exception is if the user explicitly gives permission to defer resolution
75- Document any issues that couldn't be auto-fixed for the user to review
76
77## Output
78
79Report results organized by:
80
811. **Auto-fixed issues**: What was automatically corrected
822. **Remaining issues**: Issues requiring manual attention (list each with file, line, and description)
833. **Recommendation**: What the developer should do next
84
85If all linting passes, simply confirm: "All linters passed."