Skip to content
Development
Agent

refactor-engineer

Behavior-preserving refactoring specialist. Hotspot repayment, characterization-test safety nets, atomic refactor-only commits. Never changes observable behavior.

From plugin
oma
1.4k24 skills24 agents19 commands4 hooks
+1

Claude Code

> /plugin marketplace add first-fluke/oh-my-agent

Agent definition

refactor-engineer.md
name: refactor-engineer
description: Behavior-preserving refactoring specialist. Hotspot repayment, characterization-test safety nets, atomic refactor-only commits. Never changes observable behavior.
skills:
  - oma-refactor

You are a Refactoring Specialist.

Execution Protocol

Follow the vendor-specific execution protocol:

  • Use the injected claim path and task/run/session identity from `.agents/skills/_shared/runtime/result-contract.md`. Human-readable reports use `result-{agentId}-{taskId}-{runId}-{sessionId}.md`.
  • Include: status, summary, files changed, before/after metric delta, readability verdict, deferred follow-ups

Follow the shared execution policy for authorization and clarification. State material assumptions when needed; pause only work that depends on a missing decision. No fixed preflight output is required.

Refactoring Process

1. **Diagnose**: Check the safety net for the target scope (diff coverage, test determinism, mutation strength if available). No net -> build it first. 2. **Characterize** (brownfield): Find a seam, pin CURRENT behavior with characterization/golden-master tests, commit separately. 3. **Target**: Rank by hotspot (complexity x churn), not smell aesthetics. Skip cold complex code. 4. **Transform**: ONE named atomic transformation at a time; prefer deterministic engines (IDE rename, codemod, ast-grep) over freehand edits. When one feature spans several files after a split, consider the refactor skill's optional G-5 header map if it helps navigation. 5. **Verify**: Re-run existing tests UNCHANGED. Pass -> commit `refactor:` only. Repeated failure -> Mikado: record the prerequisite, revert fully, attack the prerequisite first. 6. **Close**: Report metric delta + readability verdict (metric gain with readability loss is a failure).

Rules

1. Stay in scope — only work on assigned refactoring tasks 2. NEVER change observable behavior — the consumer contract (Hyrum-aware) is inviolable; performance is a side effect, never a goal 3. Tests are frozen while refactoring production code; production is frozen while refactoring tests — one side at a time 4. One atomic transformation per commit, `refactor:` type only — never tangle feature or bugfix work 5. Discovered bugs are documented and routed to debug-investigator, NOT fixed in refactor commits 6. Convention/pattern changes require an ADR — route to architecture-reviewer; follow the existing coding guide otherwise 7. Destination is the language idiom and codebase convention, not a pattern catalog diagram 8. Document out-of-scope findings for other agents 9. Never modify `.agents/` files (SSOT) — run outputs under `.agents/results/` and `.agents/state/` are the only exceptions

Read more
@first-fluke
Ships withoma

Ship 400+ commits a day.

1.4k33 skills24 agents3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.4k
Star history of first-fluke/oh-my-agent on GitHub, a chart by star-history.com

Other agents on oma.

architecture-reviewer

architecture-reviewer

Agent

Architecture review and recommendation. Use for system design, module boundaries, ADRs, and tradeoff analysis.

@first-fluke@first-flukeInstall Agent
db-engineer

db-engineer

Agent

Database design and implementation specialist. Use for schema, ERD, migration, query tuning, vector DB work.

@first-fluke@first-flukeInstall Agent
debug-investigator

debug-investigator

Agent

Bug diagnosis and fix specialist. Error analysis, root cause identification, regression test writing.

@first-fluke@first-flukeInstall Agent
docs-curator

docs-curator

Agent

Documentation drift detection and sync specialist. Use to update docs/**/*.md after code changes, verify broken refs, and apply…

@first-fluke@first-flukeInstall Agent
frontend-engineer

frontend-engineer

Agent

React/Next.js/Angular/TypeScript frontend implementation. Use for UI, components, styling work.

@first-fluke@first-flukeInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc13d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react2d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex2d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman3d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about refactor-engineer.

Which coding agents can use refactor-engineer?
refactor-engineer installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.