スキル一覧に戻る
claudeforge

error-recovery

by claudeforge

Autonomous Development System for Claude Code

30🍴 4📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: error-recovery description: Expert knowledge in error diagnosis, debugging strategies, and self-healing patterns. Use when tasks fail or errors occur. allowed-tools: Read, Write, Edit, Bash, Glob, Grep

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

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です