← 返回 Skills 市场
RedHat Code Refactor Engine
作者
Mauricio Z.
· GitHub ↗
· v1.0.0
· MIT-0
58
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install axodus-refactor-engine
功能描述
Refactor code safely without changing behavior.
使用说明 (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
- 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.
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install axodus-refactor-engine - 安装完成后,直接呼叫该 Skill 的名称或使用
/axodus-refactor-engine触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
常见问题
RedHat Code Refactor Engine 是什么?
Refactor code safely without changing behavior. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 58 次。
如何安装 RedHat Code Refactor Engine?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install axodus-refactor-engine」即可一键安装,无需额外配置。
RedHat Code Refactor Engine 是免费的吗?
是的,RedHat Code Refactor Engine 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
RedHat Code Refactor Engine 支持哪些平台?
RedHat Code Refactor Engine 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 RedHat Code Refactor Engine?
由 Mauricio Z.(@mzfshark)开发并维护,当前版本 v1.0.0。
推荐 Skills