← Back to Skills Marketplace
mzfshark

RedHat Code Refactor Engine

by Mauricio Z. · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
58
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install axodus-refactor-engine
Description
Refactor code safely without changing behavior.
README (SKILL.md)

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

  1. Establish a baseline:
    • run existing tests (or add a minimal characterization test)
  2. Identify refactor seam(s):
    • extract pure functions
    • isolate I/O
    • reduce global state
  3. Apply refactor in small commits/patches:
    • one transformation per step
    • keep diffs readable
  4. Re-run validations after each meaningful transformation.
  5. 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_summary
  • files_changed
  • behavior_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.

Usage Guidance
This skill is a text-only refactoring procedure and appears coherent. Before enabling it, note that it will need access to your codebase and test tooling to run the validation steps — review and run any proposed diffs/commits yourself, ensure tests exist or add characterization tests, and confirm the project has the appropriate test runner (the example shows pnpm). Because the skill can be invoked by the agent, avoid granting it credentials or network access it doesn't need, and require human review of actual code changes or merges. If you need higher assurance, run the agent in a sandboxed environment and require pull-request-based workflows so changes are reviewed before merging.
Capability Analysis
Type: OpenClaw Skill Name: axodus-refactor-engine Version: 1.0.0 The skill bundle defines a standard workflow for code refactoring, emphasizing safety through testing and incremental changes. The instructions in SKILL.md and refactor-engine.md are logically aligned with the stated purpose and include explicit safety rules to prevent breaking changes. No indicators of malicious intent, data exfiltration, or unauthorized execution were found.
Capability Assessment
Purpose & Capability
Name/description (refactor code safely) align with the content: the SKILL.md contains step-by-step refactoring instructions, validation guidance, and expected outputs. Nothing requested (no env vars, no binaries, no installs) is disproportionate to this purpose.
Instruction Scope
Runtime instructions are limited to code-refactoring workflows: run tests, add characterization tests, make small commits/patches, and re-run validation. The instructions imply access to the target repository/files and test runner (expected for a refactor tool) and do not ask for unrelated system files, credentials, or external endpoints.
Install Mechanism
There is no install spec and no code files — the skill is instruction-only, so nothing is written to disk or downloaded during install.
Credentials
The skill declares no environment variables, credentials, or config paths. The example mentions running 'pnpm test', but that is an example command (not a declared requirement) and is proportional to the task of validating refactors.
Persistence & Privilege
The skill does not request 'always: true' or any persistent privileges, nor does it modify other skills' configs. Autonomous invocation is allowed by default on the platform but is not combined here with broad access.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install axodus-refactor-engine
  3. After installation, invoke the skill by name or use /axodus-refactor-engine
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of refactor-engine - Safely refactor code to improve structure without altering behavior. - Supports specifying target modules, refactor goals, constraints, and validation commands. - Enforces running tests and validation before and after changes. - Outputs summaries, file changes, behavior guards, and validation results. - Includes clear safety rules to avoid risky rewrites and unintended API changes.
Metadata
Slug axodus-refactor-engine
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

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.

💬 Comments