agent-introspection-debugging

Capture agent failure evidence and diagnose likely causes in iterative runs.

7|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/chenziyang110/spec-kit-plus --skill agent-introspection-debugging-chenziyang110
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-introspection-debugging
Source: https://github.com/chenziyang110/spec-kit-plus/tree/main/templates/passive-skills/agent-introspection-debugging
Command: npx skills add https://github.com/chenziyang110/spec-kit-plus --skill agent-introspection-debugging-chenziyang110

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When an AI agent gets stuck—looping on tool calls, wasting tokens, or drifting from the goal—this skill helps you capture the exact failure, diagnose likely causes, attempt the smallest safe recovery, and produce an introspection report that a human or next agent can act on.

Core Features & Use Cases

  • Failure capture before retrying: Records the error, tool sequence, goal context, and environment assumptions to prevent blind recovery attempts.
  • Pattern-based root-cause diagnosis: Maps observed failure patterns (loops, context overflow, timeouts, quota issues, state drift) to likely causes and checks.
  • Contained recovery + evidence trail: Applies the smallest corrective action, then documents what evidence would prove improvement or continued blockage.
  • Agent self-debug report for handoff: Produces a structured, human-readable report covering failure, hypothesis, recovery action, and next steps.

Quick Start

Ask your AI agent to run the agent-introspection-debugging workflow to capture the failure state, diagnose the most likely pattern, perform one contained recovery action, and end with an Agent Self-Debug 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 stop an AI agent from looping on tool calls and burning tokens?

Agent introspection debugging stops repeated failures and token burn by capturing error evidence, diagnosing likely causes through pattern mapping, and applying the smallest safe recovery action with safety boundaries before retrying.

What is agent self-debugging and when do I need it?

Agent self-debugging is a four-phase loop that captures failure states, diagnoses root causes from observed patterns like context overflow or state drift, attempts contained recovery, and produces a structured introspection report for handoff.

How do I diagnose root causes for agent context overflow and prompt drift?

Diagnose context overflow and prompt drift by mapping observed failure patterns to likely causes and checks, capturing the error, tool sequence, goal context, and environment assumptions before attempting any blind recovery actions.

Can I generate a structured handoff report after an agent workflow recovery?

You can generate a structured, human-readable Agent Self-Debug Report covering the failure, hypothesis, recovery action, and next steps, enabling seamless escalation or follow-up by a human or next agent.

Does this agent debugging workflow work for environment and filesystem mismatch errors?

This agent debugging workflow applies to environment or filesystem mismatch errors by recording environment assumptions during failure capture and verifying them against the actual state during pattern-based root-cause diagnosis.

Why does my AI agent keep failing on repeated tool calls despite retries?

Repeated tool-call failures persist because agents attempt blind recovery without capturing error evidence or diagnosing root causes, whereas a structured introspection loop forces contained recovery with documented evidence trails.