Loading...
Loading...
Analyzes errors, searches past solutions in memory, provides immediate fixes with code examples, and saves solutions for future reference. Use when user says "debug this", "fix this error", "why is this failing", or when error messages appear like TypeError, ECONNREFUSED, CORS, 404, 500, etc.
npx skill4agent add jackspace/claudeskillz error-debugger{
error_type: "TypeError|ReferenceError|ECONNREFUSED|...",
message: "Cannot read property 'map' of undefined",
stack_trace: [...],
file: "src/components/UserList.jsx",
line: 42,
context: "Rendering user list"
}search memories for:
- error_type match
- similar message (fuzzy match)
- same file/component if available
- related tags (if previously tagged)🔍 Found similar past error!
📝 3 months ago: TypeError in UserList component
✅ Solution: Added null check before map
⏱️ Fixed in: 5 minutes
🔗 Memory: procedures/{uuid}.md
Applying the same solution...🆕 New error - analyzing...
(Will save solution after fix)🔧 Error Analysis
**Type**: {error_type}
**Location**: {file}:{line}
**Cause**: {root_cause_explanation}
**Fix**:
```javascript
// ❌ Current code
const users = data.users;
return users.map(user => <div>{user.name}</div>);// ✅ Fixed code
const users = data?.users || [];
return users.map(user => <div>{user.name}</div>);
### 5. Save Solution
After fix confirmed working:
```bash
# Save to context-manager as PROCEDURE
remember: Fix for TypeError in map operations
Type: PROCEDURE
Tags: error, typescript, array-operations
Content: When getting "Cannot read property 'map' of undefined",
add optional chaining and default empty array:
data?.users || []# PROCEDURE: Fix TypeError in map operations
**Error Type**: TypeError
**Message Pattern**: Cannot read property 'map' of undefined
**Context**: Array operations on potentially undefined data
## Solution
Use optional chaining and default values:
```javascript
// Before
const items = data.items;
return items.map(...)
// After
const items = data?.items || [];
return items.map(...)
### 6. Create Regression Test
Automatically invoke testing-builder:
## Tool Persistence Pattern (Meta-Learning)
**Critical principle from self-analysis**: Never give up on first obstacle. Try 3 approaches before abandoning a solution path.
### Debugging Tools Hierarchy
When debugging an error, try these tools in sequence:
**1. Search Past Solutions (context-manager)**
```bash
# First approach: Check memory
search memories for error pattern# Second approach: Search public issues
copilot "Search GitHub for solutions to: $ERROR_MESSAGE"# Third approach: Real-time web search
[Use web search for latest Stack Overflow solutions]ghgh// Pattern: Try 3 fix approaches
async function debugError(error) {
// Approach 1: Past solution
const pastFix = await searchMemories(error);
if (pastFix?.success_rate > 80%) {
return applyPastFix(pastFix);
}
// Approach 2: Pattern matching
const commonFix = matchErrorPattern(error);
if (commonFix) {
return applyCommonFix(commonFix);
}
// Approach 3: External search (Copilot/Web)
const externalSolution = await searchExternalSolutions(error);
if (externalSolution) {
return applyExternalSolution(externalSolution);
}
// Only NOW ask for more context
return askUserForMoreContext(error);
}{
"error_id": "uuid",
"approaches_tried": [
{"type": "memory_search", "result": "no_match"},
{"type": "copilot_search", "result": "success", "time": "5s"},
{"type": "applied_fix", "verified": true}
],
"total_time": "30s",
"lesson": "Copilot found solution on second try"
}// Search context-manager
const pastSolutions = searchMemories({
type: 'PROCEDURE',
tags: [errorType, language, framework],
content: errorMessage,
fuzzyMatch: true
});
if (pastSolutions.length > 0) {
// Show user the past solution
// Ask if they want to apply it
// If yes, apply and test
// If no, analyze fresh
}{
solution_id: "uuid",
error_pattern: "TypeError.*map.*undefined",
times_applied: 5,
success_rate: 100%,
last_used: "2025-10-15",
avg_fix_time: "2 minutes"
}// BOOSTBOX-specific
Error: "Boost ID not found"
→ Solution: Check boost exists before processing
// Tool Hub-specific
Error: "Tool not installed"
→ Solution: Run tool installer first
// Save these as PROJECT-specific proceduresAutomatically invoke: testing-builder
Create regression test for: {error_scenario}
Ensure test fails without fix, passes with fixsearch memories for:
- PROCEDURE type
- Error tag
- Similar message
- Same file/componentSave as PROCEDURE:
- Error pattern
- Solution
- Code examples
- Tested timestampIf fix requires significant refactoring:
→ Invoke rapid-prototyper
→ Create isolated example showing fix
→ User validates before applying to codebase| Error | Quick Fix |
|---|---|
| `data?.array |
| Check function exists |
| Check service running |
| Configure CORS headers |
| Verify route exists |
| Check server logs |
| Increase timeout value |
| Install dependency |
~/.claude-memories/procedures/%USERPROFILE%\.claude-memories\procedures\