The cc-refactor-safety skill acts as a comprehensive guardrail for AI-assisted code refactoring. It addresses common pitfalls like data structure mismatches, UI layout degradation, and circular dependencies by mandating a 'read-before-refactor' workflow. By requiring the AI to generate structured comparison reports and validation checklists, it ensures that structural improvements never lead to functionality regressions. It is particularly useful for complex tasks such as splitting services, optimizing conditional logic, and refactoring UI components where subtle details are easily lost.
主要功能
01UI layout preservation protocols for complex container components like Modals and Drawers.
02Cross-file 'Shotgun Fix' detection to ensure consistent logic updates across the codebase.
03Mandatory original code analysis to eliminate memory-based hallucinations during refactoring.
04Pre-emptive circular dependency detection for module extraction and service decoupling.
05772 GitHub stars
06Automated comparison checklists for mapping data structures, table columns, and API fields.
使用场景
01Splitting monolithic services into modular sub-services without introducing dependency loops.
02Refactoring complex UI tables with conditional rendering while maintaining all existing business logic.
03Renaming core data models across large-scale conditional branches and enum mappings.