refactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
原文 · 译文尚未补齐适用对象:设计与内容创作。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- Refactor
- Overview
- When to Use
- Refactoring Principles
- The Golden Rules
- When NOT to Refactor
- Common Code Smells & Fixes
- 1. Long Method/Function
Improve code structure and readability without changing external behavior. Refactoring is gradual evolution, not revolution. Use this for improving existing code, not rewriting from scratch. Use this skill when: Code is hard to understand or maintain Functions/classes are too large Code smells need addressing Adding features is difficult due to code structure User asks "clean up this code", "refactor this", "improve this" -- 1. Behavior is preserved - Refactoring doesn't change what the code does, only how 2. Small steps - Make tiny changes, test after each 3. Version control is your friend - Commit before and after each safe state 4. Tests are essential - Without tests, you're not refactoring, you're editing 5. One thing at a time - Don't mix refactoring with feature changes -- -- -- -- -- -- [ ] Functions are small (< 50 lines) [ ] Functions do one thing [ ] No duplicated code [ ] Descriptive names (variables, functions, classes) [ ] No magic numbers/strings [ ] Dead code removed [ ] Related code is together [ ] Clear module boundaries [ ] Dependencies flow in one direction [ ] No circular dependencies [ ] Types defined for all public APIs [ ] No any types without justification [
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- OKHP3/skillz
- 源文件
- docs/archive/skill-redundancy-2026-09-19/browser-refactor/refactor/SKILL.md
- 固定版本
- 7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:OKHP3/skillz · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-10T10:00:54.850Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。