self-heal
Skill2 starsChanged 5 months agoMITView on GitHub
When a test fails, lint errors, or CI breaks — diagnose with debugger agent, propose minimal fix, implementer applies, verifier reruns, loop up to 3 attempts then escalate. Combines Anthropic Auto-Fix + Playwright self-heal + 4-tier escalation pattern.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Johin2/self-healtheir own version, first seen Jun 12, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Johin2/self-heal★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository60 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- analyzeSkill
- animation-disciplineSkill
- api-versioningSkill
- autopilotSkill
- browser-e2eSkill
- characterizeSkill
- clarifySkill
- codemodSkill
- constitution-compactSkill
- constitutionSkill
- context-budgetSkill
- creative-webSkill
- db-migrationSkill
- debugSkill
- detect-stackSkill
- dispatch-criteriaSkill
- dreamSkill
- experimentSkill
- fastapiSkill
- flag-cleanupSkill
- flag-rolloutSkill
- flask-realtimeSkill
- framework-detectorSkill
- front-end-designSkill
- grill-meSkill
- handoffSkill
- image-generationSkill
- implementSkill
- initiativeSkill
- instinctSkill
- loopSkill
- nextjsSkill
- observabilitySkill
- okr-alignSkill
- parallel-swarmSkill
- pivotSkill
- planSkill
- pr-bodySkill
- prime-disciplineSkill
- prod-observabilitySkill
- react-nodeSkill
- react-viteSkill
- release-trainSkill
- researchSkill
- reviewSkill
- security-guardSkill
- shipSkill
- skill-creatorSkill
- specifySkill
- tailwind-disciplineSkill
- tasksSkill
- tdd-loopSkill
- token-budgetSkill
- typographySkill
- verify-loopSkill
- verifySkill
- wip-checkpointSkill
- <kebab-case-skill-name>Skill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If the error message matches transient patterns (timeout, connection reset, "Test timeout after Nms" on first run), rerun once.
- Very specific: line 28
If second run succeeds, log to .claude/memory/incidents/flaky-<date>.md and move on.
- Distinctive: line 29
If second run fails, escalate to Tier 2.
- Distinctive: line 40
Run the broader test suite to confirm no regression.
- Very specific: line 41
Commit with fix(<scope>): <summary> + git trailer Confidence: high if all tests green.
- Very specific: line 45
Write OVERNIGHT_REPORT.md or PR comment with:
- Distinctive: line 57
One fix per attempt: Don't batch hypotheses. Test each independently.
- Very specific: line 59
Document: Every escalation writes to .claude/memory/incidents/.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Self-Heal
A failure is not "done." It's a debugging task with a defined recovery path.
The four tiers (escalate only when the prior tier fails)
Tier 1 — Pre-flight retry (transient: network, flake, race)
↓
Tier 2 — Debugger diagnosis (root cause via 4-phase loop)
↓
Tier 3 — Implementer applies (minimal fix from diagnosis)
↓
Tier 4 — Human escalation (after 3 failed Tier 1-3 cycles)Process
Tier 1 — Transient retry (max 1)
- If the error message matches transient patterns (timeout, connection reset, "Test timeout after Nms" on first run), rerun once.
- If second run succeeds, log to
.claude/memory/incidents/flaky-<date>.mdand move on. - If second run fails, escalate to Tier 2.
Tier 2 — Debugger diagnosis (1 invocation)
- Delegate to
debuggeragent with the failure output. - Debugger runs reproduce → isolate → diagnose → fix-proposal (4 phases).
- Output:
file:line+ cause + minimal fix proposal. - No commits by debugger.
Tier 3 — Implementer applies (1 invocation)
- Delegate to
implementeragent with the debugger's fix proposal. - Implementer writes a failing test first (capturing the bug), then the fix, then watches green.
- Run the broader test suite to confirm no regression.
- Commit with
fix(<scope>): <summary>+ git trailerConfidence: highif all tests green;Confidence: mediumif only the targeted test passes.
Tier 4 — Human escalation (after 3 cycles fail)
- Stop the loop.
- Write
OVERNIGHT_REPORT.mdor PR comment with:- Failure output
- Debugger's three diagnoses
- Implementer's three attempts (commits)
- Why each failed (paste verify output)
- Suggested human next step
- Mark the task failed:
bash .claude/scripts/task-status.sh T-<id> failed --note "<one-line why>"(lock-safe; also feeds the consecutive-aborts machine).
Hard rules
- Don't fix without understanding. Tier 2 is mandatory before any code change.
- Don't suppress symptoms. No
try/except: pass, no// @ts-ignore, no broadcatch {}. If the fix looks like suppression, escalate. - One fix per attempt. Don't batch hypotheses. Test each independently.
- Escalate at 3 attempts, not 5. A bug that resists 3 root-cause-driven fixes is a human problem.
- Document. Every escalation writes to
.claude/memory/incidents/.
Auto-trigger
The stop-verify.sh hook fires this skill when:
- Any task's
accept:command exits non-zero bash .claude/scripts/verify.shexits non-zero/loopiteration reports failure
References
- PolarOrchid/ClaudeWatch (4-tier recovery pattern)
- obra/superpowers/skills/systematic-debugging (4-phase debugger loop)
- Anthropic Auto-Fix (CI-side self-healing via claude-code-action)
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
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.

