一键导入
refactor
Propose minimal, safe code improvements without changing behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Propose minimal, safe code improvements without changing behavior
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | refactor |
| description | Propose minimal, safe code improvements without changing behavior |
| argument-hint | staged | changes | <file-path> |
Use for behavior-preserving cleanup.
Arg: staged | changes | <file-path>.
If missing: print only Usage: refactor staged | refactor changes | refactor <file-path>; exit.
Scope:
staged: run git diff --cached --stat, then git diff --cachedchanges: run git diff --stat, then git diff<file-path>: verify file exists, read only that file, refactor only that fileRules:
rtk <cmd> via the bash tool, never raw command; git status = bad, rtk git status = good.Refactor canceled: cannot guarantee behavior safety within scope. and stopSelf-Check:
Do Not:
Output:
Type "continue" to apply this refactor.
Anything else cancels.Apply:
Apply only if next reply is exactly continue:
git status --shortgit diff --statAudit staged, unstaged, or file-scoped changes for bugs, risks, and minimal risk-reducing fixes
Generate and optionally apply a Conventional Commit from staged changes
Update the existing PR for the current branch when one exists, otherwise create a draft PR from git diff
Debug a bug from an entrypoint or symptom, prove root cause, propose a minimal patch
Group current changes into multiple commitlint-compliant commits and apply on confirmation