refactoring
Team standard for improving existing code without changing behaviour. Use when refactoring code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Team standard for improving existing code without changing behaviour. Use when refactoring code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Team quality gate as executable instruction. Use when reviewing completed work before merge, or when processing PR review comments received from other reviewers.
Generate well-formed user stories from technical context. Use when generating or improving story descriptions for an issue tracker.
Type-safe validated configuration properties from application.yml. Use when adding any externalisable value.
Consistent error handling with named exceptions and global handler. Use when implementing any method that can fail with a business reason.
Consistent, safe log statements with correct levels and no PII. Use when adding or reviewing log statements.
Team threat model as executable instruction. Use when checking code for security issues before merge.
| name | refactoring |
| description | Team standard for improving existing code without changing behaviour. Use when refactoring code. |
When to load it: When improving existing code without changing observable behaviour.
Applies the team's refactoring philosophy to a specific piece of code. Proposes improvements that reduce complexity, remove duplication, and align with project conventions — without changing the public interface or adding unrequested behaviour. Output is a proposed change with explanation of what each transformation does and why.
Opening prompt structure:
I need to refactor [ComponentName / method / file].
Problem: [what is wrong — duplication / complexity / convention violation / other]
Constraints:
- Do not change the public interface
- Do not change observable behaviour
- Follow [specific convention from Layer 1 or Layer 2]
Current code:
[paste the code]
Propose the refactored version. Explain each transformation.
Do not change anything not related to the stated problem.
Response structure the skill produces:
Problem identified: [one sentence]
Transformations:
1. [transformation name] — [what changed and why]
2. [transformation name] — [what changed and why]
Refactored code:
[code]
Public interface unchanged: [confirm or flag deviations]
Tests required: [list any new tests needed to verify the transformation]