agent-self-recovery
The agent-self-recovery skill detects when an AI agent is trapped in repetitive loops (same fixes tried multiple times, cascading dependencies, unclear errors, or lost objectives) and provides a systematic escape protocol. Use this skill when you notice the agent attempting identical approaches repeatedly, making random changes without clear direction, exceeding expected time on simple tasks, or losing sight of the original goal, enabling recovery through state documentation and genuinely different problem-solving strategies.
git clone --depth 1 https://github.com/ArchieIndian/openclaw-superpowers /tmp/agent-self-recovery && cp -r /tmp/agent-self-recovery/skills/openclaw-native/agent-self-recovery ~/.claude/skills/agent-self-recoverySKILL.md
# Agent Self-Recovery State file: `~/.openclaw/skill-state/agent-self-recovery/state.yaml` ## Signs You're Stuck - Tried the same approach 3+ times with the same result - Making changes that feel random rather than targeted - Lost track of the original goal - Taking longer than expected on a 'simple' step ## Recovery Protocol ### Step 1: Stop Stop making changes. No more quick tries. ### Step 2: Write State Write to the state file: - `what_trying`: what were you trying to do? - `what_tried`: append this latest approach to the list - `loop_type`: name the pattern (see Step 3) - `attempts`: increment by 1 - `status: recovering` - `started_at`: current timestamp (first time only) ### Step 3: Name the Loop Pick the `loop_type`: - `same-fix-variations` — trying the same fix with minor changes - `cascading-dependencies` — each fix reveals a new dependency - `unclear-error` — unclear what the actual error is - `lost-goal` — lost track of original requirement ### Step 4: Break the Loop If `loop_type: unclear-error` → use systematic-debugging first. If `loop_type: lost-goal` → re-read the original requirement. If genuinely blocked → document clearly, ask the user. Update state `status: escalated`. If context too large → use context-window-management. If truly lost → use task-handoff, ask user to redirect. Update state `status: escalated`. ### Step 5: Resume with a New Approach Choose a genuinely different approach. Update state `last_approach`, append to `what_tried`. On success: update state `status: recovered`.
Syncs agent daily memory and MEMORY.md to an Obsidian vault so notes are human-browsable. Use nightly or on demand.
Structured ideation before any implementation. Use when starting any non-trivial task.
Scaffolds and validates new superpowers skills. Use when creating a new skill for this repository.
Executes plans task-by-task with verification. Use when implementing a plan.
Triggers a secondary verification pass for any agent output containing factual claims, numbers, dates, or named entities before the output is acted on
Crawls a new codebase to infer stack, conventions, and key invariants, then generates a PROJECT.md context file for the agent
Handles PR review feedback by fetching comments, grouping issues, fixing one group at a time, and verifying before replies.
Detects skill name shadowing and description-overlap conflicts that cause OpenClaw to trigger the wrong skill or silently ignore one when two skills compete for the same intent.