Debt Scan
Testing & Qualitydebt-scanDebt Scan is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Scan codebase for known anti-patterns and technical debt
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/quality/debt-scan/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/debt-scan, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
/debt-scan — Technical Debt Scanner
Scan the codebase for all known anti-patterns from .claude/rules/anti-patterns*.md files. Produce a report with counts, locations, and trend comparison.
Scan Checklist
Run these Grep searches across src/ and report counts:
General Anti-Patterns
as any— Grep foras anyin*.ts,*.tsx(type safety violation)Record<string, unknown>— Grep forRecord<string, unknown>(untyped payloads)db: any— Grep fordb: any(untyped database)console.log— Grep forconsole.loginsrc/server/(use logger)console.error— Grep forconsole.errorinsrc/server/(use logger)export *— Grep forexport \*(breaks tree-shaking)await import(— Grep forawait import\(insrc/(dynamic imports)
React/Next.js Anti-Patterns
forwardRef— Grep forforwardRef(React 19 doesn't need it)getServerSideProps— Grep forgetServerSideProps(App Router doesn't use it)useContextin tRPC — Grep fortrpc.useContext()(deprecated, use useUtils)
tRPC/Drizzle Anti-Patterns
queryClient.invalidate— Grep forqueryClient.invalidate(use utils.x.invalidate)ctx.dbwithout comment — Grep forctx.dboutside repositories (should use ctx.uow)- Sequential await — Grep for patterns like
await.*\n.*awaitthat could be parallel
Security Anti-Patterns
- Missing ownerId scope — Grep for queries without
ownerIdfilter dangerouslySetInnerHTML— Grep fordangerouslySetInnerHTML
Output Format
After running all scans, produce a summary table:
| # | Anti-Pattern | Count | Files |
|---|-------------|-------|-------|
| 1 | as any | 3 | router.ts, helper.ts, ... |
Save results to .claude/instincts/debt-scan.json:
{
"date": "2026-02-26",
"total_issues": 15,
"by_pattern": { "as_any": 3, "console_log": 5, ... },
"trend": "improving" // compare against previous scan if exists
}
Trend Comparison
If a previous debt-scan.json exists, compare counts and report:
- Patterns that improved (count decreased)
- Patterns that regressed (count increased)
- New patterns detected