Technical debt accumulates over time and slows development. This guide shows how to use Stellarion to systematically identify, prioritize, and reduce technical debt.
Technical debt includes:
Get a complete picture of technical debt:
Generate a technical debt report for this project.
Include priority and effort estimates.
This identifies:
Group debt by type to plan your approach:
Find all functions with complexity over 20.
Find code duplication in this project.
Are there files over 500 lines or directories with too many files?
Check for circular dependencies and tight coupling.
Use the debt quadrant to prioritize:
| Low Effort | High Effort | |
|---|---|---|
| High Impact | Do First | Plan Carefully |
| Low Impact | Quick Wins | Defer or Skip |
Focus on debt that:
Show me high-priority technical debt items
that are blocking our API development.
List all technical debt items in src/api/
sorted by priority and effort.
Consider:
Common approaches:
Don't try to fix everything at once:
What's the smallest change I can make
to reduce complexity in this function?
Before refactoring, ensure test coverage:
What test coverage exists for userService.ts?
Before changing shared code:
What would be affected if I refactor the
database connection module?
Generate a quality report.
Save it to docs/reports/quality-2024-01.md
Compare monthly:
Track improvements:
How has the complexity of src/api/ changed
since last month?
Use Stellarion in reviews:
Analyze the quality of code in this PR.
Does it introduce new technical debt?
Set limits for new code:
Flag any new functions with complexity over 15.
Regular architecture reviews:
Analyze the dependency structure.
Are we maintaining clean module boundaries?
Symptom: One function does everything Solution: Extract smaller, focused functions
Help me break down this 200-line function
into smaller pieces.
Symptom: Same logic in multiple places Solution: Extract shared utilities
Find duplicates of this validation logic
and help me consolidate them.
Symptom: A imports B, B imports A Solution: Extract shared code or restructure
Find circular dependencies in src/
and suggest how to break them.
Symptom: Multiple levels of if/else/loops Solution: Use early returns, extract functions
Help me flatten this deeply nested function
using early returns.