{"id":"ea4e55b5-a803-480c-8fb6-cbdbd47fc2f1","shortId":"hJJPce","kind":"skill","title":"Ruff Recursive Fix","tagline":"Awesome Copilot skill by Github","description":"# Ruff Recursive Fix\n\n## Overview\n\nUse this skill to enforce code quality with Ruff in a controlled, iterative workflow.\nIt supports:\n\n- Optional scope limitation to a specific folder.\n- Default project settings from `pyproject.toml`.\n- Flexible Ruff invocation (`uv`, direct `ruff`, `python -m ruff`, or equivalent).\n- Optional per-run rule overrides (`--select`, `--ignore`, `--extend-select`, `--extend-ignore`).\n- Automatic safe then unsafe autofixes.\n- Diff review after each fix pass.\n- Recursive repetition until findings are resolved or require a decision.\n- Judicious use of inline `# noqa` only when suppression is justified.\n\n## Inputs\n\nCollect these inputs before running:\n\n- `target_path` (optional): folder or file to check. Empty means whole repository.\n- `ruff_runner` (optional): explicit Ruff command prefix (for example `uv run`, `ruff`, `python -m ruff`, `pipx run ruff`).\n- `rules_select` (optional): comma-separated rule codes to enforce.\n- `rules_ignore` (optional): comma-separated rule codes to ignore.\n- `extend_select` (optional): extra rules to add without replacing configured defaults.\n- `extend_ignore` (optional): extra ignored rules without replacing configured defaults.\n- `allow_unsafe_fixes` (default: true): whether to run Ruff unsafe fixes.\n- `ask_on_ambiguity` (default: true): always ask the user when multiple valid choices exist.\n\n## Command Construction\n\nBuild Ruff commands from inputs.\n\n### 0. Resolve Ruff Runner\n\nDetermine a reusable `ruff_cmd` prefix before building commands.\n\nResolution order:\n\n1. If `ruff_runner` is provided, use it as-is.\n2. Else if `uv` is available and Ruff is managed through `uv`, use `uv run ruff`.\n3. Else if `ruff` is available on `PATH`, use `ruff`.\n4. Else if Python is available and Ruff is installed in that environment, use `python -m ruff`.\n5. Else use any project-specific equivalent that invokes installed Ruff (for example `pipx run ruff`), or stop and ask the user.\n\nUse the same resolved `ruff_cmd` for all `check` and `format` commands in the workflow.\n\nBase command:\n\n```bash\n<ruff_cmd> check\n```\n\nFormatter command:\n\n```bash\n<ruff_cmd> format\n```\n\nWith optional target:\n\n```bash\n<ruff_cmd> format <target_path>\n```\n\nAdd optional target:\n\n```bash\n<ruff_cmd> check <target_path>\n```\n\nAdd optional overrides as needed:\n\n```bash\n--select <codes>\n--ignore <codes>\n--extend-select <codes>\n--extend-ignore <codes>\n```\n\nExamples:\n\n```bash\n# Full project with defaults from pyproject.toml\nruff check\n\n# One folder with defaults\npython -m ruff check src/models\n\n# Override to skip docs and TODO-like rules for this run\nuv run ruff check src --extend-ignore D,TD\n\n# Check only selected rules in a folder\nruff check src/data --select F,E9,I\n```\n\n## Workflow\n\n### 1. Baseline Analysis\n\n1. Run `<ruff_cmd> check` with the selected scope and options.\n2. Classify findings by type:\n\t- Autofixable safe.\n\t- Autofixable unsafe.\n\t- Not autofixable.\n3. If no findings remain, stop.\n\n### 2. Safe Autofix Pass\n\n1. Run Ruff with `--fix` using the same scope/options.\n2. Review resulting diff carefully for semantic correctness and style consistency.\n3. Run `<ruff_cmd> format` on the same scope.\n4. Re-run `<ruff_cmd> check` to refresh remaining findings.\n\n### 3. Unsafe Autofix Pass\n\nRun only if findings remain and `allow_unsafe_fixes=true`.\n\n1. Run Ruff with `--fix --unsafe-fixes` using the same scope/options.\n2. Review resulting diff carefully, prioritizing behavior-sensitive edits.\n3. Run `<ruff_cmd> format` on the same scope.\n4. Re-run `<ruff_cmd> check`.\n\n### 4. Manual Remediation Pass\n\nFor remaining findings:\n\n1. Fix directly in code when there is a clear, safe correction.\n2. Keep edits minimal and local.\n3. Run `<ruff_cmd> format` on the same scope.\n4. Re-run `<ruff_cmd> check`.\n\n### 5. Ambiguity Policy\n\nIf there are multiple valid solutions at any step, always ask the user before proceeding.\nDo not choose silently between equivalent options.\n\n### 6. Suppression Decision (`# noqa`)\n\nUse suppression only when all conditions are true:\n\n- The rule conflicts with required behavior, public API, framework conventions, or readability goals.\n- Refactoring would be disproportionate to the value of the rule.\n- The suppression is narrow and specific (single line, explicit code when possible).\n\nGuidelines:\n\n- Prefer `# noqa: <RULE>` over broad `# noqa`.\n- Add a brief reason comment for non-obvious suppressions.\n- If two or more valid outcomes exist, always ask the user which option to prefer.\n\n### 7. Recursive Loop and Stop Criteria\n\nRepeat steps 2 to 6 until one of these outcomes:\n\n- `<ruff_cmd> check` returns clean.\n- Remaining findings require architectural/product decisions.\n- Remaining findings are intentionally suppressed with documented rationale.\n- Repeated loop makes no progress.\n\nEach loop iteration must include `<ruff_cmd> format` before the next `<ruff_cmd> check`.\n\nWhen no progress is detected:\n\n1. Summarize blocked rules and affected files.\n2. Present valid options and trade-offs.\n3. Ask the user to choose.\n\n## Quality Gates\n\nBefore declaring completion:\n\n- Ruff returns no unexpected findings for the chosen scope/options.\n- All autofix diffs are reviewed for correctness.\n- No suppression is added without explicit justification.\n- Any unsafe fix with possible behavioral impact is highlighted to the user.\n- Ruff formatting is executed in every iteration.\n\n## Output Contract\n\nAt the end of execution, report:\n\n- Scope and Ruff options used.\n- Number of iterations performed.\n- Summary of fixed findings.\n- List of manual fixes.\n- List of suppressions with rationale.\n- Remaining findings, if any, and required user decisions.\n\n## Suggested Prompt Starters\n\n- \"Run ruff-recursive-fix on the whole repo with default config.\"\n- \"Run ruff-recursive-fix only on src/models, ignore DOC rules.\"\n- \"Run ruff-recursive-fix on tests with select F,E9,I and no unsafe fixes.\"\n- \"Run ruff-recursive-fix on src/data and ask me before adding any noqa.\"","tags":["ruff","recursive","fix","awesome","copilot","github"],"capabilities":["skill","source-github","category-awesome-copilot"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/ruff-recursive-fix","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T03:40:33.542Z","embedding":null,"createdAt":"2026-04-18T20:33:58.263Z","updatedAt":"2026-04-22T03:40:33.542Z","lastSeenAt":"2026-04-22T03:40:33.542Z","tsv":"'0':206 '1':221,401,404,434,484,525,710 '2':232,413,430,443,496,537,666,717 '3':248,424,454,470,506,543,725 '4':258,461,513,518,550 '5':275,555 '6':580,668 '7':658 'ad':755,869 'add':159,326,331,633 'affect':715 'allow':174,480 'alway':190,567,650 'ambigu':187,556 'analysi':403 'api':599 'architectural/product':680 'as-i':229 'ask':185,191,295,568,651,726,866 'autofix':70,418,420,423,432,472,746 'automat':66 'avail':237,253,263 'awesom':4 'base':313 'baselin':402 'bash':315,319,324,329,336,346 'behavior':503,597,764 'behavior-sensit':502 'block':712 'brief':635 'broad':631 'build':201,217 'care':447,500 'category-awesome-copilot' 'check':110,306,316,330,354,362,379,386,394,406,465,517,554,674,704 'choic':197 'choos':575,730 'chosen':743 'classifi':414 'clean':676 'clear':534 'cmd':214,303 'code':18,140,150,529,624 'collect':98 'comma':137,147 'comma-separ':136,146 'command':120,199,203,218,309,314,318 'comment':637 'complet':735 'condit':589 'config':830 'configur':162,172 'conflict':594 'consist':453 'construct':200 'contract':779 'control':24 'convent':601 'copilot':5 'correct':450,536,751 'criteria':663 'd':384 'decis':86,582,681,815 'declar':734 'default':36,163,173,177,188,350,358,829 'detect':709 'determin':210 'diff':71,446,499,747 'direct':45,527 'disproportion':608 'doc':367,840 'document':688 'e9':398,852 'edit':505,539 'els':233,249,259,276 'empti':111 'end':782 'enforc':17,142 'environ':270 'equival':51,282,578 'everi':776 'exampl':123,288,345 'execut':774,784 'exist':198,649 'explicit':118,623,757 'extend':61,64,153,164,340,343,382 'extend-ignor':63,342,381 'extend-select':60,339 'extra':156,167 'f':397,851 'file':108,716 'find':80,415,427,469,477,524,678,683,740,798,809 'fix':3,11,75,176,184,438,482,488,491,526,761,797,802,823,835,846,857,862 'flexibl':41 'folder':35,106,356,392 'format':308,320,325,456,508,545,700,772 'formatt':317 'framework':600 'full':347 'gate':732 'github':8 'goal':604 'guidelin':627 'highlight':767 'ignor':59,65,144,152,165,168,338,344,383,839 'impact':765 'includ':699 'inlin':90 'input':97,100,205 'instal':267,285 'intent':685 'invoc':43 'invok':284 'iter':25,697,777,793 'judici':87 'justif':758 'justifi':96 'keep':538 'like':371 'limit':31 'line':622 'list':799,803 'local':542 'loop':660,691,696 'm':48,128,273,360 'make':692 'manag':241 'manual':519,801 'mean':112 'minim':540 'multipl':195,561 'must':698 'narrow':618 'need':335 'next':703 'non':640 'non-obvi':639 'noqa':91,583,629,632,871 'number':791 'obvious':641 'off':724 'one':355,670 'option':29,52,105,117,135,145,155,166,322,327,332,412,579,655,720,789 'order':220 'outcom':648,673 'output':778 'overrid':57,333,364 'overview':12 'pass':76,433,473,521 'path':104,255 'per':54 'per-run':53 'perform':794 'pipx':130,289 'polici':557 'possibl':626,763 'prefer':628,657 'prefix':121,215 'present':718 'priorit':501 'proceed':572 'progress':694,707 'project':37,280,348 'project-specif':279 'prompt':817 'provid':226 'public':598 'pyproject.toml':40,352 'python':47,127,261,272,359 'qualiti':19,731 'rational':689,807 're':463,515,552 're-run':462,514,551 'readabl':603 'reason':636 'recurs':2,10,77,659,822,834,845,861 'refactor':605 'refresh':467 'remain':428,468,478,523,677,682,808 'remedi':520 'repeat':664,690 'repetit':78 'replac':161,171 'repo':827 'report':785 'repositori':114 'requir':84,596,679,813 'resolut':219 'resolv':82,207,301 'result':445,498 'return':675,737 'reusabl':212 'review':72,444,497,749 'ruff':1,9,21,42,46,49,115,119,126,129,132,182,202,208,213,223,239,247,251,257,265,274,286,291,302,353,361,378,393,436,486,736,771,788,821,833,844,860 'ruff-recursive-fix':820,832,843,859 'rule':56,133,139,143,149,157,169,372,389,593,614,713,841 'run':55,102,125,131,181,246,290,375,377,405,435,455,464,474,485,507,516,544,553,819,831,842,858 'runner':116,209,224 'safe':67,419,431,535 'scope':30,410,460,512,549,786 'scope/options':442,495,744 'select':58,62,134,154,337,341,388,396,409,850 'semant':449 'sensit':504 'separ':138,148 'set':38 'silent':576 'singl':621 'skill':6,15 'skip':366 'solut':563 'source-github' 'specif':34,281,620 'src':380 'src/data':395,864 'src/models':363,838 'starter':818 'step':566,665 'stop':293,429,662 'style':452 'suggest':816 'summar':711 'summari':795 'support':28 'suppress':94,581,585,616,642,686,753,805 'target':103,323,328 'td':385 'test':848 'todo':370 'todo-lik':369 'trade':723 'trade-off':722 'true':178,189,483,591 'two':644 'type':417 'unexpect':739 'unsaf':69,175,183,421,471,481,490,760,856 'unsafe-fix':489 'use':13,88,227,244,256,271,277,298,439,492,584,790 'user':193,297,570,653,728,770,814 'uv':44,124,235,243,245,376 'valid':196,562,647,719 'valu':611 'whether':179 'whole':113,826 'without':160,170,756 'workflow':26,312,400 'would':606","prices":[{"id":"b503fbe0-6b68-4195-a222-ecff2c58673f","listingId":"ea4e55b5-a803-480c-8fb6-cbdbd47fc2f1","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:33:58.263Z"}],"sources":[{"listingId":"ea4e55b5-a803-480c-8fb6-cbdbd47fc2f1","source":"github","sourceId":"github/awesome-copilot/ruff-recursive-fix","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/ruff-recursive-fix","isPrimary":false,"firstSeenAt":"2026-04-18T21:51:08.555Z","lastSeenAt":"2026-04-22T00:52:17.066Z"},{"listingId":"ea4e55b5-a803-480c-8fb6-cbdbd47fc2f1","source":"skills_sh","sourceId":"github/awesome-copilot/ruff-recursive-fix","sourceUrl":"https://skills.sh/github/awesome-copilot/ruff-recursive-fix","isPrimary":true,"firstSeenAt":"2026-04-18T20:33:58.263Z","lastSeenAt":"2026-04-22T03:40:33.542Z"}],"details":{"listingId":"ea4e55b5-a803-480c-8fb6-cbdbd47fc2f1","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"ruff-recursive-fix","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/ruff-recursive-fix"},"updatedAt":"2026-04-22T03:40:33.542Z"}}