{"skill":{"slug":"memory-self-heal","displayName":"Memory Self-Heal","summary":"General-purpose self-healing loop that learns from past failures, retries safely, and records reusable fixes.","description":"---\nname: memory-self-heal\nversion: 1.1.0\ndescription: General-purpose self-healing loop that learns from past failures, retries safely, and records reusable fixes.\nmetadata:\n  openclaw:\n    emoji: \"[HEAL]\"\n    category: resilience\n---\n\n# Memory Self-Heal Skill\n\nUse this skill when the agent starts failing repeatedly, stalls, or keeps asking the user for steps that could be inferred from prior evidence.\n\n## Goals\n\n1. Recover execution without user micromanagement\n2. Reuse previous fixes from memory/logs/tasks\n3. Escalate only with minimal unblock input when truly blocked\n4. Leave reusable evidence for future runs\n\n## When To Trigger\n\nTrigger when any of these appear:\n- Same or similar error occurs 2+ times in one task\n- Tool call fails due to argument mismatch, missing config, auth wall, or context overflow\n- Agent claims completion without verifiable artifact\n- Task progress stalls (no new artifact across 2 cycles)\n\n## Inputs\n\n- Current task objective\n- Latest error/output\n- Available evidence locations (memory, tasks, logs)\n\n## Portable Evidence Scan Order\n\nScan these in order; skip missing paths silently:\n1. `memory/` (or equivalent workspace memory path)\n2. `tasks/` or queue files\n3. runtime logs / channel logs\n4. skill docs (`skills/*/SKILL.md`) for known fallback recipes\n5. core docs (`TOOLS.md`, `CAPABILITIES.md`, `AGENTS.md`)\n\nShell examples (use whichever shell is active):\n\n```powershell\n# PowerShell\nGet-ChildItem -Recurse memory, tasks -ErrorAction SilentlyContinue |\n  Select-String -Pattern \"error|blocked|retry|fallback|auth|token|proxy|timeout|context\" -Context 2\n```\n\n```bash\n# POSIX shell\nrg -n \"error|blocked|retry|fallback|auth|token|proxy|timeout|context\" memory tasks 2>/dev/null\n```\n\n## Failure Classification\n\nClassify first, then act:\n- `syntax_or_args`: command syntax/argument mismatch\n- `auth_or_config`: key/token/env/config missing or invalid\n- `network_or_reachability`: timeout, DNS, handshake, region restrictions\n- `ui_login_wall`: page requires manual login/attach\n- `resource_limit`: context window, rate limit, memory pressure\n- `false_done`: no artifact/evidence but reported complete\n- `unknown`: no confident class\n\n## Recovery Policy (3-Tier)\n\n### Attempt 1: Direct Fix\n- Apply best-known fix from memory for same class/signature\n- Re-run the smallest validating action\n- Record result\n\n### Attempt 2: Safe Fallback\n- Switch to alternate tool/path with lower fragility\n- Narrow scope (smaller input, shorter query, one target)\n- Re-run validation\n\n### Attempt 3: Controlled Escalation\n- Mark blocked with minimum unblock input\n- Provide exact next action user must do (one command or one UI step)\n- Do not loop further until new input arrives\n\n## Safety Rules\n\n- Never auto-run destructive operations without confirmation\n- Never log secrets/tokens in memory files\n- Max 3 retries per blocker signature per task\n- Prefer deterministic steps over broad speculative retries\n\n## Completion Contract\n\nDo not claim done unless all are true:\n- At least one artifact exists and is readable (file/link/output)\n- The original task objective is explicitly mapped to artifact(s)\n- No unresolved blocker for current objective\n\nRequired output block:\n\n```markdown\nDONE_CHECKLIST\n- Objective met: yes/no\n- Artifact: <path or URL or command output ref>\n- Validation: <what was checked>\n- Remaining blocker: <none or exact unblock input>\n```\n\n## Memory Writeback Template\n\nAppend one concise entry after each self-heal cycle:\n\n```markdown\n## Self-heal: <date-time> <short task>\n- Signature: <normalized error signature>\n- Class: <classification>\n- Attempt1: <action> -> <result>\n- Attempt2: <action> -> <result>\n- Final: <success | blocked>\n- Artifact/Evidence: <path|url|log ref>\n- Reusable rule: <one-line rule>\n```\n\n## Generic Known Fixes (Seed Set)\n\n- Command mismatch on Windows: prefer native PowerShell cmdlets\n- Token mismatch/auth failure: verify active config source and token scope\n- WebSocket/timeouts: test reachability + proxy/no_proxy consistency\n- Context overflow: split task into smaller units and reduce payload\n- False completion: enforce artifact validation before final response\n\n## Integration Notes\n\n- Works with autonomy/task-tracker skills but does not depend on them\n- If a project has custom memory paths, adapt scan roots dynamically\n- Keep entries short to avoid memory bloat\r\n","tags":{"latest":"1.1.0"},"stats":{"comments":0,"downloads":1058,"installsAllTime":40,"installsCurrent":6,"stars":1,"versions":2},"createdAt":1772303987480,"updatedAt":1778491670926},"latestVersion":{"version":"1.1.0","createdAt":1772349824288,"changelog":"**General-purpose self-healing loop with improved resilience and evidence handling.**\n\n- Adds portable evidence scan order for improved flexibility (supports custom memory paths and multiple shells)\n- Expands failure classification to cover more error scenarios (syntax, auth, network, context, false done, etc.)\n- Refines 3-tier recovery policy: direct fix, safe fallback, and controlled escalation with user-minimal unblock input\n- Introduces strict safety and completion rules to ensure only validated recoveries are marked done\n- Enforces concise, structured memory logging for each self-heal cycle to aid future automation\n- Updates integration notes for wider compatibility and easier customization","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"dalomeve","userId":"s170jb8y518cbtqkxpgjgcz0yn843mr1","displayName":"Dalomeve","image":"https://avatars.githubusercontent.com/u/115125037?v=4"},"moderation":null}