migration-patterns-plugin/skills/flake8-to-ruff/SKILL.md
Migrate Python linting from flake8/isort to ruff. Use when pycqa/flake8 or PyCQA/isort is in .pre-commit-config.yaml or [tool.flake8]/[tool.isort] config exists.
npx skillsauth add laurigates/claude-plugins flake8-to-ruffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Migrate from flake8 and/or isort to ruff — consolidating linting and import sorting into a single, fast Rust-based tool. Replaces pre-commit hooks, migrates rule configuration, and removes old dependencies.
| Use this skill when... | Keep flake8/isort when... |
|------------------------|--------------------------|
| .pre-commit-config.yaml contains pycqa/flake8 or PyCQA/isort | You rely on a flake8 plugin with no ruff equivalent |
| [tool.flake8] or [tool.isort] config exists | Team uses flake8 API in custom scripts |
| Looking to consolidate linting tooling | CI requires specific flake8 exit codes |
| Using ruff format and wanting a unified tool | |
find . -maxdepth 1 -name '.pre-commit-config.yaml'find . -maxdepth 1 -name 'pyproject.toml'find . -maxdepth 1 -name 'setup.cfg'find . -maxdepth 1 -name '.flake8'find . -maxdepth 1 -name 'ruff.toml'| Parameter | Description |
|-----------|-------------|
| --check-only | Report what would change without modifying files |
| --fix | Apply migration automatically |
Execute this flake8/isort-to-ruff migration:
.pre-commit-config.yaml and locate pycqa/flake8, PyCQA/isort, and pycqa/pep8-naming entries.pyproject.toml ([tool.flake8], [tool.isort]), setup.cfg ([flake8], [isort]), .flake8.flake8/isort → ruff migration audit
=====================================
pre-commit hooks: pycqa/flake8 v<rev>, PyCQA/isort v<rev>
flake8 config: [tool.flake8] max-line-length=<N>, extend-ignore=[E501,W503], per-file-ignores=<...>
isort config: [tool.isort] profile=black, known-first-party=[...]
ruff already: EXISTS / NOT PRESENT
If --check-only, stop here.Map flake8 plugins and ignore rules to ruff equivalents:
| flake8 config | ruff equivalent |
|---------------|----------------|
| max-line-length = N | [tool.ruff] line-length = N |
| extend-ignore = E501 | [tool.ruff.lint] ignore = ["E501"] |
| per-file-ignores = path:E501 | [tool.ruff.lint.per-file-ignores] "path" = ["E501"] |
| pep8-naming plugin | add "N" to select |
| flake8-bugbear plugin | add "B" to select |
| flake8-annotations plugin | add "ANN" to select |
For isort config:
| isort config | ruff equivalent |
|--------------|----------------|
| profile = black | [tool.ruff.lint.isort] force-single-line = false |
| known-first-party = [...] | [tool.ruff.lint.isort] known-first-party = [...] |
| multi-line-output = 3 | Handled by ruff's Black-compatible default |
| force-sort-within-sections | [tool.ruff.lint.isort] force-sort-within-sections = true |
Baseline ruff rule selection (add to existing if present):
[tool.ruff.lint]
select = ["E", "W", "F", "I", "N", "B"]
# E/W = pycodestyle, F = pyflakes, I = isort, N = pep8-naming, B = bugbear
Preserve any existing ignores from flake8 config.
Remove pycqa/flake8, PyCQA/isort, and any flake8 plugin repos. Add or extend the ruff pre-commit block:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1 # use latest stable ruff version
hooks:
- id: ruff
args: [--fix]
- id: ruff-format # include if also migrating from black
[tool.flake8] and [tool.isort] sections.[tool.ruff], [tool.ruff.lint], and [tool.ruff.lint.isort] sections with converted config.flake8* and isort from dev/lint dependencies:
uvx --from uv uv remove --dev flake8 isort 2>/dev/null || true
If standalone config files exist, delete them:
.flake8 → delete (config is now in pyproject.toml)setup.cfg [flake8]/[isort] sections → remove those sectionsRun the new hook to confirm it works:
pre-commit run ruff --all-files
Note any new lint errors introduced by ruff's stricter defaults. Decide whether to:
[tool.ruff.lint] ignorePrint a summary:
flake8/isort → ruff migration complete
========================================
.pre-commit-config.yaml UPDATED (removed flake8/isort hooks, added ruff hook)
pyproject.toml UPDATED ([tool.flake8]+[tool.isort] → [tool.ruff.lint])
.flake8 DELETED / NOT FOUND
setup.cfg UPDATED (removed [flake8]/[isort] sections) / NOT FOUND
Note: Ruff may surface new lint errors not caught by flake8. Review with:
uvx ruff check . --select E,W,F,I,N,B
Files to stage:
git add .pre-commit-config.yaml pyproject.toml .flake8 setup.cfg
| Context | Command |
|---------|---------|
| Audit only | /migration-patterns:flake8-to-ruff --check-only |
| Apply migration | /migration-patterns:flake8-to-ruff --fix |
| Verify after migration | pre-commit run ruff --all-files |
| Check with specific rules | uvx ruff check . --select E,W,F,I |
| Item | Value |
|------|-------|
| ruff rule docs | https://docs.astral.sh/ruff/rules/ |
| isort equivalent | select "I" in ruff |
| pep8-naming equivalent | select "N" in ruff |
| Config section | [tool.ruff.lint] and [tool.ruff.lint.isort] |
/migration-patterns:black-to-ruff-format — Migrate black to ruff format/migration-patterns:mypy-to-ty — Migrate mypy to ty/configure:repo — End-to-end repo config drivertools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.