From skill-forge
Use after generating code, after accepting AI suggestions, or when reviewing AI-written modules. Also use when code "works" but feels brittle, when error handling seems thin, when you notice orphaned resources or missing cleanup, or when the agent says "done" but you suspect hidden debt. Catches the specific failure patterns AI agents produce that humans wouldn't.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skill-forge:ai-debt-detectorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
AI agents generate code that passes the happy path but hides debt: missing error handling, orphaned resources, ignored failure modes, hallucinated packages, silent architectural drift. This skill forces a targeted audit for the exact patterns AI agents get wrong.
AI agents generate code that passes the happy path but hides debt: missing error handling, orphaned resources, ignored failure modes, hallucinated packages, silent architectural drift. This skill forces a targeted audit for the exact patterns AI agents get wrong.
After ANY code generation, scan for these AI-specific debt patterns:
1. FAILURE MODES — What happens when this fails?
- Network timeout? Disk full? Permission denied? Null input?
- Is there a try/catch? Does it catch SPECIFIC errors or swallow everything?
- Are resources cleaned up on failure? (streams closed, connections returned, temp files deleted)
2. ORPHANS — What gets created but never cleaned up?
- Temp files, event listeners, intervals, subscriptions, connections
- Are there corresponding cleanup/dispose/close calls for every open/create?
- In React: does every addEventListener have a removeEventListener in cleanup?
3. EDGE CASES — What inputs break this?
- Empty array/string? null/undefined? Very large input? Unicode? Concurrent calls?
- Does the code assume the happy path? (hint: AI almost always does)
4. HALLUCINATED DEPS — Do all imports actually exist?
- Is every package in package.json/requirements.txt?
- Are API methods real? (AI invents plausible-sounding methods that don't exist)
- Check: does this library's latest version still export this function?
5. ARCHITECTURAL DRIFT — Does this match the project's patterns?
- Same error handling style as existing code?
- Uses the project's established utilities (not reinventing)?
- Follows the file structure convention?
- Matches naming patterns (camelCase vs snake_case, etc.)
catch (e) {} or catch (e) { console.log(e) } — swallowed errorfinally block when resources were opened// TODO: handle error — AI's way of punting| Excuse | Reality |
|---|---|
| "It works in testing" | Testing only covers happy path. Production has failures. |
| "I'll add error handling later" | You won't. And you'll forget which parts need it. |
| "The framework handles cleanup" | Does it? Which framework, which version, which method? Verify. |
| "It's just a prototype" | Prototypes become production. Debt compounds from day one. |
| "The AI generated it, it's probably fine" | AI generates 1.7x more issues than human code (CodeRabbit, 2026). |
ACTIVE after every code generation session. Scan silently. Report only actual findings. Don't generate false positives — only flag patterns that genuinely indicate hidden debt.
| Change Size | Audit Depth |
|---|---|
| < 20 lines | Quick: #1 (failure modes) + #2 (orphans) only |
| 20-100 lines | Standard: all 5 patterns |
| 100+ lines or new module | Deep: all 5 + check integration points + verify deps exist |
June 2026: companies spend 44% of AI tokens fixing bugs that AI generated. Developers report 3-day refactoring sessions for 20 minutes of agent-generated code. The agent produces code that "looks polished even when it's wrong." This skill is the countermeasure.
"It works" is not "it's done." Agent code often passes the happy path and dies on edge cases you haven't thought of yet.
npx claudepluginhub adit-jain-srm/skill-forge --plugin skill-forgeProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.