busirocket-refactor-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRefactor Workflow
重构工作流
Strict, step-by-step refactoring guidance for maintaining code quality.
用于维持代码质量的严格、分步式重构指南。
When to Use
适用场景
Use this skill when:
- Refactoring files with multiple exports (use workflow)
@file - Splitting components/hooks/utils into smaller files
- Moving inline types to
types/ - Enforcing post-refactor quality checks
在以下场景中使用本技能:
- 重构包含多个导出的文件(使用工作流)
@file - 将组件/钩子/工具函数拆分为更小的文件
- 将内联类型迁移至目录
types/ - 强制执行重构后质量检查
Non-Negotiables (MUST)
不可妥协的规则(必须遵守)
- After any refactor: run the project's standard checks (e.g. ) as a mandatory quality gate.
yarn check:all - If a file has multiple responsibilities, split immediately.
- If a hook/component contains helpers, extract them.
- If a file declares types inline, move them to .
types/ - Never use index/barrel files; import from concrete modules only.
- 任何重构完成后:运行项目的标准检查(例如),这是强制性的质量检查环节。
yarn check:all - 如果一个文件承担多项职责,立即拆分。
- 如果钩子/组件中包含辅助函数,将其提取出来。
- 如果文件中声明了内联类型,将其迁移至目录。
types/ - 绝不使用索引/桶文件;仅从具体模块导入。
@file Refactor Workflow
@file 重构工作流
When referencing for a one-shot refactor:
@file- Exactly one exported symbol per file.
- No inline /
interfacedeclarations in non-type files.type - No helper functions inside components/hooks.
当引用进行一次性重构时:
@file- 每个文件恰好包含一个导出符号。
- 非类型文件中不得存在内联/
interface声明。type - 组件/钩子内部不得包含辅助函数。
Rules
规则
@file Refactor Workflow
@file 重构工作流
- - @file refactor workflow (strict constraints)
refactor-file-workflow - - Mandatory checks after refactor
refactor-mandatory-checks
- - @file重构工作流(严格约束)
refactor-file-workflow - - 重构后必须执行的检查
refactor-mandatory-checks
Refactoring TypeScript/React
TypeScript/React 重构
- - Goals for refactoring (many small files, one export per file)
refactor-goals - - Decision rules for when to split files
refactor-decision-rules - - Never use index files
refactor-never-index-files - - Post-refactor checks (MANDATORY)
refactor-post-refactor-checks
- - 重构目标(拆分为多个小文件,每个文件一个导出)
refactor-goals - - 文件拆分的判定规则
refactor-decision-rules - - 绝不使用索引文件
refactor-never-index-files - - 重构后检查(必须遵守)
refactor-post-refactor-checks
Post-Refactor Checks
重构后检查
- - Golden path for post-refactor checks
refactor-golden-path - - File size targets and max lines
refactor-file-size-guidelines - - What to do if checks fail
refactor-if-something-fails - - Fast heuristics for when to split files
refactor-when-to-split
- - 重构后检查的标准流程
refactor-golden-path - - 文件大小目标与最大行数限制
refactor-file-size-guidelines - - 检查失败时的处理方式
refactor-if-something-fails - - 文件拆分的快速判定准则
refactor-when-to-split
Related Skills
相关技能
- - File structure and boundaries
busirocket-core-conventions - - TypeScript standards to enforce
busirocket-typescript-standards - - Component/hook patterns
busirocket-react
- - 文件结构与边界规范
busirocket-core-conventions - - 需强制执行的TypeScript标准
busirocket-typescript-standards - - 组件/钩子模式
busirocket-react
How to Use
使用方法
Read individual rule files for detailed explanations and code examples:
rules/refactor-file-workflow.md
rules/refactor-decision-rules.md
rules/refactor-post-refactor-checks.mdEach rule file contains:
- Brief explanation of why it matters
- Code examples (correct and incorrect patterns)
- Additional context and best practices
阅读单个规则文件以获取详细说明与代码示例:
rules/refactor-file-workflow.md
rules/refactor-decision-rules.md
rules/refactor-post-refactor-checks.md每个规则文件包含:
- 规则重要性的简要说明
- 代码示例(正确与错误模式)
- 额外背景信息与最佳实践