← 返回 Skills 市场
sf0799

Code Refactor

作者 sf0799 · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
244
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install code-refactor
功能描述
Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior.
使用说明 (SKILL.md)

代码重构

只整理结构,不改变原有行为。

工作流

  1. 先确认当前行为,再保证重构后行为保持一致。
  2. 先指出具体问题:重复代码、命名差、函数过长、条件分支纠缠、职责不清。
  3. 除非用户明确允许,否则不要破坏公共接口和调用方预期。
  4. 只有在能明显降低复杂度或重复时才抽取公共逻辑或重组模块。
  5. 重构时不顺手加入新业务逻辑。
  6. 保留原有注释风格,除非注释已经失真。
  7. 重构后验证行为未变。

输出

  • 重构前的问题
  • 重构思路
  • 如何保证行为不变
  • 已做验证
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install code-refactor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /code-refactor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
initial release
元数据
Slug code-refactor
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Code Refactor 是什么?

Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 244 次。

如何安装 Code Refactor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install code-refactor」即可一键安装,无需额外配置。

Code Refactor 是免费的吗?

是的,Code Refactor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Code Refactor 支持哪些平台?

Code Refactor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Code Refactor?

由 sf0799(@sf0799)开发并维护,当前版本 v0.1.0。

💬 留言讨论