ai-debt-detector

Audits AI-generated code for hidden failure modes, orphaned resources, and hallucinated dependencies.

39.3k|4.2k|Updated Jul 24, 2025
One-click install
npx skills add https://github.com/wshobson/agents --skill ai-debt-detector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-debt-detector
Source: https://github.com/wshobson/agents/tree/main/plugins/skill-forge-essentials/skills/ai-debt-detector
Command: npx skills add https://github.com/wshobson/agents --skill ai-debt-detector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI-generated code often passes the happy path while hiding technical debt: missing error handling, leaked resources, unhandled edge cases, and imports of packages or APIs that do not exist. This Skill forces a targeted audit of the specific failure patterns AI agents produce, catching debt before it reaches production.

Core Features & Use Cases

  • Failure Mode Audit: Checks whether network timeouts, null inputs, and permission errors are handled with specific catches rather than swallowed exceptions.
  • Orphan Detection: Verifies that every opened resource (connections, listeners, timers, temp files) has a corresponding cleanup call.
  • Hallucinated Dependency Check: Confirms that every import exists in package.json or requirements.txt and that referenced API methods are real.
  • Use Case: After an AI coding session generates 200 lines across several files, run this audit before merging the PR to surface swallowed errors, missing cleanup, and invented library methods.

Quick Start

Audit the code just generated in this session for hidden failure modes, orphaned resources, and hallucinated dependencies before I merge it.

Frequently Asked Questions about ai-debt-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review AI-generated code for hidden bugs?

Audit five areas: failure modes (timeouts, null inputs), orphaned resources (unclosed connections, listeners), edge cases (empty or oversized inputs), hallucinated dependencies (imports that do not exist), and architectural drift from project conventions. AI code typically passes the happy path while missing these.

What are common mistakes in AI-written code?

Common patterns include swallowed exceptions like catch blocks that only log, missing finally blocks for opened resources, TODO comments punting on error handling, imports of nonexistent packages, and invented API methods that sound plausible but do not exist in the library.

When should I run an AI code debt audit?

Run it after any AI generation session producing 20 or more lines, before merging AI-generated pull requests, after vibe-coding sprints, and whenever code works but feels brittle or the agent claims completion without showing verification.

Does passing compilation mean AI-generated code is correct?

No. Compilation checks syntax, not logic. AI-generated code frequently compiles while missing error paths, leaking resources, or calling deprecated APIs, so a targeted audit of failure modes and cleanup logic is still required.

Why does AI code leak resources like connections and listeners?

AI agents optimize for code that looks correct on the happy path and often omit cleanup logic. Garbage collection does not handle connections, event listeners, or timers, so every open or create call needs a verified corresponding close, dispose, or remove call.