Ai Debt Detector skill for Claude

Use after generating code, after accepting AI suggestions, or when reviewing AI-written modules. Also

When Claude uses it

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 SKILL.md

The full skill file from wshobson/agents (MIT).

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.

How to install Ai Debt Detector

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit wshobson/agents/plugins/skill-forge-essentials/skills/ai-debt-detector#main ~/.claude/skills/ai-debt-detector

Codex

npx degit wshobson/agents/plugins/skill-forge-essentials/skills/ai-debt-detector#main ~/.codex/skills/ai-debt-detector

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Ai Debt Detector skill do?

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.

+How do I install Ai Debt Detector in Claude Code?

Copy the skill folder into ~/.claude/skills/ai-debt-detector, for example with "npx degit wshobson/agents/plugins/skill-forge-essentials/skills/ai-debt-detector#main ~/.claude/skills/ai-debt-detector". Claude Code loads it automatically and uses it when a task matches.

+Does Ai Debt Detector work with ChatGPT or Codex?

Yes. Ai Debt Detector uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/ai-debt-detector. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Ai Debt Detector free?

Ai Debt Detector is published on GitHub by wshobson under the MIT license, which allows free use.

Related software development skills

  1. Code Review

    Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's…

    mattpocock/skills★ 327k
  2. Using Agent Skills

    Discovers and invokes agent skills. Use when starting a session, or when you need to decide which skill or workflow applies to the piece of…

    addyosmani/agent-skills★ 119k
  3. Build

    Fully automate a coding task with make-plan, do, and babysit.

    thedotmack/claude-mem★ 118k
  4. Angular Migration

    Migrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates.

    wshobson/agents★ 43k
  5. Architecture Decision Records

    Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation.

    wshobson/agents★ 43k
  6. Architecture Patterns

    Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design.

    wshobson/agents★ 43k
  7. Async Python Patterns

    Master Python asyncio, concurrent programming, and async/await patterns for high-performance applications.

    wshobson/agents★ 43k
  8. Backtesting Frameworks

    Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs.

    wshobson/agents★ 43k
  9. Bazel Build Optimization

    Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance…

    wshobson/agents★ 43k

See all software development skills →

More skills from wshobson

  1. Airflow Dag Patterns

    Build production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment.

    wshobson/agents★ 43k
  2. Anti Reversing Techniques

    Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis.

    wshobson/agents★ 43k

All skills by wshobson →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.