Refactoring
Automates Python code refactoring tasks like renaming variables and extracting functions to improve readability and maintainability.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add lexler-refactoring npx -- -y @trustedskills/lexler-refactoring
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"lexler-refactoring": {
"command": "npx",
"args": [
"-y",
"@trustedskills/lexler-refactoring"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill helps improve existing codebases by performing automated refactoring. It can identify and apply common refactoring patterns, such as extracting methods or renaming variables, to enhance readability and maintainability. The goal is to produce cleaner, more efficient code without altering the core functionality.
When to use it
- Legacy Code: Improve older code that's difficult to understand and modify.
- Code Reviews: Automate some of the tedious refactoring tasks identified during code reviews.
- Technical Debt Reduction: Systematically address areas of technical debt within a project.
- Preparing for New Features: Refactor existing code before adding new functionality to simplify development.
Key capabilities
- Automated refactoring suggestions
- Method extraction
- Variable renaming
- Code simplification
Example prompts
- "Refactor this function to improve its readability." (followed by the function's code)
- "Extract a method from this block of code." (followed by the code block)
- “Rename this variable to be more descriptive.” (followed by the variable name and context)
Tips & gotchas
The skill requires access to the codebase being refactored. Review suggested changes carefully before applying them, as automated refactoring may not always produce optimal results in all situations.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.