跳到正文
Skillpedia
通用编程5.1k · #15149

omh-refactor-plan

它能做什么

该技能把已经决定的代码重构转化为分阶段的计划,每个阶段都配有检查和回滚。适合重新组织代码库大部分内容的开发者。

适用场景

  • ✓当你已经决定拆分一个大模块,并需要一份安全计划时。
  • ✓当一次重构涉及很多文件,而你希望每一步都可以随时停下来时。
  • ✓当你需要在编辑任何内容之前,列出计划中改动会影响的文件时。

技能链接

https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-refactor-plan/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-refactor-plan/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我们已经决定把账单代码从订单模块中拆分出来。请按安全的步骤规划这次重构。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体梳理受影响的文件,把工作排成几个阶段,并为每个阶段添加测试和回滚步骤。在编辑任何文件之前,它都会先等待你的批准。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Refactor Plan

This is an OMH refactor-plan workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

Why This Exists

refactor-plan exists because boundary-changing refactors bounced between goal planning and behavior-preserving cleanup with neither owning the execution shape: the phase order, the per-phase rollback, and the files table that make a large refactor reviewable and abortable.

Do Not Use When

  • The refactor's direction is still contested or the goal itself needs consensus planning; use ulw-plan.
  • The work is deletion-first cleanup with no boundary changes; use omh-ai-slop-cleaner.
  • The plan is done and the claim is that work is complete; use omh-verification-gate for the evidence close.
  • The version bump carries a security advisory, a CVE, or a leaked secret; use omh-security-event-response, which owns containment and closure.

Examples

Good example:

  • Prompt: We decided to split the billing module out of orders - plan the refactor so each step is shippable.
  • Expected behavior: Map affected files and consumers from the import graph, name hidden coupling and blast radius, order the five phases with per-phase verification and rollback, ship the files table, and stop at the approval gate.
  • Why: The direction is decided and the need is a phased, abortable execution shape - exactly this workflow's territory.

Bad example:

  • Prompt: Should we even split billing out of orders?
  • Expected behavior: Route to ralplan: the direction is not decided, so consensus planning comes before phase planning.
  • Why: A phase plan for a contested direction launders a decision through logistics.

Completion Checklist

  • Reconnaissance names affected files, boundaries, coupling, and blast radius from observed evidence.
  • Every phase carries its verification command and its rollback point, and ends at a shippable commit.
  • The files table covers every touched file with action, phase, and dependencies.
  • For an upgrade, every breaking change row names its call sites or an observed empty search, and every stage names its rollback.
  • The plan stopped at the approval gate; no implementation began without the user's go.

Recovery Notes

  • If the import graph is unavailable, build the codegraph first or reduce the plan's confidence and say which files are unverified.
  • If a phase cannot be made independently green, split it further; two half-phases beat one unabortable one.
  • If reconnaissance finds the direction itself is unsettled, route back to ralplan before ordering phases.
  • If the module to deepen is chosen but its interface is not, shape it under contrasting constraints and recommend one design before phase 1; that is not a contested direction.

When to Use

Use when a refactor that crosses module boundaries is already decided and needs its execution shaped: which files move in which phase, what verifies each phase, and where each phase rolls back to - before anything is edited.

Strong routing signals: `refactor-plan`, `refactor plan`, `plan this refactor`, `plan the refactor`, `refactor planning`, `refactor phases`, `phased refactor`, `refactor in phases`, `refactor rollback plan`, `blast radius`, `module restructure plan`, `restructure plan`, `dependency upgrade`, `major version upgrade`, `framework upgrade`, `upgrade to the next major`, `breaking change upgrade`, `lockfile`, `리팩터링 계획`, `리팩토링 계획`, `리팩터링 단계`, `단계별 리팩터링`, `리팩터링 계획 세워줘`, `리팩터링 롤백 계획`, `спланируй рефакторинг`, `план рефакторинга`, `рефакторинг по фазам`, `поэтапный рефакторинг`, `рефакторинг по шагам`

Catalog Metadata

Category: planning Phase: refactor-plan Quality tier: plan-gated Reasoning demand: standard

Quality bar:

  • Reconnaissance first: affected files, ownership boundaries, hidden coupling, and blast radius are mapped before any phase is ordered; the full contract is omh-refactor-plan/references/refactor-phases.md.
  • Order phases contracts-first: types and interfaces, then implementations, then callers in reviewable groups, then tests, then cleanup - and name what verifies each phase and where it rolls back to.
  • Ship the files table with the plan: one row per file with action, phase, and blocks/blocked-by; a row without a phase is unplanned work.
  • Size verification to the blast radius, not to optimism: a phase touching public surfaces or persisted shapes carries the full gate, not the fast one.
  • For a dependency or framework upgrade, read
常见问题

这个技能会编辑我的代码吗?

不会。它规划工作,并在任何编辑之前等待你的批准。

如果我还没有决定如何改动怎么办?

该技能适用于已经决定的改动。如果还有未决的问题,更广泛的规划技能更合适。

如果某个依赖包存在安全问题怎么办?

这需要单独的安全响应技能处理,而不是重构计划。

详情

作者的原始描述

[omh] Decided cross-module refactor to phase: refactor planning - turn a decided boundary-changing refactor into a phased plan - reconnaissance, contracts-first phase order, per-phase verification and rollback, a files table, and an explicit approval gate before any edit. Use when the user says: refactor-plan, refactor plan, plan this refactor, plan the refactor, refactor planning, refactor phases, phased refactor, refactor in phases.

repo: rlaope/oh-my-hermes

热度

GitHub 星标
5.1k
排名
#15149
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能