Skip to content
Skillpedia
Testing41k · #4955

ai-debt-detector

Helps your agent find specific issues in AI-generated code. It's useful for ensuring code quality and robustness, catching errors humans might miss.

What it does

This AI 'debt' detector checks AI-generated code for common issues that humans usually avoid. It looks for failures, uncleaned resources, non-existent dependencies, and deviations from project standards.

When to use it

  • ✓After AI code generation.
  • ✓Before accepting AI suggestions or merging AI code.
  • ✓When code works but feels unstable or incomplete.

Example of what to ask your AI

“Scan this AI-generated code for failures, orphaned resources, and non-existent dependencies.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/wshobson/agents/blob/main/plugins/skill-forge-essentials/skills/ai-debt-detector/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/wshobson/agents/blob/main/plugins/skill-forge-essentials/skills/ai-debt-detector/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It analyzes the code for specific patterns AI often gets wrong, like missing error handling, resources not being released, and packages that don't exist. The goal is to ensure the code is robust and secure.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add wshobson/agents --skill ai-debt-detector

Or download just the file:

curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/skill-forge-essentials/skills/ai-debt-detector/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.

FAQ

Why do I need to check AI code?

AI is good at creating code that works in ideal conditions but might forget to handle errors, release resources, or use correct packages, creating 'debt' that can cause problems later.

What are 'orphaned resources'?

These are things the code creates (like network connections or temporary files) but doesn't shut down or delete after use, which can consume system resources.

What are 'failure modes'?

These are situations where the code might fail (like network errors or invalid input) and how it reacts to those failures. Good code has a plan to handle these situations.

Details

Original description by the author

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.

repo: wshobson/agents

Popularity

GitHub stars
41k
Ranking position
#4955
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills