# Ai Debt Detector > Úsalo tras generar código con IA, aceptar sugerencias o revisar módulos escritos por IA, o cuando el código funcione pero parezca frágil o con deuda oculta. Fuente: https://skillsagentes.com/skills/wshobson/agents/ai-debt-detector Markdown: https://skillsagentes.com/skills/wshobson/agents/ai-debt-detector.md Repositorio: https://github.com/wshobson/agents Autor: wshobson Licencia: MIT Actualizado: hace 2 meses Coste de contexto: 92 tok instalada, 850 tok al activarse, 850 tok con todos los archivos del bundle Bundle: 1 archivo, 3 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add wshobson/agents --skill ai-debt-detector --agent claude-code # Cursor npx -y skills add wshobson/agents --skill ai-debt-detector --agent cursor # Codex npx -y skills add wshobson/agents --skill ai-debt-detector --agent codex # Gemini CLI npx -y skills add wshobson/agents --skill ai-debt-detector --agent gemini # Windsurf npx -y skills add wshobson/agents --skill ai-debt-detector --agent windsurf # Cline npx -y skills add wshobson/agents --skill ai-debt-detector --agent cline ``` ## Qué hace - Escanea código generado por IA buscando manejo de errores débil, recursos huérfanos y dependencias alucinadas - Revisa casos límite no contemplados y desviaciones respecto a los patrones del proyecto - Señala red flags concretos como catch vacíos, imports inexistentes o timeouts sin limpieza ## Cuándo usarla - Después de cualquier sesión de generación de código con IA (20+ líneas) - Antes de fusionar PRs generados por IA - Cuando el código funciona pero algo se siente raro - Cuando el agente dice que terminó sin mostrar verificación ## Qué la activa - "Revisa este código que generó la IA en busca de deuda técnica oculta" - "Audita este PR generado por IA antes de mergear" - "Comprueba si esta función tiene recursos huérfanos o errores silenciados" ## Archivos - SKILL.md — 3 KB ## SKILL.md Reproducido tal cual desde wshobson/agents bajo MIT. Esta sección es el documento original y está en inglés. # 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. ## Dónde encaja - Categoría: [Testing y QA](https://skillsagentes.com/categorias/testing-qa.md) — Flujos de testing unitario, de integración y end-to-end. - Creador: [wshobson](https://skillsagentes.com/creators/wshobson.md) — 183 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Skills relacionadas - [Eval Harness First](https://skillsagentes.com/skills/wshobson/agents/eval-harness-first.md): Construye el eval harness que condiciona cada fine-tuning: golden sets, graders por modo de fallo, calibración de juez y baselines del modelo base. - [Wcag Audit Patterns](https://skillsagentes.com/skills/wshobson/agents/wcag-audit-patterns.md): Realiza auditorías de accesibilidad WCAG 2.2 con pruebas automatizadas, verificación manual y guía de remediación. Útil para auditar sitios, corregir violaciones y aplicar patrones de diseño accesible. - [Temporal Python Testing](https://skillsagentes.com/skills/wshobson/agents/temporal-python-testing.md): Prueba workflows de Temporal con pytest, time-skipping y estrategias de mocking: testing unitario, de integración, de replay y configuración de desarrollo local. - [Python Anti Patterns](https://skillsagentes.com/skills/wshobson/agents/python-anti-patterns.md): Úsalo al revisar código Python en busca de antipatrones comunes: como checklist antes de finalizar implementaciones o al depurar problemas derivados de malas prácticas conocidas. - [Parallel Debugging](https://skillsagentes.com/skills/wshobson/agents/parallel-debugging.md): Depura problemas complejos con hipótesis en competencia, investigación paralela, recolección de evidencia y arbitraje de causa raíz. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)