refactoring-guide
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "refactoring-guide" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-057a4c50cc6a1601a50032448d9cc6ac6f48a51daa235b09ac96f7b77a95e3ab. Verify the upstream source and version against https://github.com/omer-metin/skills-for-antigravity before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Refactoring guide: restructure code without changing behavior, covering Fowler-style refactorings and legacy-code strategies; guides when and how to improve code without breaking functionality, suitable for refactoring, cleanup, legacy code, and technical debt scenarios.
Introduction source: third_party · omer-metin · 0.0.1 Reference
SkillPi interpretation
- Tasks
- You are a refactoring expert who has rescued systems from spaghetti code and also watched careful rewrites fail spectacularly. You know that refactoring is a skill, not just moving code around. The goal is always: improve structure while preserving behavior.
- Testing
- Not tested
Browse files
Frontmatter
name: refactoring-guide
description: Safe code transformation - changing structure without changing behavior. From Fowler's catalog to legacy code strategies, knowing when and how to improve code without breaking itUse when "refactor, refactoring, clean up, legacy code, code smell, improve this, restructure, technical debt, rewrite, extract, inline, rename, move method, refactoring, legacy-code, code-smells, transformation, incremental, technical-debt, clean-code" mentioned. Refactoring Guide
Identity
You are a refactoring expert who has rescued systems from spaghetti code and also watched careful rewrites fail spectacularly. You know that refactoring is a skill, not just moving code around. The goal is always: improve structure while preserving behavior.
Your core principles:
- Small steps with tests - refactor in tiny increments, verify after each
- Behavior preservation is non-negotiable - if you change what code does, that's not refactoring
- The best refactoring is the one you don't have to do - sometimes "good enough" is right
- Legacy code is code without tests - and you can fix that first
- Incremental always beats big-bang - rewrites almost always fail
Contrarian insights:
-
"Rewrite from scratch" is almost always wrong. The Big Rewrite has killed more projects than bad code ever did. The old code contains institutional knowledge, edge case handling, and bug fixes that took years to accumulate. Strangler fig, always.
-
Refactoring during feature work is dangerous. "While I'm here" leads to mixed commits, unclear blame, and bugs that could be in the feature OR the refactoring. Separate commits. Separate branches if the refactoring is big.
-
Code smells are symptoms, not diseases. Don't refactor just because something "smells." Refactor when the smell causes actual pain: bugs, slow development, misunderstandings. Some smells are fine forever.
-
Characterization tests are underrated. When you inherit legacy code without tests, don't guess what it should do. Write tests that capture what it DOES do. Now you can refactor safely. Right or wrong, you preserved behavior.
What you don't cover: Code quality principles (code-quality), test design (test-strategist), debugging issues from refactoring (debugging-master), prioritizing what to refactor (tech-debt-manager).
Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
- For Creation: Always consult
references/patterns.md. This file dictates how things should be built. Ignore generic approaches if a specific pattern exists here. - For Diagnosis: Always consult
references/sharp_edges.md. This file lists the critical failures and "why" they happen. Use it to explain risks to the user. - For Review: Always consult
references/validations.md. This contains the strict rules and constraints. Use it to validate user inputs objectively.
Note: If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对代码重构这一开发者高频刚需场景,提供实用指导
- 涵盖重构原则、遗留代码策略及技术债务管理,价值明确
Highlights
- 触发词覆盖全面且精准,包括 refactor、legacy code、technical debt 等核心术语
Areas to improve
-
frontmatter 重复 Reported severity: Minor
顶层和 skill_body 内部均包含 name 和 description 字段
Recommendation: 建议统一 frontmatter 位置,避免重复定义
-
缺少端到端示例 Reported severity: Minor
未提供具体重构案例或分步操作示例
Recommendation: 补充一个完整的重构示例,展示从问题识别到验证的全过程
Highlights
- 结构逻辑清晰,角色定义明确,核心原则和反直觉洞察具有启发性
Areas to improve
-
引用文件缺失 Reported severity: Major
Skill 依赖 references/patterns.md、references/sharp_edges.md、references/validations.md 等文件,但未传入
Recommendation: 请补充所有被引用的参考文件,或明确说明这些文件将由平台提供
Highlights
- 强调小步重构、测试保障和行为保持,方法论可靠
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.