Skill Code Quality

Lint Fix

Fix all linting and formatting issues

install path ~/.claude/skills/lint-fix/SKILL.md
command /lint-fix
lintingformattingeslintprettierstyle
SKILL.md

Lint Fix Skill

You are an expert at code formatting and linting. When this skill is invoked, find and fix all linting and formatting issues in the project.

What This Skill Does

Runs the project’s linters and formatters, fixes all auto-fixable issues, and manually resolves any remaining violations.

Step-by-Step Instructions

  1. Identify the project’s linting and formatting tools. Check for:

    • ESLint (.eslintrc.*, eslint.config.*)
    • Prettier (.prettierrc.*, prettier.config.*)
    • Biome (biome.json)
    • Stylelint (.stylelintrc.*)
    • Ruff (ruff.toml, pyproject.toml)
    • Flake8 (.flake8, setup.cfg)
    • Black (pyproject.toml)
    • RuboCop (.rubocop.yml)
    • Check package.json scripts for lint/format commands
  2. Run auto-fix first. Execute the project’s auto-fix commands:

    • npm run lint -- --fix or npx eslint --fix .
    • npx prettier --write .
    • npx biome check --fix .
    • ruff check --fix .
    • Whatever the project uses
  3. Check for remaining issues. Run the linter again without --fix to see what remains. Read the full output.

  4. Fix remaining issues manually. For each violation:

    • Read the rule documentation to understand what it enforces
    • Apply the correct fix, not a workaround
    • If a rule is being violated across many files, fix all instances consistently
  5. Handle conflicting tools. If ESLint and Prettier conflict:

    • Prettier wins on formatting (indentation, quotes, semicolons)
    • ESLint wins on code quality (unused variables, no-console)
    • If eslint-config-prettier is not installed, recommend adding it
  6. Re-run all checks. Execute all lint and format commands one more time to confirm zero violations.

  7. Report what changed. Summarize the categories of fixes applied and the total number of issues resolved.

Guidelines

  • Never disable a lint rule to fix a violation unless the rule is genuinely wrong for the context.
  • If a // eslint-disable comment is the right solution, always include the specific rule name, never use blanket disable.
  • Respect the project’s existing configuration. Do not change lint rules or formatter settings.
  • Fix issues across the entire project for consistency, not just the files the user pointed to.
  • If the project has no linter configured, suggest one but do not install it without user confirmation.
  • Sort imports if the project has an import sorting rule configured.
  • Remove unused imports and variables.
  • Ensure consistent line endings (LF vs CRLF) per project config.

Example Usage

/lint-fix

Runs all configured linters and formatters, fixes everything, and reports the results.

/lint-fix src/components/

Fixes lint and formatting issues only in the components directory.

Copy this into ~/.claude/skills/lint-fix/SKILL.md to use it as a slash command in Claude Code.

get crystl