Expert knowledge in error diagnosis, debugging strategies, and self-healing patterns. Use when tasks fail or errors occur.
Comprehensive strategies for diagnosing, fixing, and preventing errors.
| Code | Type | Common Cause | |------|------|--------------| | TS2322 | Type mismatch | Wrong type assigned | | TS2345 | Argument type | Wrong parameter type | | TS2339 | Property missing | Typo or missing interface property | | TS2304 | Not found | Missing import or declaration | | TS2307 | Module not found | Wrong path or missing package | | TS7006 | Implicit any | Missing type annotation | | TS2531 | Possibly null | Missing null check |
| Error | Description | Common Fix | |-------|-------------|------------| | ReferenceError | Variable not defined | Check declaration, scope | | TypeError | Wrong type operation | Add null check, fix type | | RangeError | Value out of range | Validate input range | | SyntaxError | Invalid syntax | Check JSON, string format |
| Error | Description | Fix | |-------|-------------|-----| | Module not found | Package missing | npm install | | Out of memory | Heap limit | Increase NODE_OPTIONS | | Config error | Invalid config | Check tsconfig, vite.config |
| Type | Cause | Fix | |------|-------|-----| | Assertion | Logic error | Fix implementation or expectation | | Timeout | Async issue | Add await, increase timeout | | Mock error | Wrong mock setup | Fix mock configuration |
# ESLint auto-fix
npx eslint . --fix
# Prettier format
npx prettier --write .
# TypeScript strict fixes
# Some can be auto-fixed with ts-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
// 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
// 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?
// 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'),
}));
┌─────────────────────────────────────────┐
│ 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│
└──────┘ │ └────────┘
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer