← 返回 Skills 市场
mike47512

Refactoring

作者 mike47512 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
210
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install refactoring
功能描述
Deep refactoring workflow—characterization tests, incremental steps, behavior preservation, design direction, and verification. Use when improving structure...
使用说明 (SKILL.md)

Refactoring (Deep Workflow)

Refactoring changes structure, not behavior. Safety comes from small steps, fast feedback, and verification (tests, golden outputs, or controlled manual checks).

When to Offer This Workflow

Trigger conditions:

  • Code is hard to change; duplication; unclear module boundaries
  • Need to prepare an area for a new feature without mixing behavior change
  • Paying down tech debt with management expecting “no user-visible change”

Initial offer:

Use six stages: (1) clarify goal & scope, (2) establish safety net, (3) plan increments, (4) execute with reviewable commits, (5) verify behavior, (6) document & follow-ups). Confirm test coverage and release pressure.


Stage 1: Clarify Goal & Scope

Goal: Why refactor now—reduce coupling, enable feature X, remove dead code, improve naming.

Exit condition: Explicit non-goals (no feature changes in this effort unless separately scoped).


Stage 2: Establish Safety Net

Goal: Prefer characterization tests for legacy; golden outputs for data pipelines; use snapshot tests sparingly.

If tests are weak

  • Approval tests, short exploratory scripts, or pair review with domain expert

Stage 3: Plan Increments

Goal: Small commits, each leaving the codebase working (not necessarily perfect).

Practices

  • Move code, then change behavior in separate steps (Fowler-style when helpful)
  • Separate mechanical renames from logic edits for reviewability

Stage 4: Execute With Reviewable Commits

Goal: Each PR/commit tells a story; avoid thousand-line “cleanup” dumps.


Stage 5: Verify Behavior

Goal: CI green; compare outputs for batch jobs; manual smoke on critical paths when needed.


Stage 6: Document & Follow-Ups

Goal: ADR or short module README for new boundaries; tickets for remaining debt accepted consciously.


Final Review Checklist

  • Scope and non-goals explicit
  • Safety net matches risk
  • Incremental, reviewable steps
  • Behavior verified
  • Follow-up debt tracked

Tips for Effective Guidance

  • Keep refactor commits separate from feature commits when possible.
  • If behavior must change, it is not “pure refactoring”—plan as a migration with communication.
  • Under hotfix pressure, minimize refactor scope or defer.

Handling Deviations

  • Strangler refactors: maintain adapters at boundaries until cutover is complete.
安全使用建议
This skill is a safe, documentation-only refactoring workflow: it will not install code or access credentials. If you plan to let an autonomous agent act on its guidance, require human review before applying changes to repositories or production systems. Also ensure any agent or tool that uses this guidance does not have repository credentials or CI deployment tokens unless you explicitly trust and review automated changes.
功能分析
Type: OpenClaw Skill Name: refactoring Version: 1.0.0 The skill bundle contains a standard workflow for software refactoring, providing high-level guidance on safety nets, incremental changes, and verification. There is no executable code, network activity, or suspicious instructions in SKILL.md or _meta.json.
能力评估
Purpose & Capability
The name/description (deep refactoring workflow) match the SKILL.md content. The skill requires no binaries, env vars, or config paths, which is proportionate for a documentation/workflow skill.
Instruction Scope
SKILL.md contains only procedural guidance (stages, checklists, tips). It does not instruct the agent to run shell commands, read files, access environment variables, or exfiltrate data. No scope creep detected.
Install Mechanism
No install spec and no code files are present. As an instruction-only skill, it writes nothing to disk and does not pull external code—lowest-risk install profile.
Credentials
The skill declares no required environment variables, credentials, or config paths. That matches the instructional nature of the skill.
Persistence & Privilege
Flags show always:false and normal model invocation allowed. The skill does not request persistent or elevated privileges or modify other skills' configurations.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install refactoring
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /refactoring 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release introducing a structured deep refactoring workflow. - Outlines six clear stages: goal clarification, safety net establishment, incremental planning, reviewable execution, verification, and documentation. - Provides practical guidance for when and how to use the workflow, emphasizing behavior preservation and risk management. - Includes a review checklist and troubleshooting tips for effective and safe refactoring.
元数据
Slug refactoring
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Refactoring 是什么?

Deep refactoring workflow—characterization tests, incremental steps, behavior preservation, design direction, and verification. Use when improving structure... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 210 次。

如何安装 Refactoring?

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

Refactoring 是免费的吗?

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

Refactoring 支持哪些平台?

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

谁开发了 Refactoring?

由 mike47512(@mike47512)开发并维护,当前版本 v1.0.0。

💬 留言讨论