← 返回 Skills 市场
yuyonghao-123

Code Refactor

作者 yuyonghao-123 · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
146
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install yuyonghao-code-refactor
功能描述
Analyze code quality issues, detect code smells, and automatically apply refactoring suggestions with preview, apply, and rollback support.
安全使用建议
This skill appears to do what it claims: analyze and propose/apply refactorings locally. Main cautions: 1) The validator runs 'npm test' (child_process) in the repository — that will execute whatever scripts are defined in package.json, which could run arbitrary code. 2) The applier writes changes to files and creates .backup files; although a rollback is provided, always inspect the generated diff before applying. Recommendations: run the skill in dry-run mode first, review the generated plan and diffs, run it on a copy/branch or in a sandbox, verify package.json test scripts before allowing non-dry-run operations, and keep version control so you can revert if needed.
功能分析
Type: OpenClaw Skill Name: yuyonghao-code-refactor Version: 0.1.0 The skill bundle implements a code refactoring assistant that includes high-risk capabilities such as file system modification (src/applier.js) and arbitrary command execution (src/validator.js). Specifically, the `TestValidator` class uses `child_process.execSync` to run test commands, which is a potential vector for command injection if the command or environment is manipulated. While these behaviors are functionally aligned with the stated purpose of refactoring and validating code, they constitute significant security risks. No evidence of intentional malice, data exfiltration, or prompt injection was found.
能力评估
Purpose & Capability
Name/description match the included code: analyzer, refactorer, applier, and validator. The files implement analysis, plan generation, dry-run/apply/rollback, and test validation — all expected for a refactoring tool. There are no unrelated environment variables, binaries, or config paths.
Instruction Scope
SKILL.md instructs local analysis/refactor/apply commands that align with the code. The validator runs 'npm test' via child_process; this is expected for test validation but means the skill will execute repository test scripts (arbitrary code in the project). The applier writes edits to files and creates backups. Review diffs and backups before applying changes.
Install Mechanism
No install spec is provided (instruction-only install), so nothing is downloaded or executed at install time. The skill bundles Node source files; execution uses local Node runtime. package.json declares engines >=18 but no external package installs are performed by the skill itself.
Credentials
The skill requests no environment variables, credentials, or unrelated config paths. It accesses only local files (fs) and runs local commands — appropriate for a code refactoring tool.
Persistence & Privilege
The skill does not request always:true and does not alter other skills. However, it can modify repository files (writes, backups, rollbacks) and execute 'npm test' in the working directory. Those capabilities are legitimate for refactoring but grant file-modification and code-execution privileges within the repo.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install yuyonghao-code-refactor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /yuyonghao-code-refactor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
- Initial release of Code Refactor Skill. - Provides code quality analysis (detects code smells, calculates complexity, checks standards). - Supports automated refactoring (extract functions, rename variables, simplify expressions, remove duplication, optimize imports). - Includes change application with diff previews, dry-run, and rollback. - Validates changes by running tests and checking coverage. - CLI and configuration options available for flexibility.
元数据
Slug yuyonghao-code-refactor
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Code Refactor 是什么?

Analyze code quality issues, detect code smells, and automatically apply refactoring suggestions with preview, apply, and rollback support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 146 次。

如何安装 Code Refactor?

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

Code Refactor 是免费的吗?

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

Code Refactor 支持哪些平台?

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

谁开发了 Code Refactor?

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

💬 留言讨论