refactoring-engine

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Refactoring Engine

重构引擎

This skill moves beyond line-by-line changes to perform systemic improvements to the code architecture.
该Skill超越了逐行修改的范畴,对代码架构进行系统性改进。

Capabilities

核心能力

1. Pattern Migration

1. 模式迁移

  • Migrates components to new design systems (e.g., from CSS modules to Tailwind, or to Atomic Design).
  • Converts legacy syntax to modern standards (e.g., Class components to Functional components in React).
  • 将组件迁移至新的设计系统(例如从CSS modules迁移到Tailwind或Atomic Design)。
  • 将旧版语法转换为现代标准(例如将React中的Class组件转换为Functional组件)。

2. Dependency Decoupling

2. 依赖解耦

  • Identifies and breaks circular dependencies.
  • Extracts shared logic into centralized services or utilities.
  • 识别并打破循环依赖。
  • 将共享逻辑提取到中心化服务或工具中。

Workflow

工作流程

  1. Pinning Tests (Mandatory): Before changing any code, create tests that capture the current behavior (even if it's messy). This ensures no regression occurs.
  2. Architectural Analysis: Use
    cognitive-load-auditor
    to identify high-complexity hotspots.
  3. Pattern Migration: Apply clean code patterns (Guard Clauses, Strategy, etc.).
  1. 固定测试(必填步骤):在修改任何代码之前,创建能捕获当前行为的测试(即使代码当前状态混乱)。这可确保不会出现回归问题。
  2. 架构分析:使用
    cognitive-load-auditor
    识别高复杂度的热点区域。
  3. 模式迁移:应用整洁代码模式(如卫语句、策略模式等)。

Knowledge Protocol

知识协议

  • This skill adheres to the
    knowledge/orchestration/knowledge-protocol.md
    . It automatically integrates Public, Confidential (Company/Client), and Personal knowledge tiers, prioritizing the most specific secrets while ensuring no leaks to public outputs.
  • 该Skill遵循
    knowledge/orchestration/knowledge-protocol.md
    协议。它会自动整合公开、保密(公司/客户)和个人知识层级,优先处理最具体的保密内容,同时确保不会泄露到公开输出中。