askill
error-recovery

error-recoverySafety 100Repository

Expert knowledge in error diagnosis, debugging strategies, and self-healing patterns. Use when tasks fail or errors occur.

33 stars
1.2k downloads
Updated 1/13/2026

Package Files

Loading files...
SKILL.md

Error Recovery Skill

Comprehensive strategies for diagnosing, fixing, and preventing errors.

Error Classification

Compile-Time Errors

CodeTypeCommon Cause
TS2322Type mismatchWrong type assigned
TS2345Argument typeWrong parameter type
TS2339Property missingTypo or missing interface property
TS2304Not foundMissing import or declaration
TS2307Module not foundWrong path or missing package
TS7006Implicit anyMissing type annotation
TS2531Possibly nullMissing null check

Runtime Errors

ErrorDescriptionCommon Fix
ReferenceErrorVariable not definedCheck declaration, scope
TypeErrorWrong type operationAdd null check, fix type
RangeErrorValue out of rangeValidate input range
SyntaxErrorInvalid syntaxCheck JSON, string format

Build Errors

ErrorDescriptionFix
Module not foundPackage missingnpm install
Out of memoryHeap limitIncrease NODE_OPTIONS
Config errorInvalid configCheck tsconfig, vite.config

Test Failures

TypeCauseFix
AssertionLogic errorFix implementation or expectation
TimeoutAsync issueAdd await, increase timeout
Mock errorWrong mock setupFix mock configuration

Recovery Strategies

Strategy 1: Auto-Fix (Lint/Format)

# ESLint auto-fix
npx eslint . --fix

# Prettier format
npx prettier --write .

# TypeScript strict fixes
# Some can be auto-fixed with ts-fix

Strategy 2: Dependency Fix

# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install

# Update specific package
npm update package-name

# Fix peer dependencies
npm install --legacy-peer-deps

Strategy 3: Type Error Fix

// TS2322: Type mismatch
// Before
const value: string = 123;
// After
const value: number = 123;

// TS2531: Possibly null
// Before
element.innerHTML = 'text';
// After
if (element) element.innerHTML = 'text';

// TS2339: Property missing
// Before
user.email
// After
if ('email' in user) user.email

Strategy 4: Runtime Error Fix

// TypeError: Cannot read property of undefined
// Before
const name = user.profile.name;
// After
const name = user?.profile?.name ?? 'Unknown';

// ReferenceError: not defined
// Check: Is it imported?
// Check: Is it in scope?
// Check: Is it spelled correctly?

Strategy 5: Test Failure Fix

// Assertion failure - debug first
console.log('Actual:', result);
console.log('Expected:', expected);

// Async timeout
test('async test', async () => {
  // Add proper awaits
  const result = await asyncOperation();
  expect(result).toBeDefined();
}, 10000); // Increase timeout if needed

// Mock not working
vi.mock('./module', () => ({
  default: vi.fn().mockReturnValue('mocked'),
}));

Recovery Protocol

┌─────────────────────────────────────────┐
│           ERROR DETECTED                │
└─────────────────┬───────────────────────┘
                  ▼
┌─────────────────────────────────────────┐
│         1. CLASSIFY ERROR               │
│  Syntax | Type | Runtime | Build | Test │
└─────────────────┬───────────────────────┘
                  ▼
┌─────────────────────────────────────────┐
│         2. IDENTIFY FIX                 │
│   Auto-fix | Manual | Delegate          │
└─────────────────┬───────────────────────┘
                  ▼
┌─────────────────────────────────────────┐
│         3. APPLY FIX                    │
│   Make minimal, targeted change         │
└─────────────────┬───────────────────────┘
                  ▼
┌─────────────────────────────────────────┐
│         4. VERIFY FIX                   │
│   tsc && eslint && npm test             │
└─────────────────┬───────────────────────┘
                  ▼
        ┌─────────┴─────────┐
        │ Fixed?            │
        └─────────┬─────────┘
          Yes     │     No
           │      │      │
           ▼      │      ▼
        ┌─────┐   │   ┌─────────────────┐
        │ Done│   │   │ Increment retry │
        └─────┘   │   │ (max 3)         │
                  │   └────────┬────────┘
                  │            ▼
                  │   ┌─────────────────┐
                  │   │ Retry < 3?      │
                  │   └────────┬────────┘
                  │      Yes   │   No
                  │       │    │    │
                  │       ▼    │    ▼
                  │   ┌──────┐ │ ┌────────┐
                  └───│Retry │ │ │Escalate│
                      └──────┘ │ └────────┘

Prevention Strategies

  1. TypeScript Strict Mode - Catch errors at compile time
  2. ESLint Rules - Enforce best practices
  3. Pre-commit Hooks - Validate before commit
  4. Unit Tests - Catch regressions
  5. Code Review - Human verification

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

94/100Analyzed 2/11/2026

An excellent, high-density technical reference for TypeScript/JavaScript error recovery. It provides clear error classifications, actionable fix strategies, and a structured protocol for an agent to follow.

100
95
90
95
95

Metadata

Licenseunknown
Version-
Updated1/13/2026
Publisherclaudeforge

Tags

ci-cdlintingtesting