agent-introspection-debugging

Diagnoses and recovers from AI agent failures through structured capture, root-cause analysis, and introspection reports.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/diazMelgarejo/orama-system --skill agent-introspection-debugging-diazmelgarejo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-introspection-debugging
Source: https://github.com/diazMelgarejo/orama-system/tree/main/.cursor/.agents/skills/agent-introspection-debugging
Command: npx skills add https://github.com/diazMelgarejo/orama-system --skill agent-introspection-debugging-diazmelgarejo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents often fail silently by looping on the same tool calls, burning tokens without progress, or drifting away from the original task. This Skill provides a structured self-debugging workflow so the agent captures the failure, diagnoses the root cause, applies a contained recovery, and reports the outcome instead of blindly retrying. ## Core Features & Use Cases - Four-Phase Debug Loop: Failure capture, root-cause diagnosis, contained recovery, and a structured introspection report. - Failure Pattern Library: Maps common symptoms like max tool-call loops, context overflow, ECONNREFUSED, 429 quota exhaustion, and stale file state to likely causes and checks. - Recovery Heuristics: Prioritizes restating the objective, verifying world state, shrinking scope, and running one discriminating check before retrying. - Use Case: An agent hits its tool-call limit while repeatedly running the same failing test command. The skill captures the error and environment assumptions, classifies it as a loop pattern, narrows the task to one failing test, and produces a self-debug report for the next agent or human. ## Quick Start Ask the agent to use agent-introspection-debugging to diagnose why its current task is stuck in a retry loop and produce a recovery report.

Frequently Asked Questions about agent-introspection-debugging

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

FAQPage Schema
How do I debug an AI agent stuck in a tool-call loop?

Capture the last tool call sequence and error, then match it against known patterns like repeated identical commands indicating a no-exit loop. Apply the smallest corrective action, such as restating the objective and running one discriminating check, before retrying.

How to recover an agent from context overflow or degraded reasoning?

Context overflow is diagnosed by inspecting recent context for duplicated plans, oversized logs, and low-signal bulk. Recovery means trimming low-signal context and keeping only the active goal, blockers, and evidence before continuing.

What causes ECONNREFUSED or 429 errors during agent runs?

ECONNREFUSED usually means a service is unavailable or the port assumption is wrong, so verify service health and URLs. A 429 indicates quota exhaustion from retry storms, so count repeated calls and inspect retry spacing.

When should I not use agent self-debugging workflows?

Do not use it for feature verification after code changes, which belongs to a verification-loop skill, or for framework-specific debugging covered by narrower skills. It also cannot perform runtime actions the current harness does not actually support.

Why does an agent keep failing after applying a fix?

Persistent failure after a fix usually means the root-cause hypothesis was wrong. Isolate the exact failing test or command, re-derive the bug from direct observation, and only change the plan when a discriminating check supports it.