Python refactor
Skill adryledo/arca-cli/samples/maintainer/skills/python-refactor
Asset Resolution for AI Assistants. Use versioned assets declarations instead of commiting full .md files in your repo, host the assets in any git repo
npx -y skills add adryledo/arca-cli --skill python-refactorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Guidance for refactoring Python code to improve clarity and maintainability. Use this skill when the user asks to simplify Python logic, restructure functions, or improve code quality.
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.3 KB, as published. Nobody here has run it
Python Refactor Skill
This skill provides practical steps for improving Python code structure and readability.
Goals
- Improve maintainability
- Simplify complex logic
- Clarify naming and responsibilities
- Remove unused or redundant code
Recommended Process
1. Analyze the structure
Identify:
- Functions, classes, modules
- Deep nesting or long functions
- Side effects and repeated logic
2. Detect common issues
Look for:
- Unclear naming
- Duplicate logic
- Unreachable code
- Long parameter lists
- Mutable default arguments
3. Apply refactoring techniques
Use patterns such as:
- Extract Function
- Inline Variable
- Replace Temp with Query
- Introduce Parameter Object
- Remove Dead Code
- Simplify Conditional Expressions
4. Produce output
Return:
- The refactored code
- A short explanation of changes
- Any recommended follow‑up improvements
Example
Input
Gives 1 of the 12 instructions most refactoring skills give
Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06
- run tests after each changein 59 of 521, across 56 files
- write tests before refactoringin 27 of 521, across 24 files
- preserve external behaviorin 26 of 521, across 22 files
- remove dead codehere, and in 25 of 521, across 24 files
- make small incremental changesin 20 of 521, across 17 files
- break the implementation into tiny commitsin 18 of 521, across 5 files
- ask the user about alternative optionsin 17 of 521, across 4 files
- create a GitHub issue with the planin 17 of 521, across 4 files
- explore the repository to verify assertionsin 17 of 521, across 4 files
- interview the user about the refactorin 16 of 521, across 3 files
- check the codebase for test coveragein 16 of 521, across 3 files
- refactor one thing at a timein 16 of 521, across 12 files
Said here and by no other author read
- clarify naming and responsibilities
- identify deep nesting or long functions
- identify side effects and repeated logic
- look for unreachable code
- look for mutable default arguments
- use extract function pattern
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.