self-healing
Automatically diagnose and fix broken workflows, failing scripts, errors, and bugs without giving up. Trigger when a script fails, a workflow breaks, there's an error message, code isn't working as ex
Files1
View on GitHubSKILL.mdskills/self-healing/SKILL.md
GitHubSelf-Healing Workflow Skill
Core Philosophy
Quick wins for superficial issues (missing deps, typos, wrong paths).
If the issue persists after 2 attempts, escalate to superpowers-systematic-debugging.
Never apply patches without investigating root cause — triage first, then escalate.
Diagnostic Loop
Error encountered
↓
1. Read full error message carefully
2. Identify error type (see categories below)
3. Attempt 1 fix strategy
4. Re-run / re-test
5. If still failing → try one more strategy (attempt 2)
6. After 2 failed attempts → invoke `superpowers-systematic-debugging`
- Summarize what was tried and what happened
- Pass the root cause hypothesis forward
Error Categories & Fix Strategies
Dependency / Import Errors
- Check if package is installed (
pip list,npm list) - Install missing package with correct version
- Check for name conflicts or deprecated packages
Permission / Path Errors
- Verify file/directory exists
- Check read/write permissions
- Use absolute paths instead of relative
Type / Runtime Errors
- Add defensive type checks
- Log intermediate values to trace the issue
- Add null/undefined guards
Network / API Errors
- Check if service is reachable
- Verify credentials and headers
- Add retry logic with exponential backoff
- Check rate limits
Logic / Output Errors
- Add debug logging at each step
- Test with minimal input to isolate the issue
- Compare actual vs expected output explicitly
Self-Repair Rules
- Always show what the error was and what fix was attempted
- Explain why the fix should work
- After fixing, verify the fix didn't break anything else
- If using workarounds, flag them as technical debt
Escalation to Systematic Debugging
If 2 attempts don't resolve the issue, stop self-healing and invoke:
superpowers-systematic-debugging— for bugs, test failures, technical issues
When escalating, provide:
- What was tried and why it failed
- Root cause hypothesis (if any)
- The original error message
Do NOT continue guessing — escalate after 2 attempts.