Code Refactoring Tech Debt
Code Refactoring Tech Debt is an code AI skill with a core value of You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. It
helps developers solve real-world problems in the code domain, boosting
efficiency, automating repetitive tasks, and optimizing workflows.
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
Quick Facts
mkdir -p ./skills/code-refactoring-tech-debt && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/code-refactoring-tech-debt/SKILL.md -o ./skills/code-refactoring-tech-debt/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Technical Debt Analysis and Remediation
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create actionable remediation plans.
Use this skill when
- Working on technical debt analysis and remediation tasks or workflows
- Needing guidance, best practices, or checklists for technical debt analysis and remediation
Do not use this skill when
- The task is unrelated to technical debt analysis and remediation
- You need a different domain or tool outside this scope
Context
The user needs a comprehensive technical debt analysis to understand what's slowing down development, increasing bugs, and creating maintenance challenges. Focus on practical, measurable improvements with clear ROI.
Requirements
$ARGUMENTS
Instructions
1. Technical Debt Inventory
Conduct a thorough scan for all types of technical debt:
**Code Debt**
- **Duplicated Code**
- Exact duplicates (copy-paste)
- Similar logic patterns
- Repeated business rules
- Quantify: Lines duplicated, locations
- **Complex Code**
- High cyclomatic complexity (>10)
- Deeply nested conditionals (>3 levels)
- Long methods (>50 lines)
- God classes (>500 lines, >20 methods)
- Quantify: Complexity scores, hotspots
- **Poor Structure**
- Circular dependencies
- Inappropriate intimacy between classes
- Feature envy (methods using other class data)
- Shotgun surgery patterns
- Quantify: Coupling metrics, change frequency
**Architecture Debt**
- **Design Flaws**
- Missing abstractions
- Leaky abstractions
- Violated architectural boundaries
- Monolithic components
- Quantify: Component size, dependency violations
- **Technology Debt**
- Outdated frameworks/libraries
- Deprecated API usage
- Legacy patterns (e.g., callbacks vs promises)
- Unsupported dependencies
- Quantify: Version lag, security vulnerabilities
**Testing Debt**
- **Coverage Gaps**
- Untested code paths
- Missing edge cases
- No integration tests
- Lack of performance tests
- Quantify: Coverage %, critical paths untested
- **Test Quality**
- Brittle tests (environment-dependent)
- Slow test suites
- Flaky tests
- No test documentation
- Quantify: Test runtime, failure rate
**Documentation Debt**
- **Missing Documentation**
- No API documentation
- Undocumented complex logic
- Missing architecture diagrams
- No onboarding guides
- Quantify: Undocumented public APIs
**Infrastructure Debt**
- **Deployment Issues**
- Manual deployment steps
- No rollback procedures
- Missing monitoring
- No performance baselines
- Quantify: Deployment time, failure rate
2. Impact Assessment
Calculate the real cost of each debt item:
**Development Velocity Impact**
Debt Item: Duplicate user validation logic
Locations: 5 files
Time Impact:
- 2 hours per bug fix (must fix in 5 places)
- 4 hours per feature change
- Monthly impact: ~20 hours
Annual Cost: 240 hours × $150/hour = $36,000**Quality Impact**
Debt Item: No integration tests for payment flow
Bug Rate: 3 production bugs/month
Average Bug Cost:
- Investigation: 4 hours
- Fix: 2 hours
- Testing: 2 hours
- Deployment: 1 hour
Monthly Cost: 3 bugs × 9 hours × $150 = $4,050
Annual Cost: $48,600**Risk Assessment**
- **Critical**: Security vulnerabilities, data loss risk
- **High**: Performance degradation, frequent outages
- **Medium**: Developer frustration, slow feature delivery
- **Low**: Code style issues, minor inefficiencies
3. Debt Metrics Dashboard
Create measurable KPIs:
**Code Quality Metrics**
Metrics:
cyclomatic_complexity:
current: 15.2
target: 10.0
files_above_threshold: 45
code_duplication:
percentage: 23%
target: 5%
duplication_hotspots:
- src/validation: 850 lines
- src/api/handlers: 620 lines
test_coverage:
unit: 45%🎯 Best For
- Tech leads planning refactors
- Developers modernizing legacy code
- Data analysts
- Business intelligence teams
- Claude users
💡 Use Cases
- Migrating from class components to hooks
- Breaking apart monolithic functions
- Finding patterns in customer data
- Creating automated dashboards
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Code Refactoring Tech Debt to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does this handle breaking changes?
Refactoring skills identify breaking changes but always run your test suite after applying suggestions.
Can this connect to my database directly?
Most data skills accept CSV or JSON input. Database connectors are listed in the Works With section.
Is Code Refactoring Tech Debt compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Code Refactoring Tech Debt?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Code Refactoring Tech Debt?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/code-refactoring-tech-debt/SKILL.md, ready to use.
⚠️ Common Mistakes to Avoid
Refactoring without tests
Never refactor critical paths without a comprehensive test suite to catch regressions.
Not validating data quality
AI analysis is only as good as your input data. Profile and clean data before analysis.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.