Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Run Ruff checks with optional scope and rule overrides, apply safe and unsafe autofixes iteratively, review each change, and resolve remaining findings with targeted edits or user decisions.
.claude/skills/ruff-recursive-fix/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | — | — |
| case-19 | ✗→✓ | ▲ Improved | — | — |
| case-04 | ✓→✓ | = Same ✓ | — | — |
| case-20 | ✗→✗ | = Same ✗ | — | — |
| case-21 | ✗→✗ | = Same ✗ | — | — |
Use this skill to enforce code quality with Ruff in a controlled, iterative workflow. It supports:
pyproject.toml.uv, direct ruff, python -m ruff, or equivalent).--select, --ignore, --extend-select, --extend-ignore).# noqa only when suppression is justified.Collect these inputs before running:
target_path (optional): folder or file to check. Empty means whole repository.ruff_runner (optional): explicit Ruff command prefix (for example uv run, ruff, python -m ruff, pipx run ruff).rules_select (optional): comma-separated rule codes to enforce.rules_ignore (optional): comma-separated rule codes to ignore.extend_select (optional): extra rules to add without replacing configured defaults.extend_ignore (optional): extra ignored rules without replacing configured defaults.allow_unsafe_fixes (default: true): whether to run Ruff unsafe fixes.ask_on_ambiguity (default: true): always ask the user when multiple valid choices exist.Build Ruff commands from inputs.
Determine a reusable ruff_cmd prefix before building commands.
Resolution order:
ruff_runner is provided, use it as-is.uv is available and Ruff is managed through uv, use uv run ruff.ruff is available on PATH, use ruff.python -m ruff.pipx run ruff), or stop and ask the user.Use the same resolved ruff_cmd for all check and format commands in the workflow.
Base command:
bash<ruff_cmd> check
Formatter command:
bash<ruff_cmd> format
With optional target:
bash<ruff_cmd> format <target_path>
Add optional target:
bash<ruff_cmd> check <target_path>
Add optional overrides as needed:
bash--select <codes> --ignore <codes> --extend-select <codes> --extend-ignore <codes>
Examples:
bash# Full project with defaults from pyproject.toml ruff check # One folder with defaults python -m ruff check src/models # Override to skip docs and TODO-like rules for this run uv run ruff check src --extend-ignore D,TD # Check only selected rules in a folder ruff check src/data --select F,E9,I
<ruff_cmd> check with the selected scope and options.--fix using the same scope/options.<ruff_cmd> format on the same scope.<ruff_cmd> check to refresh remaining findings.Run only if findings remain and allow_unsafe_fixes=true.
--fix --unsafe-fixes using the same scope/options.<ruff_cmd> format on the same scope.<ruff_cmd> check.For remaining findings:
<ruff_cmd> format on the same scope.<ruff_cmd> check.If there are multiple valid solutions at any step, always ask the user before proceeding. Do not choose silently between equivalent options.
# noqa)Use suppression only when all conditions are true:
Guidelines:
# noqa: <RULE> over broad # noqa.Repeat steps 2 to 6 until one of these outcomes:
<ruff_cmd> check returns clean.Each loop iteration must include <ruff_cmd> format before the next <ruff_cmd> check.
When no progress is detected:
Before declaring completion:
At the end of execution, report:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 12 counted toward the lift figure. The other 11 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -33 percentage points is the difference between those two pass rates over the 12 comparable cases. 7 cases got worse with the skill loaded, and they are included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.