refactor

Guides refactoring decisions and strategy selection for code improvement.

70|13|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/AsiaOstrich/universal-dev-standards --skill refactor-asiaostrich
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/AsiaOstrich/universal-dev-standards/tree/main/.gemini/skills/refactoring-assistant
Command: npx skills add https://github.com/AsiaOstrich/universal-dev-standards --skill refactor-asiaostrich

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill assists developers in making informed decisions about refactoring code, recommending appropriate strategies, and providing step-by-step guidance to improve code quality and maintainability.

Core Features & Use Cases

  • Refactoring vs. Rewrite Decisions: Guides users through a decision tree to determine the best approach for code improvement.
  • Strategy Recommendation: Suggests tactical, strategic, and safety-focused refactoring patterns based on the context.
  • Workflow Guidance: Provides structured steps for executing refactoring tasks safely and effectively.
  • Use Case: When faced with a complex legacy module, use this Skill to assess whether to refactor incrementally or pursue a full rewrite, and then follow the recommended steps for the chosen strategy.

Quick Start

Use the refactor skill to start an interactive guide for refactoring the 'src/utils' directory.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I decide between refactoring legacy code or doing a full rewrite?

To decide between refactoring legacy code or rewriting, use a structured decision tree to evaluate code quality metrics and technical debt. This process recommends whether to refactor incrementally or execute a full rewrite based on your specific context.

What is the best strategy for reducing technical debt in complex software architecture?

The best strategy for reducing technical debt involves applying categorized tactical, strategic, and safety-focused refactoring patterns. This ensures architectural restructuring improves maintainability without compromising existing system stability.

How do I safely execute a refactoring workflow for a complex module?

To safely execute a refactoring workflow, follow structured step-by-step guidance that incorporates safety patterns. This workflow ensures code improvement tasks are carried out effectively while mitigating risks in legacy code modernization.

What do I need to know before starting an incremental code refactoring strategy?

Before starting code refactoring, you need an understanding of code quality metrics and refactoring principles. This foundational knowledge is required to properly navigate the decision tree and select appropriate tactical patterns.

When should I not use an incremental refactoring approach for technical debt reduction?

You should not use incremental refactoring when a decision tree assessment determines that technical debt or structural decay is too severe. In these extreme cases, a full rewrite strategy is recommended over tactical or strategic refactoring patterns.