skills/ruff-recursive-fix/SKILL.md
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.
npx skillsauth add williamlimasilva/.copilot ruff-recursive-fixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
<ruff_cmd> check
Formatter command:
<ruff_cmd> format
With optional target:
<ruff_cmd> format <target_path>
Add optional target:
<ruff_cmd> check <target_path>
Add optional overrides as needed:
--select <codes>
--ignore <codes>
--extend-select <codes>
--extend-ignore <codes>
Examples:
# 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:
development
Anxiety-aware, evidence-driven collaboration for stalled or high-stakes work when a user says uncertainty, repeated setbacks, or lack of visible progress is causing significant anxiety or distress. Use immediately when explicitly invoked; when this fit is only inferred from the user's own account, ask permission before applying it. Preserve the user's ideal and turn grounded perspective-taking into persistent, bounded problem solving. Do not use to diagnose, provide therapy, manufacture certainty, or lower goals for reassurance.
development
Build, review, debug, package, and test Roslyn diagnostic analyzers, code fix providers, and incremental source generators. Use for DiagnosticAnalyzer, CodeFixProvider, IIncrementalGenerator, IOperation analysis, Microsoft.CodeAnalysis dependency pinning, Roslyn test harnesses, C#/VB tests, and analyzer NuGet packaging.
testing
Migrates a project that uses checked-in .designer.cs files behind .resx to using a source-generator instead
development
Polish any GitHub repository's surface — labels (emoji rating tiers, P0–P3 priority, impact severity), issue forms, PR template, CI workflows, CODEOWNERS, rulesets, docs. Repo meta & config only — no code logic touched. Use when creating a new repo or polishing an existing one.