refactor-safe
Installation
SKILL.md
Execute the following steps:
-
Check if current directory is a valid project (package.json, requirements.txt, etc.)
-
Analyze code patterns and identify safe refactoring opportunities:
- Duplicate code blocks that can be extracted into functions
- Long functions that can be broken down
- Magic numbers/strings that should be constants
- Unused imports or variables
- Simple type improvements (TypeScript/Python)
- Dead code that can be removed safely
-
Prioritize suggestions by safety level:
- Safe: No behavior change (extract constants, remove unused code)
- Low Risk: Mechanical refactoring (extract functions, rename variables)
- Medium Risk: Structural changes that need testing