Skip to main content
skill GitHub Copilot official · GitHub

ruff-recursive-fix — GitHub Copilot skill: install

Runs Ruff in a chosen scope, applies safe and unsafe fixes in passes, and asks for a decision when an automated correction is ambiguous.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill ruff-recursive-fix
Open on GitHub

What ruff-recursive-fix does

ruff-recursive-fix checks the whole repository or a selected file or folder. It uses project settings from pyproject.toml and accepts per-run rule overrides through --select, --ignore, --extend-select, and --extend-ignore. You can also choose the Ruff runner, such as uv run ruff, ruff, python -m ruff, or a project equivalent.

The workflow starts with a baseline check, then runs safe fixes, formats the same scope, and checks again. If findings remain, the skill can run --unsafe-fixes, review the resulting diff, and move to targeted manual edits. It repeats the cycle until Ruff is clean, a decision is needed, or progress stops. # noqa is reserved for justified, narrow suppressions.

Install it when you want Ruff changes reviewed after each pass and user input for competing fixes. Prepare a working Ruff command first, especially when the project does not expose Ruff through its configured environment.

What it helps with

  • check a full repository with Ruff
  • limit linting to one folder or file
  • apply safe fixes in controlled passes
  • recheck code after formatting
  • resolve findings that need a manual choice

Example prompts for the agent

  • Run ruff-recursive-fix across the whole repository with the default config.
  • Check `src/models`, ignore DOC rules, and review the diff after each fix pass.
  • Run it on `tests` with `--select F,E9,I` and no unsafe fixes.

How to install ruff-recursive-fix

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill ruff-recursive-fix

2GitHub CLI

gh skill install github/awesome-copilot ruff-recursive-fix

3Manually: put the files in place

.github/skills/ruff-recursive-fix/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

swiftui-liquid-glass official OpenAI This skill helps build and review SwiftUI Liquid Glass interfaces for iOS 26+. Use it when adopting the API or checking fallbacks, interaction, and design fit. CX Codex GP ChatGPT 121installs ai-debt-detector Adit Jain This skill audits AI-generated code for missed failure paths, orphaned resources, fake dependencies, and architecture drift before a merge. Claude Code CX Codex Cursor 2,900installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs codebase-design Matt Pocock This skill helps design modules with small interfaces and hidden complexity. Use it when refactoring code, choosing a seam, or making tests easier to write. Claude Code 850,344installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. Claude Code 789,521installs implement Matt Pocock Implements work from a specification or tickets, following a test-driven flow and ending with review and a commit. Use it when a coding task needs a defined delivery routine. Claude Code 774,700installs

Questions about ruff-recursive-fix

How do I install ruff-recursive-fix in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill ruff-recursive-fix. The skill file is placed at .github/skills/ruff-recursive-fix/SKILL.md.

What does ruff-recursive-fix do?

It runs Ruff for the selected scope, applies safe and unsafe autofixes in separate passes, formats the code, and repeats the check until it is clean or needs a user decision.

Does the skill require Ruff to be installed?

It needs a command that can run Ruff. The workflow supports uv run ruff, ruff, python -m ruff, or another project-specific equivalent that invokes the installed tool.

Source text

SKILL.md · MIT
---
name: ruff-recursive-fix
description: 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.
---

# Ruff Recursive Fix

## Overview

Use this skill to enforce code quality with Ruff in a controlled, iterative workflow.
It supports:

- Optional scope limitation to a specific folder.
- Default project settings from `pyproject.toml`.
- Flexible Ruff invocation (`uv`, direct `ruff`, `python -m ruff`, or equivalent).
- Optional per-run rule overrides (`--select`, `--ignore`, `--extend-select`, `--extend-ignore`).
- Automatic safe then unsafe autofixes.
- Diff review after each fix pass.
- Recursive repetition until findings are resolved or require a decision.
- Judicious use of inline `# noqa` only when suppression is justified.

## Inputs

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.

## Command Construction

Build Ruff commands from inputs.

### 0. Resolve Ruff Runner

Determine a reusable `ruff_cmd` prefix before building commands.

Resolution order:

1. If `ruff_runner` is provided, use it as-is.
2. Else if `uv` is available and Ruff is managed through `uv`, use `uv run ruff`.
3. Else if `ruff` is available on `PATH`, use `ruff`.
4. Else if Python is available and Ruff is installed in that environment, use `python -m ruff`.
5. Else use any project-specific equivalent that invokes installed Ruff (for example `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
```

## Workflow

### 1. Baseline Analysis

1. Run `<ruff_cmd> check` with the selected scope and options.
2. Classify findings by type:
	- Autofixable safe.
	- Autofixable unsafe.
	- Not autofixable.
3. If no findings remain, stop.

### 2. Safe Autofix Pass

1. Run Ruff with `--fix` using the same scope/options.
2. Review resulting diff carefully for semantic correctness and style consistency.
3. Run `<ruff_cmd> format` on the same scope.
4. Re-run `<ruff_cmd> check` to refresh remaining findings.

### 3. Unsafe Autofix Pass

Run only if findings remain and `allow_unsafe_fixes=true`.

1. Run Ruff with `--fix --unsafe-fixes` using the same scope/options.
2. Review resulting diff carefully, prioritizing behavior-sensitive edits.
3. Run `<ruff_cmd> format` on the same scope.
4. Re-run `<ruff_cmd> check`.

### 4. Manual Remediation Pass

For remaining findings:

1. Fix directly in code when there is a clear, safe correction.
2. Keep edits minimal and local.
3. Run `<ruff_cmd> format` on the same scope.
4. Re-run `<ruff_cmd> check`.

### 5. Ambiguity Policy

If there are multiple valid solutions at any step, always ask the user before proceeding.
Do not choose silently between equivalent options.

### 6. Suppression Decision (`# noqa`)

Use suppression only when all conditions are true:

- The rule conflicts with required behavior, public API, framework conventions, or readability goals.
- Refactoring would be disproportionate to the value of the rule.
- The suppression is narrow and specific (single line, explicit code when possible).

Guidelines:

- Prefer `# noqa: <RULE>` over broad `# noqa`.
- Add a brief reason comment for non-obvious suppressions.
- If two or more valid outcomes exist, always ask the user which option to prefer.

### 7. Recursive Loop and Stop Criteria

Repeat steps 2 to 6 until one of these outcomes:

- `<ruff_cmd> check` returns clean.
- Remaining findings require architectural/product decisions.
- Remaining findings are intentionally suppressed with documented rationale.
- Repeated loop makes no progress.

Each loop iteration must include `<ruff_cmd> format` before the next `<ruff_cmd> check`.

When no progress is detected:

1. Summarize blocked rules and affected files.
2. Present valid options and trade-offs.
3. Ask the user to choose.

## Quality Gates

Before declaring completion:

- Ruff returns no unexpected findings for the chosen scope/options.
- All autofix diffs are reviewed for correctness.
- No suppression is added without explicit justification.
- Any unsafe fix with possible behavioral impact is highlighted to the user.
- Ruff formatting is executed in every iteration.

## Output Contract

At the end of execution, report:

- Scope and Ruff options used.
- Number of iterations performed.
- Summary of fixed findings.
- List of manual fixes.
- List of suppressions with rationale.
- Remaining findings, if any, and required user decisions.

## Suggested Prompt Starters

- "Run ruff-recursive-fix on the whole repo with default config."
- "Run ruff-recursive-fix only on src/models, ignore DOC rules."
- "Run ruff-recursive-fix on tests with select F,E9,I and no unsafe fixes."
- "Run ruff-recursive-fix on src/data and ask me before adding any noqa."

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor