Back to skills
SkillHub ClubShip Full StackFull Stack

refactor-code

Restructure code for improved clarity and maintainability. Use when addressing code smells or technical debt.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
14
Hot score
86
Updated
March 20, 2026
Overall rating
C4.1
Composite score
4.1
Best-practice grade
A92.0

Install command

npx @skill-hub/cli install mvillmow-projectodyssey-refactor-code

Repository

mvillmow/ProjectOdyssey

Skill path: .claude/skills/tier-2/refactor-code

Restructure code for improved clarity and maintainability. Use when addressing code smells or technical debt.

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: mvillmow.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install refactor-code into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/mvillmow/ProjectOdyssey before adding refactor-code to shared team environments
  • Use refactor-code for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: refactor-code
description: "Restructure code for improved clarity and maintainability. Use when addressing code smells or technical debt."
mcp_fallback: none
category: generation
tier: 2
---

# Refactor Code

Apply systematic refactoring techniques to improve code clarity, maintainability, and performance without changing functionality.

## When to Use

- Addressing code smells identified in reviews
- Reducing cyclomatic complexity
- Extracting methods and classes
- Improving naming and organization

## Quick Reference

```python
# Common refactoring patterns

# Extract method
# BEFORE: Long function with multiple responsibilities
def process_data(data):
    result = validate(data)
    formatted = format_data(result)
    return save(formatted)

# AFTER: Clear single responsibility
def process_data(data):
    validated = _validate_and_format(data)
    return save(validated)

def _validate_and_format(data):
    return format_data(validate(data))
```

## Workflow

1. **Identify refactoring targets**: From code review or analysis tools
2. **Plan changes**: Document what will change and why
3. **Apply refactoring**: Use IDE refactoring tools or manual changes
4. **Run tests**: Verify all tests still pass
5. **Verify performance**: Check no performance regression

## Output Format

Refactoring report:

- Issues addressed
- Refactoring techniques applied
- Metrics before/after (complexity, lines of code)
- Test coverage status
- Performance impact

## References

- See `detect-code-smells` skill for identifying issues
- See CLAUDE.md > SOLID principles for refactoring goals
- See `run-tests` skill for verification
refactor-code | SkillHub