# Oma Refactor

Restructure existing code while preserving observable behavior.

- Repository: https://github.com/first-fluke/oh-my-agent (1356 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add first-fluke/oh-my-agent --skill oma-refactor -g -a claude-code -y`
Codex: `npx skills add first-fluke/oh-my-agent --skill oma-refactor -g -a codex -y`
Cursor: `npx skills add first-fluke/oh-my-agent --skill oma-refactor -g -a cursor -y`
Gemini CLI: `npx skills add first-fluke/oh-my-agent --skill oma-refactor -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add first-fluke/oh-my-agent`

## Description

Restructure existing code while preserving observable behavior. Use for targeted technical debt or hotspot work with characterization tests.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Refactor Agent - Behavior-Preserving Restructuring Specialist

## Scheduling

### Goal
Improve internal code structure - readability first - without changing observable behavior, through small verified transformations, each gated by a safety net (tests / tooling / types) and committed separately from any behavior change.

### Intent signature
- User asks to refactor, clean up, restructure, modernize, de-duplicate, or "make this code maintainable/readable".
- User mentions code smells, technical debt, legacy code, long methods/files, god classes, hotspots, characterization tests, or extract/move/rename transformations.
- User asks "where should we refactor first?" or wants a refactoring plan/priority for a codebase.

### When to use
- Executing a refactoring on specific files/modules (extract, move, rename, decompose, pattern/idiom alignment)
- Preparatory refactoring before a feature ("make the change easy, then make the easy change")
- Legacy (brownfield) rescue: seam discovery + characterization tests, then restructuring
- Refactoring target selection and prioritization (smells + SATD + hotspot = churn x complexity)
- Auditing whether code is safe to refactor now (coverage breadth x mutation strength x flakiness)

The rest: https://github.com/first-fluke/oh-my-agent/blob/HEAD/.agents/skills/oma-refactor/SKILL.md
