
ruff-formatting
Python code formatting with ruff format. Fast, Black-compatible formatter. Use when formatting Python files, enforcing style, or checking format compliance.
- Installs
- 81
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/laurigates/claude-plugins --skill ruff-formatting- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ruff-formatting automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 files | Linting for code issues (use ruff check) |
| Checking format compliance in CI | Type checking (use basedpyright) |
| Migrating from Black | Detecting dead code (use vulture/deadcode) |
| Setting up format-on-save | Running 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
.gitignoreautomatically
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
- Preview:
ruff format --diff(see changes) - Check:
ruff format --check(CI validation) - Apply:
ruff format(modify files) - 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-formatfor better docs
Agentic Optimizations
| Context | Command |
|---|---|
| Format directory | ruff format src/ |
| Check formatting | ruff format --check |
| Show diff | ruff format --diff |
| CI check + diff | ruff format --check --diff |
| Format + lint | ruff format && ruff check |
| Format changed files | git diff --name-only --diff-filter=d | grep '\.py$' | xargs ruff format |
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
| Command | Purpose | Exit Code | Modifies Files |
|---|---|---|---|
ruff format | Format files | 0 | Yes |
ruff format --check | Validate formatting | 1 if unformatted | No |
ruff format --diff | Show changes | 0 | No |
ruff format --check --diff | Validate + show | 1 if unformatted | No |
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.
FAQ
What does the ruff-formatting skill do?
Python code formatting with ruff format. Fast, Black-compatible formatter. Use when formatting Python files, enforcing style, or checking format compliance.
How do I install ruff-formatting?
Run npx skills add https://github.com/laurigates/claude-plugins --skill ruff-formatting in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ruff-formatting/ (personal) or .claude/skills/ruff-formatting/ (project).
Which AI agents can use ruff-formatting?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ruff-formatting safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ruff-formatting?
It is published by laurigates in laurigates/claude-plugins. It has 81 recorded installs.
More from laurigates/claude-plugins
python-code-quality
laurigates/claude-plugins
Python code quality with ruff and ty. Use when the user mentions ruff, ty, linting, formatting, type checking, or Python code style.
python-testing
laurigates/claude-plugins
Python testing with pytest, coverage, fixtures, and mocking. Use when the user mentions pytest, unit tests, coverage, fixtures, mocking, or writing Python tests.
pytest-advanced
laurigates/claude-plugins
Advanced pytest: fixtures, markers, parametrization, parallel execution. Use when implementing test infrastructure, writing fixtures, or running with coverage.
uv-workspaces
laurigates/claude-plugins
Manage multi-package Python projects with uv workspaces. Use when the user mentions uv workspaces, Python monorepo, shared lockfiles, or member dependencies.
uv-project-management
laurigates/claude-plugins
Python project setup, deps, and lockfiles with uv. Use when the user mentions uv, creating Python projects, managing dependencies, lockfiles, or pyproject.toml.
Popular security skills
azure-compliance
microsoft/azure-skills
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
minimal-run-and-audit
lllllllama/rigorpilot-skills
Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
firebase-security-rules-auditor
firebase/agent-skills
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.
audit
pbakaus/impeccable
Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
competitors
coreyhaines31/marketingskills
When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.