基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/benjam3n/reasoningtool --skill rf-refactoring命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Route any input through a branching question tree to narrow down the optimal response strategy before writing. Two stages — PERCEIVE (classify input) then ACT (select response). Covers all prompt types.
Generate exhaustive guesses about user input using ALL search methods with coverage tracking. Guessing is SEARCH through possibility space. Tracks space created vs space covered to ensure comprehensive exploration.
Systematically evaluate and select from a set of guesses, options, or possibilities. Combines ARAW analysis with prioritization to determine which guesses are strong, weak, actionable, or eliminable.
| name | rf - Refactoring |
| description | Procedure for systematically improving code structure without changing behavior |
| output | {"format":"prose"} |
Input: $ARGUMENTS
Before executing, identify which interpretation matches the user's input:
Interpretation 1 — Refactoring specific code: The user has identified a particular piece of code (function, module, class) that needs structural improvement and wants a systematic plan to refactor it safely. Interpretation 2 — Assessing whether to refactor: The user suspects code needs refactoring but is unsure if it is worth the effort, and needs help evaluating the costs, risks, and benefits before committing. Interpretation 3 — Establishing refactoring practices: The user wants to build a team culture or workflow around safe refactoring, including when to refactor, how to scope it, and how to avoid regressions.
If ambiguous, ask: "I can help with refactoring specific code, deciding whether refactoring is worthwhile, or establishing refactoring practices — which fits?" If clear from context, proceed with the matching interpretation.
Procedure for systematically improving code structure without changing behavior
{'description': 'Refactoring MUST NOT change what the code does.\nOnly how it does it.\n', 'verification': ['All existing tests still pass', 'All known use cases still work', 'No new bugs introduced']}
{'description': 'Make small changes, one at a time.\nVerify each change before the next.\n', 'benefits': ['Easier to find problems', 'Can stop at any point', 'Reviewable changes']}
{'description': "Tests must exist before refactoring.\nIf they don't, write them first.\n", 'rule': 'Never refactor without tests covering the behavior'}
Understand what needs refactoring and why:
Make sure you have a safety net before refactoring:
Design a safe path to the goal:
Perform the refactoring incrementally:
Confirm refactoring didn't change behavior:
Finalize the refactoring:
Extract lessons from the refactoring: