Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add ramidamolis-alt/agent-skills-workflows --skill "debugger"
Install specific skill from multi-skill repository
# Description
Expert debugger using ALL MCP servers for analysis. Uses Memory for past bugs, UltraThink for hypothesis testing, MongoDB for log analysis, and search MCPs for solutions.
# SKILL.md
name: debugger
description: Expert debugger using ALL MCP servers for analysis. Uses Memory for past bugs, UltraThink for hypothesis testing, MongoDB for log analysis, and search MCPs for solutions.
๐ Ultimate Debugger Skill (Full MCP Integration)
Master debugger using ALL 11 MCP servers for comprehensive debugging.
MCP Debugging Arsenal
| MCP Server | Debugging Role |
|---|---|
| Memory | Past bugs, solutions |
| UltraThink | Hypothesis generation, analysis |
| SequentialThinking | Step-by-step debugging |
| MongoDB | Log analysis, error stats |
| Filesystem | Log files, configs |
| Context7 | Framework debugging docs |
| Brave/Tavily | Stack Overflow, GitHub issues |
| NotebookLM | Deep research on complex bugs |
Advanced Debugging Patterns
1. Bug Memory Recall
// First: Check if we've seen this before
const pastBugs = await mcp_Memory_search_nodes(
`bug ${errorType} ${errorMessage.substring(0, 50)}`
);
if (pastBugs.length > 0) {
console.log("Found similar past bugs:", pastBugs);
// Apply known fix
} else {
// New bug - proceed with analysis
}
2. Hypothesis-Driven Debugging (UltraThink)
await mcp_UltraThink_ultrathink({
thought: `
## Bug Report
Error: ${errorMessage}
Stack: ${stackTrace}
Context: ${context}
## Hypothesis Generation
### H1: Database Connection Issue
- Evidence for: Error mentions "connection"
- Evidence against: Other DB calls work
- Confidence: 0.3
- Test: Check connection pool stats
### H2: Race Condition
- Evidence for: Intermittent failure
- Evidence against: Code looks sequential
- Confidence: 0.6
- Test: Add logging around async calls
### H3: Invalid Input Data
- Evidence for: Error in validation layer
- Evidence against: Input looks correct
- Confidence: 0.8
- Test: Log exact input values
## Most Likely: H3
## Next Step: Add input logging
`,
total_thoughts: 20,
confidence: 0.7,
assumptions: [
{ id: "A1", text: "Error is reproducible", critical: true }
]
});
3. Sequential Debug Walkthrough
await mcp_SequentialThinking_sequentialthinking({
thought: `
Step 1: Reproduce the error
- Run: npm test specific-test
- Observed: ${observation}
Step 2: Isolate the component
- Comment out: X, Y, Z
- Result: Error still occurs
- Conclusion: Bug is in component A
Step 3: Binary search
- Comment half of component A
- ...
`,
thoughtNumber: 1,
totalThoughts: 10,
needsMoreThoughts: true
});
4. Log Analysis Pipeline
// Read logs from Filesystem
const logs = await mcp_Filesystem_read_file(
"/var/log/app/error.log",
{ tail: 1000 }
);
// Parse and store in MongoDB for analysis
await mcp_MongoDB_insert-many("debug", "logs",
parseLogs(logs)
);
// Aggregate error patterns
const patterns = await mcp_MongoDB_aggregate(
"debug", "logs",
[
{ $match: { level: "error" } },
{ $group: {
_id: "$errorType",
count: { $sum: 1 },
examples: { $push: "$message" }
}},
{ $sort: { count: -1 } }
]
);
5. Multi-Source Solution Search
// Parallel search for solutions
const [braveResults, tavilyResults, context7Results] = await Promise.all([
mcp_Brave_brave_web_search(
`${errorMessage} site:stackoverflow.com OR site:github.com`
),
mcp_Tavily_search(
`how to fix ${errorType} in ${framework}`
),
mcp_Context7_query-docs(
frameworkLibraryId,
`${errorType} troubleshooting`
)
]);
// Synthesize solutions
await mcp_UltraThink_ultrathink({
thought: `
Potential solutions found:
## Stack Overflow
${braveResults.top3}
## Tavily Analysis
${tavilyResults.summary}
## Framework Docs
${context7Results.relevant}
## Recommended Fix
Based on all sources...
`,
total_thoughts: 15
});
Secret Debugging Techniques
1. Time-Travel Debugging via Memory
// Find what changed
const recentChanges = await mcp_Memory_search_nodes(
"change deploy recent"
);
// Correlate with bug appearance
await mcp_UltraThink_ultrathink({
thought: `
Bug appeared: ${bugTimestamp}
Recent changes:
${recentChanges.map(c => `- ${c.timestamp}: ${c.description}`)}
Correlation: Change X matches bug timing
`,
total_thoughts: 10
});
2. Pattern Matching Across Projects
// Find similar bugs in other projects
const similarBugs = await mcp_Memory_search_nodes(
`bug ${errorType}`
);
// Group by solution
const solutionPatterns = similarBugs.reduce((acc, bug) => {
const solution = bug.observations.find(o => o.includes("Solution:"));
if (solution) acc.push(solution);
return acc;
}, []);
3. Deep Framework Research
// When standard debugging fails
const deepResearch = await mcp_NotebookLM_ask_question(
`Explain internal workings of ${framework} ${component}.
What edge cases cause ${errorType}?`,
frameworkNotebookId
);
4. Bug Persistence (Save for Future)
// After solving - save to Memory
await mcp_Memory_create_entities([{
name: `Bug_${errorType}_${Date.now()}`,
entityType: "Bug",
observations: [
`Error: ${errorMessage}`,
`Root cause: ${rootCause}`,
`Solution: ${solution}`,
`Prevention: ${howToAvoid}`,
`Affected: ${affectedFiles.join(", ")}`,
`Time to fix: ${duration}`
]
}]);
await mcp_Memory_create_relations([
{ from: "Bug_" + id, to: "Project_Main", relationType: "affected" },
{ from: "Bug_" + id, to: "Pattern_" + solution, relationType: "fixed_by" }
]);
5. Confidence-Gated Debugging
let confidence = 0;
let attempts = 0;
while (confidence < 0.9 && attempts < 5) {
const analysis = await mcp_UltraThink_ultrathink({
thought: `Attempt ${attempts + 1}: ...`,
total_thoughts: 15
});
confidence = analysis.confidence;
attempts++;
if (confidence < 0.5) {
// Need more data - expand search
await expandSearch();
} else if (confidence < 0.9) {
// Have hypothesis - test it
await testHypothesis(analysis.hypothesis);
}
}
6. Distributed Debugging (MongoDB Aggregation)
// Aggregate errors across services
const crossServiceErrors = await mcp_MongoDB_aggregate(
"logs", "errors",
[
{ $match: { timestamp: { $gte: startTime } } },
{ $group: {
_id: "$correlationId",
services: { $addToSet: "$service" },
errors: { $push: "$error" },
timeline: { $push: { ts: "$timestamp", svc: "$service" } }
}},
{ $match: { "services.1": { $exists: true } } } // Multi-service errors
]
);
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.