agentleFS
bocodes1bocodes1/claude-skills/self-healing/SKILL.md

self-healing

Skill0 starsChanged 7 months agoMITView on GitHub

Auto-detect tool failures, retry with alternative approaches, log errors, and learn from patterns. Use when a tool call fails, during multi-step operations that could fail, or when reviewing error patterns

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use albert-dm, instantly-campaign and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yawningwhaleAISkill

    albert-dm

    Reply to DMs and messages the way Albert would. Use when the user asks "how would Albert reply to this", pastes a conversation and wants an Albert-style response, or asks you to draft/write a DM in Albert's voice. Albert sells AI voice agents / automations to local service businesses (Go High Level, lead follow-up, bookings).

    Also in 5 projects that use this

  • yawningwhaleAISkill

    instantly-campaign

    Create a new Instantly cold-email campaign in the proven 5-email structure of the user's top-performing campaign (~16% reply rate). Use when the user wants to launch a new outbound campaign, write a cold email sequence, create an Instantly campaign, draft outreach for a new service or niche, or set up a sales sequence.

    Also in 6 projects that use this

  • huyvpSkill

    cost-reducer

    Reduce cloud, infrastructure, and operational costs while maintaining performance. Use when writing database queries, configuring cloud resources, optimizing bundles, setting up caching, choosing between services, sizing instances, configuring CDN, managing storage, or reviewing code for cost inefficiencies. Covers AWS/GCP/Vercel pricing, database optimization, serverless tuning, image pipelines, observability costs, and FinOps practices.

    Also in 10 projects that use this

  • xfstudioSkill

    trigger-dev

    Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.

    Also in 9 projects that use this

  • ffsshhttiikkSkill

    scalability

    Core foundational concepts and principles for Scalability

    Also in 9 projects that use this

  • xfstudioSkill

    customer-support

    Elite AI-powered customer support specialist mastering

    Also in 10 projects that use this

  • +3 more from yawningwhaleAI

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 15 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    When a tool call fails, classify immediately:

    line 14
  2. Distinctive:

    After any non-trivial failure, save a feedback memory if the fix reveals a reusable pattern:

    line 45
  3. Distinctive:

    Only log patterns worth remembering.

    line 60
  4. Distinctive:

    When a pattern is detected, add a prevention rule to relevant skill files.

    line 69
  5. Distinctive:

    Stop all calls to that service immediately

    line 74
  6. Distinctive:

    Check existence before operations

    line 80
  7. Distinctive:

    Create parent directories automatically for writes

    line 81
  8. Distinctive:

    Don't force-push or reset without user confirmation

    line 85
  9. Distinctive:

    Check status before any git operation

    line 87
  10. Distinctive:

    Check if file is read-only or locked

    line 90
  11. Distinctive:

    Check if running as correct user

    line 91
  12. Distinctive:

    Don't retry with sudo without asking

    line 92
  13. Distinctive:

    Every error teaches something -> log patterns worth remembering

    line 96
  14. Distinctive:

    Every pattern detected -> add prevention rule to relevant skill

    line 97
  15. Distinctive:

    Every prevention rule -> fewer future errors

    line 98

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Self-Healing Agent

Auto-detect, classify, retry, and learn from failures.

Error Handling Protocol

1. Detect & Classify

When a tool call fails, classify immediately:

  • TRANSIENT — Network timeout, rate limit, temporary unavailability -> retry with backoff
  • PERMANENT — Invalid input, missing resource, permission denied -> switch approach
  • DEGRADED — Partial result, truncated output -> supplement with alternative

2. Retry Strategy

Attempt 1: Original call
Attempt 2: Wait 5s, retry with same parameters
Attempt 3: Wait 15s, try alternative tool/approach (see table below)
Attempt 4: Log failure, notify user, suggest manual intervention

Never retry endlessly. 3 retries max, then escalate.

3. Alternative Approaches

Failed ToolAlternative 1Alternative 2
WebFetch failsWebSearch for cached versionUse known/cached info
WebSearch rate limitedWait 2min, retryUse context7 MCP for library docs
Bash command failsTry different flags/syntaxCheck path/permissions first
Grep finds nothingTry broader pattern / different globUse Glob to find files first
Read file not foundGlob for similar filenamesBash ls parent directory
SSH connection failsRetry with timeout increaseNotify user of connectivity issue
Agent subagent failsRetry with simpler promptDo the work directly
Git operation failsCheck status firstStash changes, retry

4. Error Logging

After any non-trivial failure, save a feedback memory if the fix reveals a reusable pattern:

---
name: error-pattern-{descriptive-slug}
description: {tool} fails when {condition} — fix: {solution}
type: feedback
---

{Tool} fails when {specific condition}.

**Why:** {root cause}
**How to apply:** {prevention rule for future sessions}

Only log patterns worth remembering. Don't log one-off transient failures.

5. Pattern Recognition

During self-improvement reviews, check for error patterns:

  • Same tool failing repeatedly -> check if service is down or config changed
  • Same error type across tools -> likely systemic (network, auth, permissions)
  • Recurring at specific times -> schedule-related (maintenance windows, rate resets)

When a pattern is detected, add a prevention rule to relevant skill files.

Auto-Fix Common Issues

Rate Limits (HTTP 429)

  • Stop all calls to that service immediately
  • Wait 5 minutes minimum
  • Resume with reduced frequency

File/Path Errors (Windows/Unix)

  • Normalize paths (forward slashes, expand ~)
  • Check existence before operations
  • Create parent directories automatically for writes
  • Remember: Windows paths need /c/Users/... in bash, C:\Users\... in tool calls

Git Conflicts

  • Don't force-push or reset without user confirmation
  • Stash work before destructive operations
  • Check status before any git operation

Permission Denied

  • Check if file is read-only or locked
  • Check if running as correct user
  • Don't retry with sudo without asking

Self-Improvement Loop

  1. Every error teaches something -> log patterns worth remembering
  2. Every pattern detected -> add prevention rule to relevant skill
  3. Every prevention rule -> fewer future errors
  4. Review during weekly self-improvement -> prune outdated rules

Integration Points

  • deploy-pipeline: Apply retry logic to SCP/SSH operations
  • polymarket-vps-ops: SSH timeout recovery follows this protocol
  • researcher: WebSearch/WebFetch failures -> alternative approaches
  • self-improvement: Error pattern review during weekly cycle

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.