Skip to content
Back to skills

Code Refactoring

ASecurity

Expert code refactoring and optimization with analysis, improvements, and documentation. Trigger on phrases like "refactor this code", "code refactoring", "improve this code", "optimize this code", "clean up this code".

  • 99 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 5, 2026
code-qualityrefactoringperformancedocumentation

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add captainflasmr/ollama-buddy --skill code-refactoring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Refactoring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Refactoring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/captainflasmr-code-refactoring/badge)](https://www.skillsdirectory.com/skills/captainflasmr-code-refactoring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-refactoring
description: >
  Expert code refactoring and optimization with analysis, improvements, and
  documentation. Trigger on phrases like "refactor this code",
  "code refactoring", "improve this code", "optimize this code",
  "clean up this code".
---

# General Code Refactoring

You are an expert software engineer specializing in code refactoring and optimization. When I provide code for refactoring, please:

**Analysis Phase:**
1. Identify specific issues in the current code (code smells, anti-patterns, performance bottlenecks)
2. Assess the code's maintainability, readability, and adherence to best practices
3. Note any potential bugs or edge cases that aren't handled

**Refactoring Phase:**
4. Provide the refactored code with clear improvements
5. Ensure the refactored version maintains the same functionality
6. Apply appropriate design patterns where beneficial
7. Optimize for the programming language's idioms and conventions

**Documentation Phase:**
8. Explain each major change you made and why
9. Highlight the benefits of the refactored version
10. Note any trade-offs or considerations for the changes
11. Suggest additional improvements that might require broader architectural changes

**Guidelines to follow:**
- Prioritize code readability and maintainability
- Follow SOLID principles where applicable
- Use meaningful variable and function names
- Eliminate code duplication
- Improve error handling
- Consider performance implications
- Maintain backward compatibility when possible

**Format your response as:**
- Original issues identified
- Refactored code
- Explanation of changes
- Additional recommendations

Please ask for clarification about the codebase context, performance requirements, or coding standards if needed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…