agentleFS
yu-iskwyu-iskw/coding-agent-fabric/.claude/skills/lint-and-fix/SKILL.md

lint-and-fix

Skill1 starsChanged 9 months agoApache-2.0View on GitHub

Run linters and fix violations, formatting errors, or style mismatches using Trunk. Use when code quality checks fail, before submitting PRs, or to repair "broken" linting states.

4 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Identify: Run pnpm lint (which executes trunk check -y and eslint .) to list current violations.

    line 14
  2. Distinctive:

    If passed: Move to the next issue or finish if all are resolved.

    line 21
  3. Distinctive:

    If failed: Analyze the new failure and repeat the loop.

    line 22
  4. Very specific:

    No more errors reported by pnpm lint, pnpm lint:all, or pnpm lint:eslint.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lint and Fix Loop: Trunk

Purpose

An autonomous loop for the agent to identify, fix, and verify linting and formatting violations using Trunk.

Loop Logic

  1. Identify: Run pnpm lint (which executes trunk check -y and eslint .) to list current violations. For a comprehensive check across the entire project, use pnpm lint:all (executes trunk check --all and eslint .). You can also run pnpm lint:eslint for focused ESLint checks.
  2. Analyze: Examine the output from Trunk or ESLint, focusing on the file path, line number, and error message. Refer to ../common-references/troubleshooting.md for environment or runtime issues.
  3. Fix:
    • For formatting issues, run pnpm format (which executes trunk fmt). To format all files in the project, use pnpm format:all.
    • For linting violations, apply the minimum necessary change to the source code to resolve the error. You can use pnpm format:eslint to automatically fix many ESLint violations.
    • For security-specific checks, you can run pnpm run lint:security.
  4. Verify: Re-run pnpm lint (or pnpm lint:all or pnpm lint:eslint depending on what you used initially).
    • If passed: Move to the next issue or finish if all are resolved.
    • If failed: Analyze the new failure and repeat the loop.

Termination Criteria

  • No more errors reported by pnpm lint, pnpm lint:all, or pnpm lint:eslint.
  • Reached max iteration limit (default: 5).

Examples

Scenario: Fixing a formatting violation

  1. pnpm lint reports formatting issues in src/index.ts.
  2. Agent runs pnpm format.
  3. pnpm lint now passes.

Scenario: Performing a full project cleanup

  1. Agent runs pnpm lint:all to check every file.
  2. Several formatting issues are found.
  3. Agent runs pnpm format:all to fix them all at once.
  4. pnpm lint:all now passes.

Scenario: Fixing ESLint violations

  1. pnpm lint:eslint reports several linting errors.
  2. Agent runs pnpm format:eslint.
  3. pnpm lint:eslint now passes or shows fewer errors that require manual fixing.

Resources

  • Project Scripts: Definitions for all lint and format scripts.
  • Trunk CLI Reference: Common commands for linting and formatting.
  • Trunk Documentation: Official documentation for the Trunk CLI.

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.