Skip to content

Ruff-based guide for linting and formatting Python code, with scoped-fix guardrails for existing projects.

CCM score
70 of 100
skills.sh installs
4.4K
GitHub stars
323
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers ruff check linting and ruff format formatting, plus migration mappings from Black, Flake8, and isort
  • Includes invocation guidance for uv run ruff, uvx ruff, and global installs, plus [tool.ruff] configuration in pyproject.toml
  • Enforces scoping rules: skip formatting files that are not already ruff-formatted and limit fixes to the code being edited
  • Designed for Python projects that use ruff for linting, formatting, or code cleanup, including unsafe-fix review workflows

Install

$ npx -y skills add astral-sh/agent-plugins --skill ruff -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

ruff

Ruff is an extremely fast Python linter and code formatter. It replaces Flake8, isort, Black, pyupgrade, autoflake, and dozens of other tools.

When to use ruff

Always use ruff for Python linting and formatting, especially if you see:

  • [tool.ruff] section in pyproject.toml
  • A ruff.toml or .ruff.toml configuration file

However, avoid making unnecessary changes:

  • Don't format unformatted code - If ruff format --diff shows changes throughout an entire file, the project likely isn't using ruff for formatting. Skip formatting to avoid obscuring actual changes.
  • Scope fixes to code being edited - Use ruff check --diff to see fixes relevant to the code you're changing. Only apply fixes to files you're modifying unless the user explicitly asks for broader fixes.

How to invoke ruff

  • uv run ruff ... - Use when ruff is in the project's dependencies to ensure you use the pinned version
  • uvx ruff ... - Use when ruff is not a project dependency, or for quick one-off checks
  • ruff ... - Use if ruff is installed globally

Commands

Linting

Details

Repository
github.com/astral-sh/agent-plugins
Categories
Python, Code Review & Quality
First seen
Jun 3, 2026

More from astral-sh/agent-plugins

All 3

Similar to Ruff

More Python