affaan-m/ECC

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.

79Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "skills/agent-introspection-debugging"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn agent-introspection-debugging's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.

npx skills add https://github.com/affaan-m/ECC --skill "skills/agent-introspection-debugging"
Check the pinned source

Best fit

  • Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.

Bring this context

  • A concrete task that matches the documented purpose of agent-introspection-debugging.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • End with a report that makes the recovery legible to the next agent or human.
  • Session / task:
  • Failure:

Key source sections

Read agent-introspection-debugging through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

Four-Phase Loop

Before trying to recover, record the failure precisely.

SKILL.md · Four-Phase Loop
error type, message, and stack trace when availablelast meaningful tool call sequencewhat the agent was trying to do
02

Phase 1: Failure Capture

Before trying to recover, record the failure precisely.

SKILL.md · Phase 1: Failure Capture
error type, message, and stack trace when availablelast meaningful tool call sequencewhat the agent was trying to do
03

Phase 2: Root-Cause Diagnosis

Match the failure to a known pattern before changing anything.

SKILL.md · Phase 2: Root-Cause Diagnosis
is this a logic failure, state failure, environment failure, or policy failure?did the agent lose the real objective and start optimizing the wrong subtask?is the failure deterministic or transient?
04

Phase 3: Contained Recovery

Recover with the smallest action that changes the diagnosis surface.

SKILL.md · Phase 3: Contained Recovery
stop repeated retries and restate the hypothesistrim low-signal context and keep only the active goal, blockers, and evidencere-check the actual filesystem / branch / process state
05

Phase 4: Introspection Report

End with a report that makes the recovery legible to the next agent or human.

SKILL.md · Phase 4: Introspection Report
End with a report that makes the recovery legible to the next agent or human.

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use agent-introspection-debugging to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned agent-introspection-debugging source to [task]. Pay particular attention to these source sections: “Four-Phase Loop”, “Phase 1: Failure Capture”, “Phase 2: Root-Cause Diagnosis”, “Phase 3: Contained Recovery”, “Phase 4: Introspection Report”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current agent-introspection-debugging result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “Four-Phase Loop” has been checked.

The source section “Phase 1: Failure Capture” has been checked.

The source section “Phase 2: Root-Cause Diagnosis” has been checked.

The source section “Phase 3: Contained Recovery” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does agent-introspection-debugging do?

Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.

How do I start using agent-introspection-debugging?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "skills/agent-introspection-debugging". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
79/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

79/100
Documentation27/30
Specificity15/25
Maintenance20/20
Trust signals17/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

design-review by event4u-app

Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.

dask by k-dense-ai

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.

neurokit2 by k-dense-ai

Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.

prompt-optimizer by affaan-m

Analyze raw prompts, identify intent and gaps, match ECC components (skills/commands/agents/hooks), and output a ready-to-paste optimized prompt. Advisory role only — never executes the task itself. TRIGGER when: user says "optimize prompt", "improve my prompt", "how to write a prompt for", "help me prompt", "rewrite this prompt", or explicitly asks to enhance prompt quality. Also triggers on Chinese equivalents: "优化prompt", "改进prompt", "怎么写prompt", "帮我优化这个指令". DO NOT TRIGGER when: user wants th

scanpy by k-dense-ai

Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA/UMAP/t-SNE), clustering, differential expression, visualization, and converting R-friendly single-cell formats such as Seurat or SingleCellExperiment RDS files into h5ad for Scanpy. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use anndata.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 4 min

Agent Introspection Debugging

Use this skill when an agent run is failing repeatedly, consuming tokens without progress, looping on the same tools, or drifting away from the intended task.

This is a workflow skill, not a hidden runtime. It teaches the agent to debug itself systematically before escalating to a human.

When to Activate

  • Maximum tool call / loop-limit failures
  • Repeated retries with no forward progress
  • Context growth or prompt drift that starts degrading output quality
  • File-system or environment state mismatch between expectation and reality
  • Tool failures that are likely recoverable with diagnosis and a smaller corrective action

Scope Boundaries

