Claude-skill-registry lint-and-fix
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.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/lint-and-fix" ~/.claude/skills/majiayu000-claude-skill-registry-lint-and-fix-2ecd7a && rm -rf "$T"
manifest:
skills/data/lint-and-fix/SKILL.mdsource content
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
- Format: Run
(which executespnpm format
) to automatically fix trivial formatting issues.trunk fmt - Identify: Run
(which executespnpm lint
) to list any remaining violations.trunk check - Analyze: Examine the output from Trunk, focusing on the file path, line number, and error message. Refer to ../common-references/troubleshooting.md for environment or runtime issues.
- Fix: Apply the minimum necessary change to the source code to resolve the reported linting violations.
- Verify: Re-run the loop (starting from Format) until all issues are resolved.
- If
passes: Finish.pnpm lint - If it fails: Analyze the new failure and repeat the loop.
- If
Termination Criteria
- No more errors reported by
.pnpm lint - Reached max iteration limit (default: 5).
Examples
Scenario: Fixing violations in a modified file
- Agent runs
to ensure consistent style.pnpm format - Agent runs
and finds a linting violation inpnpm lint
.src/index.ts - Agent analyzes the error and applies a manual fix.
- Agent runs
again (part of the loop).pnpm format - Agent runs
and it now passes.pnpm lint
Resources
- Trunk CLI Reference: Common commands for linting and formatting.
- Trunk Documentation: Official documentation for the Trunk CLI.