# self-healing

self-healing — a skill for Claude Code and Codex helps an agent diagnose failures during a task and test its fix. It activates after a command, test, build, or lint run fails.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 109 installs · ★ 341 repo stars
- Author: pskoett
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pskoett/pskoett-ai-skills/tree/HEAD/skills/self-healing/SKILL.md
- Updated: 2026-10-19
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/self-healing

## What it does

The skill guides an agent through finding the cause of a failure, applying a fix, rerunning the failed operation, and recording the result in `.learnings/HEALS.md`. Before adding an entry, the agent checks for a matching `Pattern-Key` so recurring problems update an existing record.

A fix counts as verified only after the operation runs again successfully. If the agent cannot test it, the entry is marked `pending-verify`; an unsuccessful fix is marked `abandoned`. The loop allows up to three attempts. Installing through Claude Code uses `npx`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill self-healing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/self-healing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/self-healing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill self-healing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/self-healing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill self-healing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/self-healing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pskoett/pskoett-ai-skills skills/self-healing
```

2. **Manually: put the files in place**
- File: `.github/skills/self-healing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill self-healing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pskoett/pskoett-ai-skills --path skills/self-healing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/self-healing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill self-healing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pskoett/pskoett-ai-skills/tree/HEAD/skills/self-healing/SKILL.md

## When to use it
- trace why a command, test, build, or lint run failed
- repair a failure caused by a missing dependency or incorrect runtime
- create a helper script that the task needs
- record a tested fix so a recurring failure can be recognized

## Example prompts
- Diagnose the `pytest` failure and rerun the test to check the fix.
- Repair the build, then record the verified result in `.learnings/HEALS.md`.
- Look up the matching `Pattern-Key` and update its recurrence count.

## Similar
- [self-review](https://affpapa.org/en/nevibecode/skills/self-review.md) — skill · 1700 installs
- [self-improve](https://affpapa.org/en/nevibecode/skills/self-improve.md) — skill · 809 installs
- [self-eval](https://affpapa.org/en/nevibecode/skills/self-eval.md) — skill · 575 installs
- [tooluniverse-self-review](https://affpapa.org/en/nevibecode/skills/tooluniverse-self-review.md) — skill · 111 installs
- [self-explanatory-code-commenting](https://affpapa.org/en/nevibecode/rules/self-explanatory-code-commenting.md) — rule · ★ 41430 repo stars
- [self-hosted-funnel-launch](https://affpapa.org/en/nevibecode/skills/self-hosted-funnel-launch.md) — skill · 131900 installs

From the same set: [pskoett/pskoett-ai-skills](https://affpapa.org/en/nevibecode/by/pskoett/pskoett-ai-skills.md) — 10 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
