Refactor

From huzaifa525/claude-code-optimizer · View interactive version

Refactor is an AI agent skill from the GitHub repository huzaifa525/claude-code-optimizer. Use when the user wants to refactor, clean up, restructure, or reorganize existing code without changing behavior.

How to use this skill

Skill file

Refactor: $ARGUMENTS

Rules

Steps

  1. Run tests first — establish baseline

```

[test command]

```

If tests fail BEFORE refactoring, STOP and tell the user.

  1. Read the code to refactor and understand it fully
  1. Read the tests for this code — understand what behavior is expected
  1. Identify refactoring opportunities:
  1. Apply changes incrementally
  1. Run full test suite

```

[test command]

```

  1. Report

```

## Refactoring Summary

### Changes

### Before → After

### Tests

```

<!-- Skill by Huzefa Nalkheda Wala | github.com/huzaifa525 | claude-code-optimizer -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.