Technical Debt Analyzer
Systematically identify, analyze, and document technical debt.
When to Use
Use for:
- Analyzing code quality issues
- Creating technical debt registers
- Assessing code maintainability
- Identifying dependency problems
- Documenting security vulnerabilities
- Planning refactoring efforts
Don't use when:
- Writing new code → use
generic-feature-developer
- Code review → use
generic-code-reviewer
- Writing tests → use
test-specialist
Quick Analysis Commands
# Find large files (>500 lines)
find src -name "*.ts" -exec wc -l {} + | awk '$1 > 500' | sort -rn
# Find TODO/FIXME markers
grep -rn "TODO\|FIXME\|HACK\|XXX" src/
# Check for console.log in production code
grep -rn "console.log" src/ --include="*.ts" --include="*.tsx"
# Find TypeScript 'any' usage
grep -rn ": any" src/ --include="*.ts" --include="*.tsx"
# Check outdated dependencies
npm outdated
# Security vulnerabilities
npm audit
# Unused exports (requires ts-unused-exports)
npx ts-unused-exports tsconfig.json
Debt Categories
| Category |
Examples |
| Code Quality |
Large files, complex functions, TODO/FIXME markers |
| Architectural |
Tight coupling, missing abstractions, circular deps |
| Test |
Missing coverage, fragile tests, slow execution |
| Documentation |
Missing README, outdated docs, no ADRs |
| Dependency |
Outdated packages, security vulnerabilities |
| Performance |
N+1 queries, memory leaks, large bundles |
| Security |
Missing validation, exposed secrets, XSS/SQL injection |
Analysis Workflow
1. Automated Detection
Code Smells to Check:
- Large files (>500 lines)
- Complex functions (cyclomatic complexity >10)
- Debt markers (TODO, FIXME, HACK, XXX)
- Console statements in production code
any types in TypeScript
- Long parameter lists (>5 params)
- Deep nesting (>4 levels)
Dependency Issues:
- Deprecated packages
- Duplicate functionality
- Loose version constraints
- Known vulnerabilities
2. Severity Assessment
| Severity |
Criteria |
Action |
| Critical |
Security vulns, data loss risk |
Immediate fix |
| High |
Performance problems, blocking issues |
Current sprint |
| Medium |
Code quality, missing docs |
This quarter |
| Low |
Minor smells, optimizations |
When convenient |
3. Priority Matrix
| Impact / Effort |
Low |
Medium |
High |
| High Impact |
Do First |
Do Second |
Plan & Do |
| Medium Impact |
Do Second |
Plan & Do |
Consider |
| Low Impact |
Quick Win |
Consider |
Avoid |
Debt Register Format
## DEBT-001: Description
**Category:** Code Quality | **Severity:** High
**Location:** src/services/UserService.ts
**Description:** Brief description of the issue
**Impact:**
- Business: How it affects delivery
- Technical: Why it's problematic
- Risk: What could go wrong
**Proposed Solution:** What to do about it
**Effort:** Days/hours estimate
**Target:** Sprint/quarter
Prevention Strategies
Automated Guards
{
"rules": {
"complexity": ["error", 10],
"max-lines-per-function": ["error", 50],
"max-params": ["error", 5],
"max-depth": ["error", 4]
}
}
Maintenance Schedule
| Frequency |
Tasks |
| Weekly |
Review TODO/FIXME, update register |
| Monthly |
Dependency updates, debt review |
| Quarterly |
Full analysis, architecture review |
Self-Critique Checklist
After completing debt analysis:
See Also
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: tech-debt-analyzer3description: This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability. Use this for identifying code smells, architectural issues, dependency problems, missing documentation, security vulnerabilities, and creating comprehensive technical debt documentation. Use when this capability is needed.4---56# Technical Debt Analyzer78Systematically identify, analyze, and document technical debt.910## When to Use1112**Use for:**1314- Analyzing code quality issues15- Creating technical debt registers16- Assessing code maintainability17- Identifying dependency problems18- Documenting security vulnerabilities19- Planning refactoring efforts2021**Don't use when:**2223- Writing new code → use `generic-feature-developer`24- Code review → use `generic-code-reviewer`25- Writing tests → use `test-specialist`2627## Quick Analysis Commands2829```bash30# Find large files (>500 lines)31find src -name "*.ts" -exec wc -l {} + | awk '$1 > 500' | sort -rn3233# Find TODO/FIXME markers34grep -rn "TODO\|FIXME\|HACK\|XXX" src/3536# Check for console.log in production code37grep -rn "console.log" src/ --include="*.ts" --include="*.tsx"3839# Find TypeScript 'any' usage40grep -rn ": any" src/ --include="*.ts" --include="*.tsx"4142# Check outdated dependencies43npm outdated4445# Security vulnerabilities46npm audit4748# Unused exports (requires ts-unused-exports)49npx ts-unused-exports tsconfig.json50```5152## Debt Categories5354| Category | Examples |55| ------------- | ------------------------------------------------------ |56| Code Quality | Large files, complex functions, TODO/FIXME markers |57| Architectural | Tight coupling, missing abstractions, circular deps |58| Test | Missing coverage, fragile tests, slow execution |59| Documentation | Missing README, outdated docs, no ADRs |60| Dependency | Outdated packages, security vulnerabilities |61| Performance | N+1 queries, memory leaks, large bundles |62| Security | Missing validation, exposed secrets, XSS/SQL injection |6364## Analysis Workflow6566### 1. Automated Detection6768**Code Smells to Check:**6970- Large files (>500 lines)71- Complex functions (cyclomatic complexity >10)72- Debt markers (TODO, FIXME, HACK, XXX)73- Console statements in production code74- `any` types in TypeScript75- Long parameter lists (>5 params)76- Deep nesting (>4 levels)7778**Dependency Issues:**7980- Deprecated packages81- Duplicate functionality82- Loose version constraints83- Known vulnerabilities8485### 2. Severity Assessment8687| Severity | Criteria | Action |88| -------- | ------------------------------------- | --------------- |89| Critical | Security vulns, data loss risk | Immediate fix |90| High | Performance problems, blocking issues | Current sprint |91| Medium | Code quality, missing docs | This quarter |92| Low | Minor smells, optimizations | When convenient |9394### 3. Priority Matrix9596| Impact / Effort | Low | Medium | High |97| --------------- | --------- | --------- | --------- |98| High Impact | Do First | Do Second | Plan & Do |99| Medium Impact | Do Second | Plan & Do | Consider |100| Low Impact | Quick Win | Consider | Avoid |101102## Debt Register Format103104```markdown105## DEBT-001: Description106107**Category:** Code Quality | **Severity:** High108**Location:** src/services/UserService.ts109110**Description:** Brief description of the issue111112**Impact:**113114- Business: How it affects delivery115- Technical: Why it's problematic116- Risk: What could go wrong117118**Proposed Solution:** What to do about it119**Effort:** Days/hours estimate120**Target:** Sprint/quarter121```122123## Prevention Strategies124125### Automated Guards126127```json128{129 "rules": {130 "complexity": ["error", 10],131 "max-lines-per-function": ["error", 50],132 "max-params": ["error", 5],133 "max-depth": ["error", 4]134 }135}136```137138### Maintenance Schedule139140| Frequency | Tasks |141| --------- | ---------------------------------- |142| Weekly | Review TODO/FIXME, update register |143| Monthly | Dependency updates, debt review |144| Quarterly | Full analysis, architecture review |145146## Self-Critique Checklist147148After completing debt analysis:149150- [ ] All automated checks run151- [ ] Manual review of critical paths done152- [ ] Severity assessments justified153- [ ] Proposed solutions are actionable154- [ ] Priority matrix applied consistently155- [ ] Register entries are complete156157## See Also158159- [Code Review Standards](../_shared/CODE_REVIEW_STANDARDS.md) - Quality checks160- Project `CLAUDE.md` - Workflow rules161162---163> Converted and distributed by [TomeVault](https://tomevault.io/claim/travisjneuman) — claim your Tome and manage your conversions.164<!-- tomevault:4.0:skill_md:2026-04-11 -->