domains / software-engineering / tech-debt-remediation / code-refactoring-tech-debt
The two copies share the same inventory, impact, metrics, and remediation structure, but they disagree on how to treat the numeric examples and on scope. The antigravity copy presents the dollar/hour figures as the procedure's calculations, while the agentic-awesome copy explicitly labels them as hypothetical planning examples, forbids fabricating telemetry, and restricts review-only scope. Crowning one copy would hide the other's safety constraints and its different ROI framing.
| Repository | Path |
|---|---|
| rmyndharis/antigravity-skills | skills/code-refactoring-tech-debt/SKILL.md |
| sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/code-refactoring-tech-debt/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | rmyndharis/antigravity-skills | skills/code-refactoring-tech-debt/SKILL.md |
| peer | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/code-refactoring-tech-debt/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills/skills/code-refactoring-tech-debt/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | skills/code-refactoring-tech-debt/SKILL.md |
---
name: code-refactoring-tech-debt
description: "Identify technical debt from actual code and change history, estimate its impact, and prioritize bounded improvements with explicit assumptions."
---
# 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
Inspect the current repository, hotspots, and real change/incident history. The numbers, thresholds, staffing, and timelines below are hypothetical planning examples, not measurements, promised returns, or mandatory quality gates. Report missing cost/usage inputs as unknown; never fill them with fabricated telemetry. Review-only scope does not authorize broad refactors, policy changes, or deployment.
## 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 using only data available in the repository or supplied by the user. Label all illustrative figures as hypothetical.
**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 (hypothetical)
```
**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 (hypothetical)
Annual Cost: $48,600 (hypothetical)
```
**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**
```yaml
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%
integration: 12%
e2e: 5%
target: 80% / 60% / 30%
dependency_health:
outdated_major: 12
outdated_minor: 34
security_vulnerabilities: 7
deprecated_apis: 15
```
**Trend Analysis**
```python
debt_trends = {
"2024_Q1": {"score": 750, "items": 125},
"2024_Q2": {"score": 820, "items": 142},
"2024_Q3": {"score": 890, "items": 156},
"growth_rate": "18.7% across Q1 to Q3 in this hypothetical series",
"projection": "1200 by 2025_Q1 without intervention"
}
```
### 4. Prioritized Remediation Plan
Create an actionable roadmap based on ROI. Use net time ROI: (savings - effort) / effort.
**Quick Wins (High Value, Low Effort)**
Week 1-2:
```
1. Extract duplicate validation logic to shared module
Effort: 8 hours
Savings: 20 hours/month
Illustrative net time ROI: (20 - 8) / 8 = 150% in first month
2. Add error monitoring to payment service
Effort: 4 hours
Savings: 15 hours/month debugging
Illustrative net time ROI: (15 - 4) / 4 = 275% in first month
3. Automate deployment script
Effort: 12 hours
Savings: 2 hours/deployment × 20 deploys/month
Illustrative net time ROI: (40 - 12) / 12 = 233% in first month
```
**Medium-Term Improvements (Month 1-3)**
```
1. Refactor OrderService (God class)
- Split into 4 focused services
- Add comprehensive tests
- Create clear interfaces
Effort: 60 hours
Savings: 30 hours/month maintenance
ROI: Positive after 2 months
2. Upgrade React 16 → 18
- Update component patterns
- Migrate to hooks
- Fix breaking changes
Effort: 80 hours
Benefits: Performance +30%, Better DX
ROI: Positive after 3 months
```
**Long-Term Initiatives (Quarter 2-4)**
```
1. Implement Domain-Driven Design
- Define bounded contexts
- Create domain models
- Establish clear boundaries
Effort: 200 hours
Benefits: 50% reduction in coupling
ROI: Positive after 6 months
2. Comprehensive Test Suite
- Unit: 80% coverage
- Integration: 60% coverage
- E2E: 30% coverage
Effort: 150 hours
Benefits: Reduced regression risk
ROI: Positive after 4 months
```
## Conflicts
- rmyndharis/antigravity-skills presents impact-assessment dollar figures as the procedure's calculations; sickn33/agentic-awesome-skills labels them as hypothetical planning examples and forbids fabricating telemetry.
- rmyndharis/antigravity-skills uses gross ROI percentages; sickn33/agentic-awesome-skills uses illustrative net time ROI.
- sickn33/agentic-awesome-skills adds a scope constraint that review-only does not authorize broad refactors, policy changes, or deployment; rmyndharis/antigravity-skills has no such constraint.