← Back to Skills Marketplace
244
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install code-refactor
Description
Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior.
README (SKILL.md)
代码重构
只整理结构,不改变原有行为。
工作流
- 先确认当前行为,再保证重构后行为保持一致。
- 先指出具体问题:重复代码、命名差、函数过长、条件分支纠缠、职责不清。
- 除非用户明确允许,否则不要破坏公共接口和调用方预期。
- 只有在能明显降低复杂度或重复时才抽取公共逻辑或重组模块。
- 重构时不顺手加入新业务逻辑。
- 保留原有注释风格,除非注释已经失真。
- 重构后验证行为未变。
输出
- 重构前的问题
- 重构思路
- 如何保证行为不变
- 已做验证
Usage Guidance
This skill is internally consistent and appears to do what it says: read your project, propose and apply refactors, and verify behavior. Before using it: (1) ensure the agent has explicit permission to read and modify your repository; (2) keep a VCS commit or backup so you can review and revert changes; (3) confirm how the agent will verify correctness (e.g., will it run your test suite or rely on static checks), and restrict execution if you don't want tests run automatically; (4) require the agent to show diffs and ask for user confirmation before applying changes. If you are uncomfortable granting file-modification rights, do not enable autonomous invocation or run the skill only in a sandboxed environment.
Capability Analysis
Type: OpenClaw Skill
Name: code-refactor
Version: 0.1.0
The skill bundle is a standard tool for code refactoring and contains no executable code or high-risk instructions. The files (SKILL.md, agents/openai.yaml, and _meta.json) focus entirely on improving code structure and readability while explicitly instructing the agent to preserve existing behavior and verify changes, with no evidence of malicious intent or data exfiltration.
Capability Assessment
Purpose & Capability
Name and description (code refactor) match the SKILL.md instructions: identify duplication, simplify flow, rename, reorganize without changing behavior. No unrelated env vars, binaries, or installs are requested.
Instruction Scope
Instructions correctly focus on refactoring and include guidance to verify behavior remains unchanged. This necessarily implies reading and modifying the user's local codebase and running whatever tests or verification the user has — expected for a refactoring skill, but it means the agent may access project files and test harnesses. The SKILL.md does not prescribe how to run verification (e.g., run test suite, use sandbox), so the agent's actions for verification depend on agent implementation and must be authorized by the user.
Install Mechanism
No install spec or code files are present (instruction-only), so nothing will be written to disk by an installer. Lowest-risk install profile.
Credentials
No environment variables, credentials, or config paths are requested. The skill does not ask for unrelated secrets or system access.
Persistence & Privilege
Defaults are used (not always:true). The skill is user-invocable and can be invoked autonomously by the agent per platform defaults; this is normal and not excessive for this skill.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install code-refactor - After installation, invoke the skill by name or use
/code-refactor - Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
initial release
Metadata
Frequently Asked Questions
What is Code Refactor?
Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior. It is an AI Agent Skill for Claude Code / OpenClaw, with 244 downloads so far.
How do I install Code Refactor?
Run "/install code-refactor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Code Refactor free?
Yes, Code Refactor is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Code Refactor support?
Code Refactor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Code Refactor?
It is built and maintained by sf0799 (@sf0799); the current version is v0.1.0.
More Skills