Activate this skill for:

  • capturing failure state before retrying blindly
  • diagnosing common agent-specific failure patterns
  • applying contained recovery actions
  • producing a structured human-readable debug report

Do not use this skill as the primary source for:

  • feature verification after code changes; use verification-loop
  • framework-specific debugging when a narrower ECC skill already exists
  • runtime promises the current harness cannot enforce automatically

Four-Phase Loop

Phase 1: Failure Capture

Before trying to recover, record the failure precisely.

Capture:

  • error type, message, and stack trace when available
  • last meaningful tool call sequence
  • what the agent was trying to do
  • current context pressure: repeated prompts, oversized pasted logs, duplicated plans, or runaway notes
  • current environment assumptions: cwd, branch, relevant service state, expected files

Minimum capture template:

## Failure Capture
- Session / task:
- Goal in progress:
- Error:
- Last successful step:
- Last failed tool / command:
- Repeated pattern seen:
- Environment assumptions to verify:

Phase 2: Root-Cause Diagnosis

Match the failure to a known pattern before changing anything.

PatternLikely CauseCheck
Maximum tool calls / repeated same commandloop or no-exit observer pathinspect the last N tool calls for repetition
Context overflow / degraded reasoningunbounded notes, repeated plans, oversized logsinspect recent context for duplication and low-signal bulk
ECONNREFUSED / timeoutservice unavailable or wrong portverify service health, URL, and port assumptions
429 / quota exhaustionretry storm or missing backoffcount repeated calls and inspect retry spacing
file missing after write / stale diffrace, wrong cwd, or branch driftre-check path, cwd, git status, and actual file existence
tests still failing after “fix”wrong hypothesisisolate the exact failing test and re-derive the bug

Diagnosis questions:

  • is this a logic failure, state failure, environment failure, or policy failure?
  • did the agent lose the real objective and start optimizing the wrong subtask?
  • is the failure deterministic or transient?
  • what is the smallest reversible action that would validate the diagnosis?

Phase 3: Contained Recovery

Recover with the smallest action that changes the diagnosis surface.

Safe recovery actions:

  • stop repeated retries and restate the hypothesis
  • trim low-signal context and keep only the active goal, blockers, and evidence
  • re-check the actual filesystem / branch / process state
  • narrow the task to one failing command, one file, or one test
  • switch from speculative reasoning to direct observation
  • escalate to a human when the failure is high-risk or externally blocked

Do not claim unsupported auto-healing actions like “reset agent state” or “update harness config” unless you are actually doing them through real tools in the current environment.

Contained recovery checklist:

## Recovery Action
- Diagnosis chosen:
- Smallest action taken:
- Why this is safe:
- What evidence would prove the fix worked:

Phase 4: Introspection Report

End with a report that makes the recovery legible to the next agent or human.

## Agent Self-Debug Report
- Session / task:
- Failure:
- Root cause:
- Recovery action:
- Result: success | partial | blocked
- Token / time burn risk:
- Follow-up needed:
- Preventive change to encode later:

Recovery Heuristics

Prefer these interventions in order:

  1. Restate the real objective in one sentence.
  2. Verify the world state instead of trusting memory.
  3. Shrink the failing scope.
  4. Run one discriminating check.
  5. Only then retry.

Bad pattern:

  • retrying the same action three times with slightly different wording

Good pattern:

  • capture failure
  • classify the pattern
  • run one direct check
  • change the plan only if the check supports it

Integration with ECC

  • Use verification-loop after recovery if code was changed.
  • Use continuous-learning-v2 when the failure pattern is worth turning into an instinct or later skill.
  • Use council when the issue is not technical failure but decision ambiguity.
  • Use workspace-surface-audit if the failure came from conflicting local state or repo drift.

Output Standard

When this skill is active, do not end with “I fixed it” alone.

Always provide:

  • the failure pattern
  • the root-cause hypothesis
  • the recovery action
  • the evidence that the situation is now better or still blocked
Source repo
affaan-m/ECC
Skill path
skills/agent-introspection-debugging/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected