Install
npx skillscat add ihkreddy/agent-skills-ts/tech-debt-report Install via the SkillsCat registry.
Tech Debt Report Generator
Scans the codebase to identify technical debt including TODO comments, deprecated API usage, outdated patterns, and potential refactoring opportunities.
๐ฏ Use Case Demo
Scenario: Quarterly Tech Debt Assessment
Before (Manual Process):
Tech Lead needs to assess tech debt for planning:
- Grep for TODO and FIXME comments
- Manually review code for deprecated APIs
- Check for outdated patterns
- Try to estimate effort for each item
- Create Jira tickets manually
- Prioritize based on gut feeling
Time: 1-2 days, incomplete coverage
After (With This Skill):
Tech Lead: "Generate tech debt report for the codebase"
Agent Response:
๐ง TECHNICAL DEBT REPORT โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ Report Date: December 20, 2024 ๐ Scanned: 47 files, 8,234 lines of code โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ DEBT SUMMARY โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | Category | Count | Estimated Effort | Priority | |----------|-------|------------------|----------| | Critical TODOs | 3 | 2 days | ๐ด High | | Deprecated APIs | 5 | 1 day | ๐ด High | | Code Smells | 12 | 3 days | ๐ก Medium | | Old Patterns | 8 | 2 days | ๐ก Medium | | Minor TODOs | 15 | 1 day | ๐ข Low | | **TOTAL** | **43** | **9 days** | | โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ด CRITICAL ISSUES (Fix ASAP) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 1. ๐จ Security: Hardcoded API Key ๐ Services/PaymentService.cs:23 ```csharp // TODO: Move to environment variable - URGENT private const string ApiKey = "sk_live_xxxxx";โฑ๏ธ Effort: 30 min
๐ซ Suggested: Create Jira ticket with "security" label
๐จ Data Loss Risk: Missing Transaction
๐ Services/BookingService.cs:156// FIXME: No transaction wrapper - can cause partial bookings await _repository.CreateBooking(booking); await _paymentService.Charge(payment);โฑ๏ธ Effort: 2 hours
๐ซ Suggested: High priority bug ticket๐จ Deprecated: Newtonsoft.Json
๐ Multiple files (7 occurrences)
Issue: Using Newtonsoft.Json instead of System.Text.Json
Impact: Performance, security updates
โฑ๏ธ Effort: 4 hours
๐ซ Suggested: Refactoring ticketโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก DEPRECATED API USAGE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Location Deprecated API Replacement FlightsController.cs:45 DateTime.NowDateTime.UtcNowBookingService.cs:89 HttpClient()IHttpClientFactoryFlightService.cs:34 GetAwaiter().GetResult()async/awaitSearchRequest.cs:12 [Obsolete] FlightClassCabinClassenumProgram.cs:67 UseUrls()WebApplication.Urlsโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ TODO/FIXME COMMENTS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโHigh Priority (blocking or risky):
๐ BookingService.cs:45 - TODO: Add retry logic for API calls
๐ PaymentService.cs:78 - FIXME: Handle timeout properly
๐ FlightService.cs:112 - TODO: Cache this queryMedium Priority (quality/performance):
๐ FlightsController.cs:89 - TODO: Add pagination
๐ BookingsController.cs:34 - TODO: Add input validation
๐ SearchRequest.cs:23 - TODO: Add date range validation
... and 6 moreLow Priority (nice to have):
๐ Multiple files - TODO: Add XML documentation
๐ Models/*.cs - TODO: Add validation attributes
... and 9 moreโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ OUTDATED PATTERNS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Manual Dependency Injection
๐ Program.cs:23-45
Current: Manual service registration
Better: Use Scrutor for assembly scanning
Effort: 2 hoursString Concatenation in Queries
๐ FlightService.cs:67
Current: String interpolation in SQL
Better: Parameterized queries or EF Core
Risk: SQL Injection (CRITICAL)
Effort: 1 hourSynchronous File I/O
๐ Services/LogService.cs:34
Current: File.WriteAllText()
Better: File.WriteAllTextAsync()
Effort: 15 minโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ RECOMMENDED ACTION PLAN
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโSprint 1 (Immediate - 2 days):
โก Fix hardcoded API key (security)
โก Add transaction wrapper (data integrity)
โก Fix SQL injection vulnerabilitySprint 2 (Next - 3 days):
โก Migrate from Newtonsoft.Json
โก Fix deprecated HttpClient usage
โก Add retry logic to API callsSprint 3 (Planned - 4 days):
โก Clean up remaining TODOs
โก Modernize DI registration
โก Add missing validationโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ซ CREATE JIRA TICKETS?
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโSay "Create tickets for critical tech debt" to automatically
create Jira tickets for the high-priority items.โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
Time Saved: 1-2 days โ 2 minutes (500x faster)
Agent Instructions
When this skill is activated:
Scan for TODO/FIXME Comments:
- Search all source files for TODO, FIXME, HACK, XXX comments
- Extract the comment text and file location
- Parse any ticket references or priority indicators
Check for Deprecated APIs:
- Look for
[Obsolete]attributes - Check for known deprecated patterns:
DateTime.NowโDateTime.UtcNownew HttpClient()โIHttpClientFactoryGetAwaiter().GetResult()โ proper async- Newtonsoft.Json โ System.Text.Json
- Check for deprecated framework APIs
- Look for
Identify Code Smells:
- Long methods (>50 lines)
- Large classes (>500 lines)
- Deep nesting (>4 levels)
- Magic numbers/strings
- Duplicate code patterns
Assess Security Issues:
- Hardcoded secrets/keys
- SQL injection vulnerabilities
- Missing input validation
Categorize and Prioritize:
- Critical: Security, data integrity
- High: Deprecated APIs, blocking TODOs
- Medium: Performance, code quality
- Low: Documentation, minor cleanup
Estimate Effort:
- Based on scope and complexity
- Consider testing requirements
Generate Action Plan:
- Group into sprint-sized chunks
- Prioritize by risk and impact
Example Prompts
- "Generate tech debt report"
- "Find all TODO comments in the codebase"
- "Check for deprecated API usage"
- "What refactoring is needed?"
- "Show me code quality issues"
Benefits
| Metric | Before | After | Improvement |
|---|---|---|---|
| Assessment time | 1-2 days | 2 min | 500x faster |
| Coverage | 60-70% | 100% | Complete scan |
| Prioritization | Subjective | Data-driven | Better decisions |
| Tracking | Ad-hoc | Systematic | Nothing forgotten |