본문으로 건너뛰기
Skillpedia
에이전트280k · #130

agent-introspection-debugging

하는 일

이 도구는 AI가 무언가 잘못되었을 때 스스로 고치도록 돕습니다. 문제를 분석하고, 작은 수정을 시도하며, 무슨 일이 있었는지 설명합니다.

사용하는 경우

  • ✓AI가 막혀서 진전이 없을 때.
  • ✓AI가 같은 행동을 여러 번 반복할 때.
  • ✓AI가 잘못되거나 혼란스러운 답을 하기 시작할 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-introspection-debugging/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-introspection-debugging/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 AI가 반복 루프에 빠져 있어요. 스스로 고칠 방법이 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 먼저 무엇이 잘못되었는지 정확히 기록합니다. 그다음 가장 그럴듯한 원인을 찾으려고 하고, 간단하고 안전한 수정을 적용합니다. 마지막으로 문제와 해결책을 설명하는 보고서를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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.

Pattern Likely Cause Check
Maximum tool calls / repeated same command loop or no-exit observer path inspect the last N tool calls for repetition
Context overflow / degraded reasoning unbounded notes, repeated plans, oversized logs inspect recent context for duplication and low-signal bulk
ECONNREFUSED / timeout service unavailable or wrong port verify service health, URL, and port assumptions
429 / quota exhaustion retry storm or missing backoff count repeated calls and inspect retry spacing
file missing after write / stale diff race, wrong cwd, or branch drift re-check path, cwd, git status, and actual file existence
tests still failing after “fix” wrong hypothesis isolate 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.

…

자주 묻는 질문

‘인트로스펙션(introspection)’이란 무엇인가요?

AI가 자신의 내부를 들여다보며 자신의 실수를 이해하는 것을 말합니다.

이것이 모든 AI 오류를 고치나요?

아니요. 간단한 조치로 바로잡을 수 있는 흔한 오류를 고치려고 합니다. 더 복잡한 오류에는 사람의 도움이 필요할 수 있습니다.

그냥 다시 시도하면 안 되나요?

원인을 이해하지 않고 다시 시도하면 시간과 자원만 낭비하고 문제는 해결되지 않을 수 있습니다. 이 도구는 다시 시도하기 전에 진단하는 데 집중합니다.

상세 정보

작성자의 원본 설명

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

repo: affaan-m/ECC

인기도

GitHub 스타
280k
순위
#130
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