Agent skill · AI & Agents

Agent Self-Correction

Protocols for the agent to autonomously detect failures, analyze root causes, and attempt recovery strategies before requesting user intervention.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill agent-self-correction --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 3 KB
Bundled scripts: none
Path: skills/agent/agent-self-correction/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Agent Self-Correction [Context: Errors and roadblocks are inevitable. An efficient agent does not stop at the first sign of failure; it analyzes the error, adjusts its approach, and retries. This skill defines the cognitive loop for autonomous self-correction.] ## 1. Core Principles - **Analyze First**: Never retry the exact same action without understanding *why* it failed. - **Fail Fast, recover Faster**: Identify failure modes immediately (tech stack mismatch, syntax error, hallucination). - **Graceful Escalation**: Attempt 2-3 autonomous fixes before escalating to the user. - **State Preservation**: Don't destroy partial progress when fixing a specific bug. ## 2. Step-by-Step Implementation ### Phase 1: Failure Detection & Analysis When a tool returns an error or a check fails: 1. **Stop**: Do not proceed to the next step of the plan. 2. **Read**: Analyze the error message thoroughly. - Is it a syntax error? -> Fix code. - Is it a logic error? -> Rethink algorithm. - Is it a tool misuse? -> Check tool definition. - Is it environmental? -> Check paths/permissions. 3. **Hypothesize**: Formulate a hypothesis for the fix. ### Phase 2: autonomous Recovery Loop 1. **Attempt 1 (Quic

What's inside
Steps it walks through
  1. 1. Core Principles
  2. 2. Step-by-Step Implementation
  3. Phase 1: Failure Detection & Analysis
  4. Phase 2: autonomous Recovery Loop
  5. Phase 3: Escalation
  6. 3. Templates & Examples
  7. Internal Monologue for Debugging
  8. Self-Correction Checklist
  9. 4. Common Pitfalls
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the Agent Self-Correction skill do?

Protocols for the agent to autonomously detect failures, analyze root causes, and attempt recovery strategies before requesting user intervention.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill agent-self-correction --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going