Loading...
Loading...
Compare original and translation side by side
{
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"
}{
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)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>);undefined🔧 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>);undefinedundefinedundefined
**Memory structure**:
```markdown
**记忆库结构**:
```markdown// Before
const items = data.items;
return items.map(...)
// After
const items = data?.items || [];
return items.map(...)// Before
const items = data.items;
return items.map(...)
// After
const items = data?.items || [];
return items.map(...)undefinedundefinedcreate regression test for this fix:
- Test that component handles undefined data
- Test that component handles empty array
- Test that component works with valid datacreate regression test for this fix:
- Test that component handles undefined data
- Test that component handles empty array
- Test that component works with valid dataundefinedundefined
If no past solution found → Continue to next approach
**2. GitHub Copilot CLI Search**
```bash
如果未找到过往解决方案 → 继续下一种方法
**2. GitHub Copilot CLI 搜索**
```bash
If Copilot doesn't find good results → Continue to next approach
**3. Web Search with Current Context**
```bash
如果Copilot未找到好的结果 → 继续下一种方法
**3. 结合当前上下文的网络搜索**
```bash
If web search fails → Then ask user for more context
如果网络搜索失败 → 再向用户请求更多上下文ghghghgh// 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);
}// 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"
}{
"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
}// 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"
}{
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 procedures// 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 fixAutomatically 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 timestampsearch 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 codebaseIf 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 |
| Error | 快速修复 |
|---|---|
| `data?.array |
| 检查函数是否存在 |
| 检查服务是否运行 |
| 配置CORS头 |
| 验证路由是否存在 |
| 检查服务器日志 |
| 增加超时值 |
| 安装依赖 |
~/.claude-memories/procedures/%USERPROFILE%\.claude-memories\procedures\~/.claude-memories/procedures/%USERPROFILE%\.claude-memories\procedures\