Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
laurigates avatar

Ruff Formatting

  • 70 installs
  • 49 repo stars
  • Updated August 4, 2026
  • laurigates/claude-plugins

Helps with ai & agent building tasks.

About

ruff-formatting is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • ruff-formatting
  • AI & Agent Building
  • AI-coding skill

Ruff Formatting by the numbers

  • 70 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #5,726 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/laurigates/claude-plugins --skill ruff-formatting

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs70
repo stars49
Last updatedAugust 4, 2026
Repositorylaurigates/claude-plugins

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

ruff Formatting

Expert knowledge for using ruff format as an extremely fast Python code formatter with Black compatibility.

When to Use This Skill

Use this skill when...Use another tool instead when...
Formatting Python filesLinting for code issues (use ruff check)
Checking format compliance in CIType checking (use basedpyright)
Migrating from BlackDetecting dead code (use vulture/deadcode)
Setting up format-on-saveRunning tests (use pytest)

Core Expertise

ruff format Advantages

  • 10-30x faster than Black
  • Drop-in Black replacement (99.9% compatible)
  • Written in Rust for performance
  • Supports Black's configuration options
  • Format checking and diff preview
  • Respects .gitignore automatically

Basic Usage

Simple Formatting

# Format current directory
ruff format

# Format specific files or directories
ruff format path/to/file.py
ruff format src/ tests/

# IMPORTANT: Pass directory as parameter to stay in repo root
ruff format services/orchestrator

Format Checking

# Check if files are formatted (exit code 1 if not)
ruff format --check

# Show diff without modifying files
ruff format --diff

# Check specific files
ruff format --check src/ tests/

# Preview changes before applying
ruff format --diff services/orchestrator
ruff format services/orchestrator  # Apply after review

Selective Formatting

# Format only Python files
ruff format src/**/*.py

# Format excluding tests
ruff format --exclude tests/

# Format only changed files (git)
git diff --name-only --diff-filter=d | grep '\.py$' | xargs ruff format

# Format files in specific directory
ruff format src/core/ src/utils/

Configuration

pyproject.toml

[tool.ruff]
line-length = 88
target-version = "py39"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
exclude = [
    "*.pyi",
    "**/__pycache__",
    "**/node_modules",
    ".venv",
]

ruff.toml (standalone)

line-length = 88

[format]
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = false
docstring-code-format = true

Black Compatibility

[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py39"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

Format Workflow

1. Preview: ruff format --diff (see changes) 2. Check: ruff format --check (CI validation) 3. Apply: ruff format (modify files) 4. Verify: ruff format --check (confirm)

Best Practices

  • Pass directory parameter directly: ruff format src/
  • Preview changes first with --diff
  • Use one formatter per project (ruff format replaces Black)
  • Exclude generated files in pyproject.toml
  • Keep pre-commit config in sync with formatter choice
  • Enable docstring-code-format for better docs

Agentic Optimizations

ContextCommand
Format directoryruff format src/
Check formattingruff format --check
Show diffruff format --diff
CI check + diffruff format --check --diff
Format + lintruff format && ruff check
Format changed files`git diff --name-only --diff-filter=d \

Quick Reference

Essential Commands

ruff format                         # Format current directory
ruff format path/to/dir             # Format specific directory
ruff format --check                 # Check if formatted
ruff format --diff                  # Show formatting changes
ruff format file1.py file2.py       # Format specific files
ruff format --exclude tests/        # Exclude directory
ruff format --line-length 100       # Override line length

Format vs Check

CommandPurposeExit CodeModifies Files
ruff formatFormat files0Yes
ruff format --checkValidate formatting1 if unformattedNo
ruff format --diffShow changes0No
ruff format --check --diffValidate + show1 if unformattedNo

Configuration Quick Start

Minimal (Black-compatible)

[tool.ruff]
line-length = 88

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

Recommended

[tool.ruff]
line-length = 88
target-version = "py311"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
docstring-code-format = true
line-ending = "auto"
exclude = [
    "*.pyi",
    "migrations/**/*.py",
]

For detailed examples, advanced patterns, integration guides, and migration checklists, see REFERENCE.md.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.