Skip to content

Commit 67c73bb

Browse files
celiasclaude
andcommitted
chore: add debt-audit slash command for targeted technical debt audits
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2e9b82e commit 67c73bb

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

.claude/commands/debt-audit.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
You are doing a targeted technical debt audit of this codebase. The goal is to find problems that were baked in before structured agent workflows, Linear tickets, and enforced conventions existed — specifically in the early commits before any GAB-\* ticket references appear.
2+
3+
Run `git log --oneline --reverse` to identify the pre-agent era (commits before GAB-\* tickets and .claude/ tooling). Then audit the current codebase for debt that likely originates from that period.
4+
5+
Check for each of the following:
6+
7+
**Structure & Ownership**
8+
9+
- Are there files or directories that don't belong anywhere obvious, or that duplicate logic that now lives in `lib/`?
10+
- Is there dead code: exported functions, variables, types, or modules that are never imported anywhere?
11+
- Are there stale modules from earlier architectures (SQLite era, pre-Prisma, pre-Turborepo)?
12+
- Are there any `.js` source files that should be `.ts`?
13+
14+
**Dead Code & Bad Practices**
15+
16+
- Are there commented-out blocks of code that were never removed?
17+
- Are there `console.log` / `console.error` calls that bypass the shared `log()` utility from `lib/logger.ts`?
18+
- Are there TODO or FIXME comments that represent real unfinished work?
19+
- Are there functions that are defined but never called, or imports that are never used?
20+
- Are there magic numbers or magic strings that have no name or explanation?
21+
- Are there copy-paste patterns — blocks of logic that appear two or more times and should be extracted?
22+
23+
**Type Safety**
24+
25+
- Are there uses of `any`, non-null assertions (`!`), or type casts (`as SomeType`) that paper over real unknowns?
26+
- Are function signatures loose where they could be strict?
27+
- Are API response shapes typed, or are they assumed?
28+
29+
**Error Handling**
30+
31+
- Are there unhandled promise rejections, bare `catch` blocks that swallow errors, or silent failures?
32+
- Does the Reddit poller handle rate limits, auth failures, and network timeouts — or does it crash and stay down?
33+
- Does the Discord webhook have retry logic, or does a failure mean a missed alert?
34+
35+
**Data Model**
36+
37+
- Does the Prisma schema reflect the actual usage, or are there fields that are never read or always null?
38+
- Is there any place where data is stored as a raw JSON blob because a real schema wasn't designed?
39+
40+
**Configuration**
41+
42+
- Are there hardcoded values that should be in `lib/config.ts` or env vars?
43+
- Are there any secrets or environment assumptions embedded in source files?
44+
45+
**Observability**
46+
47+
- Does the poller surface meaningful errors, or do failures disappear into the void?
48+
- Is there any way to tell if the poller has stopped working without manually checking?
49+
50+
**Dashboard / API contract**
51+
52+
- Does the API actually reflect what the dashboard needs, or are there fields the dashboard ignores or that the API doesn't provide?
53+
- Is pagination handled, or does the API return everything forever?
54+
55+
**Documentation & READMEs**
56+
57+
- List every README and doc file in the repo. For each one, check whether it accurately reflects the current codebase — architecture, commands, file names, stack, and workflow.
58+
- Flag anything that describes a removed feature (SQLite, old file structure, pre-Turborepo setup), uses outdated commands, or contradicts CLAUDE.md.
59+
- Note any sections that are missing entirely — things the project now does that no doc mentions.
60+
- The user wants to do a full README overhaul: identify which docs should be rewritten from scratch vs. lightly updated, and which should be deleted.
61+
62+
After your audit, produce a ranked list of findings. For each one:
63+
64+
- **Where:** file and line if applicable
65+
- **What:** the specific problem
66+
- **Why it matters:** what breaks or degrades if it's never fixed
67+
- **Suggested fix:** one concrete sentence
68+
69+
Flag the top 3 as "fix these first." Be direct and do not soften findings.

0 commit comments

Comments
 (0)