Use ruff to lint, format, and modernize Python code. Activate when: (1) Fixing PEP 8 violations, (2) Removing unused imports, (3) Upgrading deprecated Python syntax (UP rules), (4) Auto-fixing code quality issues, (5) Formatting Python files, or (6) Replacing Flake8, isort, pyupgrade, autoflake, or Black.
Lints, formats, and modernizes Python code using Ruff with auto-fix capabilities.
npx claudepluginhub flexnetos/ripple-envThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Ruff is an extremely fast Python linter and code formatter written in Rust. It is 10-100x faster than traditional tools like Flake8 and Black, enabling sub-second feedback loops on even the largest codebases.
Ruff is a drop-in replacement for Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, autoflake, and more.
--fix# Lint all Python files in current directory
ruff check .
# Lint and auto-fix issues
ruff check --fix .
# Format Python files (like Black)
ruff format .
# Check formatting without modifying files
ruff format --check .
# Show diff of what would change
ruff format --diff .
# Lint specific file
ruff check path/to/file.py
# Watch mode for continuous linting
ruff check --watch .
# Show rule explanations
ruff rule <RULE_CODE>
# Select specific rules
ruff check --select E,F,W .
# Ignore specific rules
ruff check --ignore E501 .
# Target Python version
ruff check --target-version py311 .
# Output format options
ruff check --output-format=json .
ruff check --output-format=github .
# Show statistics
ruff check --statistics .
| Prefix | Category | Description |
|---|---|---|
| E | pycodestyle errors | PEP 8 error violations |
| W | pycodestyle warnings | PEP 8 warning violations |
| F | Pyflakes | Logical errors, undefined names |
| UP | pyupgrade | Modernize Python syntax |
| I | isort | Import sorting |
| B | flake8-bugbear | Bug risk patterns |
| C4 | flake8-comprehensions | Comprehension improvements |
| SIM | flake8-simplify | Code simplification |
| RUF | Ruff-specific | Ruff's own rules |
These rules upgrade deprecated Python syntax:
# Run only pyupgrade rules
ruff check --select UP .
# Common UP rules:
# UP001: Remove unnecessary encoding in open()
# UP003: Use {} instead of type()
# UP004: Remove useless object inheritance
# UP005: Replace deprecated unittest assertions
# UP006: Use type instead of Type for builtins
# UP007: Use X | Y for union types
# UP008: Use super() without arguments
# UP009: Remove unnecessary UTF-8 encoding declarations
# UP010: Remove unnecessary __future__ imports
# UP015: Remove unnecessary mode='r' in open()
# UP018: Use native str/bytes/int instead of literals
# UP032: Use f-strings instead of .format()
# UP034: Remove extraneous parentheses
# UP035: Replace deprecated imports
# UP036: Remove outdated version blocks
# UP037: Remove quotes from type annotations
[tool.ruff]
# Target Python version
target-version = "py311"
# Line length (default 88, like Black)
line-length = 88
# Exclude patterns
exclude = [
".git",
".venv",
"__pycache__",
"build",
"dist",
]
[tool.ruff.lint]
# Enable these rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"UP", # pyupgrade
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
# Ignore specific rules
ignore = [
"E501", # line too long (handled by formatter)
]
# Allow autofix for all rules
fixable = ["ALL"]
[tool.ruff.lint.isort]
# Known first-party imports
known-first-party = ["mypackage"]
[tool.ruff.format]
# Use double quotes (like Black)
quote-style = "double"
# Indent with spaces
indent-style = "space"
# Respect magic trailing commas
skip-magic-trailing-comma = false
# Check what would be upgraded
ruff check --select UP --diff .
# Apply all pyupgrade fixes
ruff check --select UP --fix .
# Check and fix all issues
ruff check --fix .
ruff format .
# Fail on any issues (good for CI)
ruff check .
ruff format --check .
# GitHub Actions output format
ruff check --output-format=github .
# .pre-commit-config.yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
target-version to your minimum Python versionruff format after ruff check --fix| Tool | Ruff Equivalent |
|---|---|
| Flake8 | ruff check |
| Black | ruff format |
| isort | ruff check --select I --fix |
| pyupgrade | ruff check --select UP --fix |
| autoflake | ruff check --select F401,F841 --fix |
For comprehensive documentation, see references/ruff-rules.md.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.