home / skills / codyswanngt / lisa / plan-fix-linter-error

plan-fix-linter-error skill

/.claude/skills/plan-fix-linter-error

This skill fixes ESLint violations across the codebase by analyzing errors, grouping by rule, and proposing actionable plan and tasks.

npx playbooks add skill codyswanngt/lisa --skill plan-fix-linter-error

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.3 KB
---
name: plan-fix-linter-error
description: This skill should be used when fixing all violations of one or more ESLint rules across the codebase. It runs the linter, groups violations by rule and file, generates a brief with fix strategies, and creates a plan with tasks to implement the fixes.
allowed-tools: ["Read", "Bash", "Glob", "Grep"]

---

# Fix Linter Errors

Target rules: $ARGUMENTS

If no arguments provided, prompt the user for at least one lint rule name.

## Step 1: Gather Requirements

1. **Parse rules** from $ARGUMENTS (space-separated)
2. **Run linter** to collect all violations:
   ```bash
   bun run lint 2>&1
   ```
3. **Group violations** by rule, then by file, noting:
   - File path and line numbers
   - Violation count per file
   - Sample error messages

## Step 2: Compile Brief and Delegate

Compile the gathered information into a structured brief:

```
Fix ESLint violations for rules: $ARGUMENTS

Violations by rule:
- [rule-name-1]: X total violations across Y files
  - [file]: N violations (lines: ...)
  - ...
- [rule-name-2]: X total violations across Y files
  - ...

Fix strategies: extract functions, early returns, apply formatting, add types

Verification: `bun run lint 2>&1 | grep -E "($ARGUMENTS)" | wc -l` → Expected: 0
```

Invoke `/plan-execute` with this brief to create the implementation plan.

Overview

This skill automates planning to fix all violations of one or more ESLint rules across a TypeScript codebase. It runs the project linter, groups violations by rule and file, and produces a concise brief and task plan to implement fixes and verify zero remaining violations.

How this skill works

The skill parses one or more lint rule names and runs the linter (bun run lint) to collect all violations. It groups results by rule and then by file, recording file paths, line ranges, counts, and sample error messages. Finally it generates a brief with recommended fix strategies and a step-by-step implementation plan that can be handed off or executed.

When to use it

  • You need to fix all instances of specific ESLint rules across the repo.
  • Preparing a breaking-change or cleanup PR that enforces new style or type rules.
  • Before CI enforcement to reduce noise from repeated lint failures.
  • When delegating rule fixes to multiple engineers or automation.

Best practices

  • Provide at least one rule name; multiple names may be space-separated for a combined plan.
  • Run the linter locally (bun run lint) first to confirm environment parity and reproduce violations.
  • Prioritize low-risk, automated fixes (formatting, simple AST transforms) before behavioral changes.
  • Include sample snippets and line numbers in task descriptions to speed implementation and review.
  • Add tests or type checks where fixes could change runtime behavior.

Example use cases

  • Fix all no-explicit-any violations across src/ to improve type safety.
  • Address consistent formatting rules (e.g., quotes, semicolons) before enabling autofix in CI.
  • Group and fix complex rule violations (e.g., prefer-early-return) with targeted refactors and review tasks.
  • Generate a task list to remove deprecated rule suppressions and re-lint for zero violations.

FAQ

What if I provide no rule names?

The skill will prompt you to supply at least one ESLint rule name; it needs specific targets to collect and group violations.

How does verification work?

The brief includes a verification command that reruns the linter and counts matching violations (bun run lint 2>&1 | grep -E "(rules)" | wc -l) with an expected result of 0 after fixes.