code-refactor-master

Refactor legacy codebases with import tracking and TypeScript-safe file restructuring.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/ogprotege/Skills --skill code-refactor-master
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor-master
Source: https://github.com/ogprotege/Skills/tree/main/Categories/Code/code-refactor-master
Command: npx skills add https://github.com/ogprotege/Skills --skill code-refactor-master

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill refactors code for better organization, cleaner architecture, and improved maintainability, focusing on file structure, imports, and loading patterns.

Core Features & Use Cases

  • File organization & dependency tracking: Plans realignment of files with import maps.
  • Component refactoring: Breaks down large components into smaller, testable units.
  • Loading pattern enforcement: Replaces early-loading patterns with consistent loading UX.
  • Single responsibility & quality: Enforces best practices, type safety, and maintainability.

Quick Start

Scope: /ui, Mode: plan, Debug: on to identify refactor opportunities.

Frequently Asked Questions about code-refactor-master

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a large TypeScript codebase to improve organization and maintainability?

Refactoring large TypeScript codebases involves mapping all imports and dependencies, restructuring files for better organization, updating import paths after file moves, and enforcing consistent loading patterns. Start by running the Skill in plan mode with debug enabled to identify refactoring opportunities before executing changes.

How do I track and update imports when moving files in a TypeScript project?

File moves require discovering all imports before relocation, then systematically updating import paths across the codebase. This Skill discovers dependencies first, executes file restructuring, and updates all affected imports to maintain type safety and prevent broken references.

What's the best way to enforce consistent loading patterns across front-end and back-end modules?

Consistent loading patterns prevent fragmented user experience. This Skill enforces approved patterns like LoadingOverlay, SuspenseLoader, and PaperWrapper across your codebase, replacing ad-hoc loading implementations with standardized components while maintaining backward compatibility.

Can I refactor TypeScript components into smaller, testable units without breaking type safety?

Yes. This Skill extracts oversized components into smaller units while preserving TypeScript type safety and maintaining functional requirements. Dependency tracking ensures all references remain valid after extraction, and consistent patterns prevent breaking changes.

How do I plan a refactoring strategy before making changes to a legacy repository?

Use plan mode with debug enabled to analyze your codebase structure, identify refactoring opportunities, and preview changes before execution. This generates a dependency map showing all imports, file relationships, and recommended restructuring without modifying your code.

Does this approach work with large legacy repositories that have complex import dependencies?

Yes. This Skill is specifically designed for large legacy repositories with complex dependency structures. It handles file restructuring, import remapping, loading pattern enforcement, and type safety verification at scale while preserving backward compatibility.