RedHat Code Refactor Engine
/install axodus-refactor-engine
SKILL: refactor-engine
Purpose
Improve existing code structure (readability, modularity, maintainability) while preserving behavior.
When to Use
- Complexity is growing and changes are becoming risky.
- Duplicate logic appears across modules.
- Tests exist (or can be added) to protect behavior.
Inputs
target_area(required, string): file(s)/module(s) to refactor.refactor_goal(required, string): what improves (e.g., reduce duplication, isolate side effects).constraints(optional, string[]): behavior must not change; performance bounds; compatibility.validation_commands(optional, string[]): tests/build/lint to run before/after.
Steps
- Establish a baseline:
- run existing tests (or add a minimal characterization test)
- Identify refactor seam(s):
- extract pure functions
- isolate I/O
- reduce global state
- Apply refactor in small commits/patches:
- one transformation per step
- keep diffs readable
- Re-run validations after each meaningful transformation.
- If behavior changes, revert that change and adjust approach.
Validation
- Behavior is preserved (tests pass; outputs unchanged for known cases).
- Public interfaces remain stable (or are versioned/migrated explicitly).
- Complexity decreases measurably (smaller functions, fewer branches, less duplication).
Output
refactor_summaryfiles_changedbehavior_guards(tests added/used)validation_results
Safety Rules
- Do not refactor without a behavior guard (tests or a deterministic reproduction).
- Avoid “big bang†rewrites.
- Do not change public APIs unless explicitly required.
Example
Goal: “Extract request validation from controller into validators/ and add unit tests.â€
Validation: pnpm test after each extraction step.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install axodus-refactor-engine - After installation, invoke the skill by name or use
/axodus-refactor-engine - Provide required inputs per the skill's parameter spec and get structured output
What is RedHat Code Refactor Engine?
Refactor code safely without changing behavior. It is an AI Agent Skill for Claude Code / OpenClaw, with 58 downloads so far.
How do I install RedHat Code Refactor Engine?
Run "/install axodus-refactor-engine" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is RedHat Code Refactor Engine free?
Yes, RedHat Code Refactor Engine is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does RedHat Code Refactor Engine support?
RedHat Code Refactor Engine is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created RedHat Code Refactor Engine?
It is built and maintained by Mauricio Z. (@mzfshark); the current version is v1.0.0.