ruff-dev
npx skills add https://github.com/ghosttypes/ff-5mp-api-py --skill ruff-dev
Agent 安装分布
Skill 文档
Ruff Professional Development
Version: 0.14.10 (Documentation generated December 2025)
Overview
Ruff is an extremely fast Python linter and formatter written in Rust. It combines the functionality of multiple Python tools (Flake8, isort, Black, pyupgrade, and more) into a single high-performance tool.
This skill provides comprehensive guidance for:
- Configuring and integrating Ruff into Python projects
- Understanding and fixing lint rule violations
- Formatting Python code with Ruff’s formatter
- Setting up editor integrations
- Migrating from other Python tooling
Quick Start
Installation
See references/installation.md for complete installation instructions across all platforms and package managers.
Basic Usage
Linting:
ruff check . # Lint all files
ruff check path/to/file.py # Lint specific file
ruff check --fix . # Auto-fix violations
Formatting:
ruff format . # Format all files
ruff format path/to/file.py # Format specific file
ruff format --check . # Check formatting without changes
Configuration:
# pyproject.toml or ruff.toml
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = ["E501"]
See references/configuration.md for comprehensive configuration options.
Core Workflows
1. Integrating Ruff into a Project
Steps:
- Install Ruff (see
references/installation.md) - Create initial configuration (see
references/configuration.md) - Run initial check:
ruff check . - Review and configure rules (see
references/settings.md) - Set up pre-commit hooks or CI integration (see
references/integrations.md)
2. Fixing Lint Violations
Process:
- Run
ruff check .to identify violations - For specific rule violations, reference
references/rules/<rule-name>.md - Apply automatic fixes:
ruff check --fix . - Manual fixes for remaining violations using rule documentation
Finding Rule Documentation:
- All 937 rules are in
references/rules/ - Rules are named by their description (e.g.,
unused-import.md,line-too-long.md) - See
references/rules/rules.mdfor complete rule index
3. Code Formatting
Workflow:
- Review formatter overview:
references/formatter/overview.md - Configure formatter settings in
pyproject.toml - Run formatter:
ruff format . - For Black compatibility: see
references/formatter/black.md
4. Editor Integration
Setup:
- Review
references/editors/overview.mdfor editor support - Follow setup instructions:
references/editors/setup.md - Configure editor settings:
references/editors/settings.md - Explore editor features:
references/editors/features.md
5. Migrating from Other Tools
Migration paths:
- From Black: See
references/formatter/black.md - From Flake8/isort/pyupgrade: See
references/configuration.mdfor rule equivalents - General migration: See
references/tutorial.mdfor migration guidance
Documentation Organization
This skill includes comprehensive reference documentation organized for efficient access:
Navigation Guide: references/INDEX.md – Complete index of all documentation with use-case based navigation
Core Documentation:
configuration.md– Complete configuration referencesettings.md– All available settings and optionslinter.md– Linter functionality and configurationtutorial.md– Comprehensive getting started guide
Formatter:
formatter/overview.md– Formatter basicsformatter/black.md– Black compatibility
Rules (937 total):
rules/rules.md– Rules overview and indexrules/<rule-name>.md– Individual rule documentation
Editor Integration:
editors/overview.md– Editor support overvieweditors/setup.md– Installation instructionseditors/features.md– Available featureseditors/settings.md– Configuration options
Other Resources:
installation.md– Installation guideintegrations.md– CI/CD and tool integrationsversioning.md– Versioning and compatibilitypreview.md– Preview featuresfaq.md– Frequently asked questionscontributing.md– Contributing to Ruff
Finding Specific Information
For configuration questions:
- Start with
references/settings.mdfor all available options - Review
references/configuration.mdfor configuration patterns - Check
references/linter.mdorreferences/formatter/overview.mdfor component-specific settings
For rule violations:
- Note the rule code/name from error message
- Find corresponding file in
references/rules/ - Rules are alphabetically named (e.g., E501 â
line-too-long.md)
For editor setup:
- Check
references/editors/overview.mdfor supported editors - Follow
references/editors/setup.mdfor your editor - Configure with
references/editors/settings.md
For tool migration:
- Review
references/tutorial.mdfor general guidance - See
references/formatter/black.mdfor Black-specific migration - Check
references/configuration.mdfor rule mapping from other linters
Included Scripts
This skill includes Python scripts for updating documentation (located in scripts/):
- scrape_ruff_docs.py – Scrape a single Ruff documentation page
- discover_ruff_docs.py – Discover all Ruff documentation URLs
- bulk_scrape_ruff.py – Bulk scrape all Ruff documentation
These scripts use cloudscraper, BeautifulSoup, and markdownify to fetch and convert Ruff documentation.
Best Practices
When configuring Ruff:
- Start with defaults and incrementally add rules
- Use
selectto enable rule categories,ignorefor exceptions - Test configuration changes incrementally
- Document reasoning for ignored rules in comments
When fixing violations:
- Review auto-fixes before committing
- Understand the rule before ignoring it
- Use inline ignores (
# noqa) sparingly - Consider if the rule should be disabled project-wide
When formatting:
- Run formatter before linter to avoid conflicts
- Configure line length consistently across tools
- Use
--checkin CI to verify formatting - Format entire codebase at once when first adopting
When integrating:
- Set up editor integration for immediate feedback
- Add pre-commit hooks for team consistency
- Include in CI pipeline with appropriate settings
- Document Ruff configuration in project README
Advanced Usage
Performance optimization:
- Use
--cache-dirfor faster repeated runs - Configure file exclusions to skip irrelevant paths
- Leverage parallel execution (default behavior)
Preview features:
- See
references/preview.mdfor experimental features - Enable with
preview = truein configuration - Test preview rules before enabling in production
Custom rule selection:
- Combine rule categories:
select = ["E", "F", "I", "N"] - Use per-file ignores for specific patterns
- Configure different rules for different directories
Documentation Coverage
This skill provides complete coverage of Ruff v0.14.10:
- 937 individual rule documentation files
- Full configuration and settings reference
- Complete editor integration guides
- Formatter documentation including Black compatibility
- Installation, integration, and migration guides
- FAQ and troubleshooting resources
All documentation is current as of December 2025 and reflects the latest stable release (0.14.10).