REFACTORING & TECHNICAL DEBT

Identify technical debt and plan incremental refactors with characterization tests.

2|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/Kingdaddy007/Antigravity-OS --skill refactoring-technical-debt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: REFACTORING & TECHNICAL DEBT
Source: https://github.com/Kingdaddy007/Antigravity-OS/tree/main/global/skills/refactoring
Command: npx skills add https://github.com/Kingdaddy007/Antigravity-OS --skill refactoring-technical-debt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactoring and debt management are risky without a formal process. This skill provides a disciplined framework to identify technical debt, decide between refactor and rewrite, and execute safe, incremental improvements that preserve behavior.

Core Features & Use Cases

  • Debt assessment: quantify debt with velocity impact, defect density, and onboarding friction.
  • Incremental refactor planning: define scope, time boxes, and reversible steps to pay down debt.
  • Characterization-first safety: create tests that capture current behavior before changing structure; apply Strangler Fig migrations when needed.

Quick Start

Plan a safe, incremental refactor of a legacy module and begin with characterization tests.

Frequently Asked Questions about REFACTORING & TECHNICAL DEBT

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

FAQPage Schema
How do I safely refactor legacy code without breaking existing behavior?

To safely refactor legacy code, create characterization tests that capture current behavior before changing structure, then execute incremental, reversible steps to guarantee behavior preservation while paying down technical debt.

How do I decide between refactoring and rewriting a large monolith?

Assess technical debt by quantifying velocity impact, defect density, and onboarding friction to decide whether to refactor or rewrite a large monolith, favoring incremental refactoring when behavior preservation is critical.

What is the Strangler Fig pattern for technical debt paydown?

The Strangler Fig pattern is a migration technique applied during incremental refactoring to safely replace legacy modules by gradually strangling old code paths while preserving system behavior.

Can I use incremental refactoring on modules where tests do not currently exist?

Yes, you can refactor modules without tests by first writing characterization tests that document current behavior, ensuring you have safety nets before tackling boundary redesign or technical debt paydown.

What are the limitations of incremental refactoring for technical debt?

Incremental refactoring limitations include the necessity of characterization tests before changes and the requirement for reversible steps, making it less suitable for legacy modules where tests cannot be written.