agentleFS
allanninalallanninal/claude-code-skills/skills/lint-fix/SKILL.md

lint-fix

Skill1 starsChanged 9 months agoMITView on GitHub

Auto-format code and fix linting issues across Python and JavaScript/TypeScript projects. Use when cleaning up code, fixing style issues, or preparing for commit.

Files
SKILL.md

Universal Linter & Formatter

Auto-detect project type and run appropriate formatters and linters with auto-fix.

Arguments

  • $ARGUMENTS: Specific path or file to lint (optional - uses current directory)

Detection & Tools

Python Projects

Formatters:

  • black - Code formatter
  • isort - Import sorter

Linters:

  • flake8 - Style checker
  • mypy - Type checker
  • ruff - Fast linter (replaces flake8, isort)

Execution Order:

# 1. Sort imports
uv run isort $PATH --profile black
# or with ruff
uv run ruff check --select I --fix $PATH

# 2. Format code
uv run black $PATH

# 3. Lint (auto-fix what's possible)
uv run ruff check --fix $PATH
# or
uv run flake8 $PATH

# 4. Type check (no auto-fix)
uv run mypy $PATH

JavaScript/TypeScript Projects

Formatters:

  • prettier - Code formatter

Linters:

  • eslint - Linter with auto-fix

Execution Order:

# 1. Format with Prettier
npx prettier --write $PATH
# or with pnpm
pnpm prettier --write $PATH

# 2. Lint with ESLint (auto-fix)
npx eslint --fix $PATH
# or
pnpm eslint --fix $PATH

# 3. Type check (TypeScript only)
npx tsc --noEmit

Project-Specific Configurations

ProjectToolsConfig Files
eruditiontx-services-mvpblack, flake8, cleanpypyproject.toml, .flake8
mathmatterstx-servicesblack, flake8pyproject.toml
eruditiontx-client-mvpESLint, Prettier.eslintrc, .prettierrc
erudition-math-v2ESLint, Prettiereslint.config.mjs
notaryo.phESLint, Prettiereslint.config.mjs, prettier.config.js
bocs-turboESLint, PrettierWorkspace configs

Pre-commit Integration

Many projects use pre-commit hooks. Run manually:

# Python projects
pre-commit run --all-files

# This runs all configured hooks:
# - black
# - flake8
# - isort
# - cleanpy (remove __pycache__)

Staged Files Only

For commit preparation, lint only staged files:

# Python
git diff --cached --name-only --diff-filter=ACMR | grep '\.py$' | xargs black
git diff --cached --name-only --diff-filter=ACMR | grep '\.py$' | xargs flake8

# JavaScript/TypeScript
git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(js|jsx|ts|tsx)$' | xargs npx prettier --write
git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(js|jsx|ts|tsx)$' | xargs npx eslint --fix

Output Format

Lint & Format: [project-name]
Path: [path or .]
Project Type: [Python/JavaScript/TypeScript]

1. Formatting...
   [Formatter output]
   Files formatted: X

2. Linting...
   [Linter output]
   Issues fixed: Y
   Issues remaining: Z

3. Type Checking...
   [Type checker output]
   Type errors: N

Summary:
  Formatted: X files
  Auto-fixed: Y issues
  Manual fixes needed: Z issues
  Type errors: N

Common Issues & Fixes

Python

  • Line too long: Black handles this, or add # noqa: E501
  • Import order: isort or ruff check --select I --fix
  • Unused imports: ruff check --select F401 --fix

JavaScript/TypeScript

  • Unused variables: ESLint --fix with no-unused-vars
  • Missing semicolons: Prettier handles this
  • Inconsistent quotes: Prettier handles this

Skip Linting

For files that should be skipped:

# Python: Add to file
# flake8: noqa
# type: ignore
// JavaScript: Add to file
/* eslint-disable */
// prettier-ignore

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.