Skip to main content
skill Claude Code CX Codex Cursor

ai-debt-detector — Claude Code skill: install and use

This skill audits AI-generated code for missed failure paths, orphaned resources, fake dependencies, and architecture drift before a merge.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install skill-forge-essentials@claude-code-workflows
Open on GitHub

What ai-debt-detector does

Use ai-debt-detector after code generation, after accepting AI suggestions, or while reviewing an AI-written module. It checks what happens on a network timeout, a full disk, denied permissions, or empty input. It also looks for cleanup gaps involving streams, connections, temporary files, event listeners, and timers.

The skill verifies that imports and packages exist, API methods are real, and the code follows the project’s established structure. Red flags include an empty catch, a missing finally after opening a resource, TODO: handle error, and a timeout without cancellation. Install it when AI-generated changes need a focused debt audit; for a small manual edit that creates no resources, the check may be unnecessary.

What it helps with

  • inspect failure paths after AI code generation
  • find connections and temporary files left open
  • detect invented packages and API methods
  • check code against the project architecture
  • verify listener and timer cleanup

Example prompts for the agent

  • Audit this module after generation and list every failure path.
  • Find resources created by this code that are not closed when an error occurs.
  • Check the imports, dependencies, and fit with the project structure.

How to install ai-debt-detector

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install skill-forge-essentials@claude-code-workflows

This installs the whole skill-forge-essentials plugin with all its skills

2Skills CLI (Vercel)

npx skills add wshobson/agents --skill ai-debt-detector -a claude-code

3Manually: put the files in place

~/.claude/skills/ai-debt-detector/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ai-debt-detector/

From the same set213

The whole set →
typescript-advanced-types Seth Hobson Guides an agent through advanced TypeScript types, from generics to conditional and mapped types. Use it for typed libraries, API clients, or strict configuration objects. Claude Code CX Codex Cursor 92,169installs tailwind-design-system Seth Hobson Helps build design systems with Tailwind CSS v4, from theme tokens to component variants. Use it when a project needs shared UI patterns. Claude Code CX Codex Cursor 70,180installs brand-landingpage Travis D. Elliott This skill interviews you about the product and its visual direction, then builds a landing page through Stitch. Use it when there’s no established design yet. Claude Code CX Codex Cursor 39,476installs python-testing-patterns Seth Hobson This skill guides Python testing with pytest, fixtures and mocks. Use it when building a test suite or tracking down failing checks. Claude Code CX Codex Cursor 36,943installs python-performance-optimization Seth Hobson This skill profiles Python code to locate CPU and memory bottlenecks. Use it when an application responds slowly or consumes too many resources. Claude Code CX Codex Cursor 35,675installs nextjs-app-router-patterns Seth Hobson This skill covers Next.js App Router patterns for rendering, routing, and data fetching. Use it when starting an App Router project or moving from Pages Router. Claude Code CX Codex Cursor 32,529installs api-design-principles Seth Hobson Use this skill to plan or review REST and GraphQL APIs. It helps when writing a specification or setting API conventions for a team. Claude Code CX Codex Cursor 30,348installs code-review-excellence Seth Hobson This skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. Claude Code CX Codex Cursor 30,193installs

Similar

fix-merge-conflicts cursor Resolves merge conflicts in a branch, then checks the build and tests before wrapping up. Use it when several conflicted files need focused fixes without a refactor. Claude Code CX Codex Cursor +1 2,700installs thermo-nuclear-review cursor A skill for comprehensive analysis of branch changes: checks code for bugs, broken functionality, security vulnerabilities, and feature-gate leaks. Use when you need thorough review before merge. Claude Code CX Codex Cursor +1 2,700installs learn-reverse-engineering rohitg00 Interactive tutor for reading compiled programs. One lesson per invocation: from file formats and disassembly to symbolic execution and AI-assisted analysis. Requires Python 3.10+ and your own source code. Claude Code CX Codex Cursor +1 425installs guidelines-advisor trailofbits Audits smart contract codebases against Trail of Bits guidelines. It spots upgradeability pitfalls, flawed inheritance, and testing gaps. Claude Code CX Codex Cursor +1 5,400installs pr-review MiniMax-AI Two-phase pull request review for skill repositories, combining automated schema checks with content audits. Claude Code CX Codex Cursor +1 1,800installs react19-concurrent-patterns official github Preserves React 18 concurrent patterns during React 19 migrations and guides the adoption of use(), useOptimistic, and Actions. GitHub Copilot 1,100installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs

Questions about ai-debt-detector

How do I install ai-debt-detector in Claude Code?

Run npx skills add wshobson/agents --skill ai-debt-detector -a claude-code. The skill file is placed at ~/.claude/skills/ai-debt-detector/SKILL.md.

What does ai-debt-detector do?

It performs a targeted audit of AI-written code for missed error paths, orphaned resources, edge cases, invented dependencies, and architectural drift.

Which platforms support ai-debt-detector?

The skill is available for Claude Code, Codex, and Cursor. Each platform has its own installation command.

Source text

SKILL.md · MIT
---
name: ai-debt-detector
description: >-
  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 orphaned resources or missing cleanup are suspected,
  or when the agent claims done but hidden debt may exist. Catches the specific
  failure patterns AI agents produce that humans would not.
---

# AI Debt Detector

## Overview

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.

## When to Use

- After any AI code generation session (20+ lines produced)
- Before merging AI-generated PRs
- When code works but something feels off
- After vibe-coding sprints where debt accumulates fastest
- When the agent claims done without showing verification

## Process

After 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? Multi-MB input? Unicode? Concurrent calls?
   - Does the code assume the happy path? (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)
   - 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?

## Red Flags (stop and fix immediately)

- `catch (e) {}` or `catch (e) { console.log(e) }` - swallowed error
- No `finally` block when resources were opened
- `// TODO: handle error` - AI's way of punting
- Import from a path that doesn't exist in the project
- Timeout set but no abort/cleanup on timeout
- Database connection opened but never released back to pool

## Common Mistakes

- Trusting that compilation means correctness (compilation checks syntax, not logic)
- Reviewing only the diff without checking what the AI did NOT generate (missing error paths)
- Assuming the AI used the right library version (it often uses deprecated APIs)
- Skipping the orphan check because garbage collection handles it (it doesn't for connections, listeners, timers)

## Why This Exists

AI agents systematically optimize for "looks correct" and "passes the happy path." They miss failure modes, orphan resources, and hallucinate dependencies at rates significantly higher than manual code. This skill forces an audit for those specific blind spots.

© Adit Jain · MIT · wshobson/agents

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor