{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicxa7lgzilymjspn56ks2ywrxiuuxnnjjsysdiucvkfnshvnetvqq",
"uri": "at://did:plc:fdfg7uwpthbb4zdam6e2xtvn/app.bsky.feed.post/3mobfhmbns6an"
},
"description": "A small CLI-ish module for tracking technical debt items in a codebase. Supports adding, listing, and prioritizing debt entries. // Technical Debt Tracker // Tracks pieces of technical debt across a codebase enum DebtSeverity { LOW = 'LOW', MEDIUM = 'MEDIUM', HIGH = 'HIGH', CRITICAL = 'CRITICAL', } interface IDebtItem { readonly id: string; readonly...",
"path": "/a-technical-debt-tracker/",
"publishedAt": "2026-06-14T18:26:48.000Z",
"site": "at://did:plc:fdfg7uwpthbb4zdam6e2xtvn/site.standard.publication/3mmcvowa3clzx",
"tags": [
"TypeScript",
"AI Code Review"
],
"textContent": "A small CLI-ish module for tracking technical debt items in a codebase. Supports adding, listing, and prioritizing debt entries. // Technical Debt Tracker // Tracks pieces of technical debt across a codebase enum DebtSeverity { LOW = 'LOW', MEDIUM = 'MEDIUM', HIGH = 'HIGH', CRITICAL = 'CRITICAL', } interface IDebtItem { readonly id: string; readonly title: string; readonly description: string; readonly severity: DebtSeverity; readonly createdAt: Date; readonly filePath?: string; } interface IDebtRepository { add(item: IDebtItem): void; getAll(): ReadonlyArray<IDebtItem>; findBySeverity(severity: DebtSeverity): ReadonlyArray<IDebtItem>; } // In-memory implementation of the debt repository class InMemoryDebtRepository implements IDebtRepository { private readonly items: Map<string, IDebtItem> = new Map(); public add(item: IDebtItem): void { if (this.items.has(item.id)) { throw new Error(`Debt item with id ${item.id} already exists`); } this.items.set(item.id, item); } public getAll(): ReadonlyArray<IDebtItem> { return Array.from(this.items.values()); } public findBySeverity(severity: DebtSeverity): ReadonlyArray<IDebtItem> { return this.getAll().filter((i) => i.severity === severity); } } // Factory for creating debt items with a generated id class DebtItemFactory { public static create(params: Omit<IDebtItem, 'id' | 'createdAt'>): IDebtItem { return { id: crypto.randomUUID(), createdAt: new Date(), ...params, }; } } // Service layer that orchestrates the repository class DebtTrackerService { constructor(private readonly repo: IDebtRepository) {} public track(title: string, description: string, severity: DebtSeverity, filePath?: string): IDebtItem { const item = DebtItemFactory.create({ title, description, severity, filePath }); this.repo.add(item); return item; } public report(): string { const all = this.repo.getAll(); return all.map((i) => `[${i.severity}] ${i.title} (${i.id})`).join('n'); } } // Example usage const service = new DebtTrackerService(new InMemoryDebtRepository()); service.track('Refactor auth module', 'Uses deprecated JWT lib', DebtSeverity.HIGH, 'src/auth.ts'); service.track('Remove dead code', 'Old payment flow still imported', DebtSeverity.LOW); console.log(service.report()); Code Review 1. Lines 4-9. Four severity levels as a string enum. We could have used a union type like 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL' and saved ourselves the ceremony, but sure, let's keep the enum. 2. Lines 19-23. Interface for a repository that has exactly one implementation. Classic preemptive abstraction for the dependency injection framework we are not using. 3. Lines 30-32. Throwing on duplicate UUIDs from crypto.randomUUID(). I look forward to that error firing sometime after the heat death of the universe. 4. Lines 44-51. A class with one static method. This is a function in a trench coat. Just export a function called createDebtItem. 5. Line 48. crypto.randomUUID() works in modern Node and browsers, but there is zero import or environment check here. Will explode silently if someone runs this in an older runtime. 6. Lines 54-55. The 'service layer that orchestrates the repository' has two methods and orchestrates absolutely nothing. It is a thin wrapper that adds a UUID. 7. Line 26. Comment says 'In-memory implementation of the debt repository'. Yes, the class is literally named InMemoryDebtRepository. Thank you for the translation. 8. Line 40. findBySeverity is defined but never called anywhere in the example usage. Speculative API design at its finest.",
"title": "A Technical Debt Tracker"
}