debugging-assistant
Skill3 starsChanged 8 months agoMITView on GitHub
Systematic debugging approach for identifying and fixing bugs. Use when the user reports a bug, error, or unexpected behavior. Guides through methodical investigation rather than guessing at solutions.
In this repository72 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- api-designerSkill
- backend-patternsSkill
- code-reviewerSkill
- golang-testingSkill
- project-guidelines-exampleSkill
- python-testingSkill
- refactoring-guideSkill
- spec-driven-developmentSkill
- tdd-workflowSkill
- verification-loopSkill
- update-docsSkill
- api-docsSkill
- changelog-writerSkill
- readme-generatorSkill
- django-patternsSkill
- django-securitySkill
- django-tddSkill
- django-verificationSkill
- fastapi-patternsSkill
- nextjs-patternsSkill
- react-patternsSkill
- springboot-patternsSkill
- springboot-securitySkill
- springboot-tddSkill
- branch-strategySkill
- changelogSkill
- commit-helperSkill
- pr-creatorSkill
- prSkill
- evolveSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- cleanupSkill
- lint-fixSkill
- refactor-cleanSkill
- update-depsSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- eval-harnessSkill
- iterative-retrievalSkill
- strategic-compactSkill
- golang-patternsSkill
- python-patternsSkill
- rust-patternsSkill
- typescript-patternsSkill
- accessibility-checkerSkill
- build-fixSkill
- code-reviewSkill
- e2eSkill
- performance-reviewerSkill
- security-auditorSkill
- security-reviewSkill
- test-coverageSkill
- checkpointSkill
- deploySkill
- evalSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Don't guess - investigate systematically
- Distinctive: line 57
Before anything else, reproduce the bug consistently.
- Distinctive: line 82
Add log/breakpoint in middle of suspected code
- Distinctive: line 112
Don't fix what you don't understand.
- Very specific: line 126
Call stack: handleRequest → processUser
- Distinctive: line 176
Ensure the fix works and doesn't break anything else.
- Distinctive: line 190
Stop this bug from recurring.
- Distinctive: line 248
Check recent changes - git diff, git log
- Distinctive: line 249
Search for the error message
- Distinctive: line 250
Ask for help with specific details
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging Assistant
Systematic approach to finding and fixing bugs.
When to Use
- User reports a bug or error
- Something isn't working as expected
- Error messages or stack traces appear
- Tests are failing unexpectedly
Debugging Mindset
"Debugging is like being a detective in a crime movie where you're also the murderer."
Key principles:
- Don't guess - investigate systematically
- Reproduce before fixing
- Understand before changing
- One change at a time
The Debugging Process
1. REPRODUCE - Can you make it happen consistently?
↓
2. ISOLATE - Where exactly does it fail?
↓
3. UNDERSTAND - Why does it fail?
↓
4. FIX - Make the minimal change
↓
5. VERIFY - Does the fix work? Any side effects?
↓
6. PREVENT - Add test, improve codeStep 1: Reproduce
Before anything else, reproduce the bug consistently.
Questions to Ask
- What are the exact steps to reproduce?
- What input data triggers the bug?
- Does it happen every time or intermittently?
- What environment? (browser, OS, Node version)
Create Minimal Reproduction
// Reduce to smallest case that shows the bug
const input = { userId: null }; // This specific input
const result = processUser(input); // This call
// Expected: throws error
// Actual: returns undefined, causing crash laterStep 2: Isolate
Narrow down where the problem occurs.
Binary Search Approach
- Add log/breakpoint in middle of suspected code
- Is the bug before or after this point?
- Repeat, halving the search space
Useful Commands
# Git bisect to find breaking commit
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
# Git will binary search through commits
# Check if issue exists in specific version
git checkout <commit-hash>
npm testLogging Strategy
console.log('=== DEBUG processUser ===');
console.log('Input:', JSON.stringify(input, null, 2));
console.log('User from DB:', user);
console.log('After transform:', transformed);
console.log('=========================');Step 3: Understand
Don't fix what you don't understand.
Read the Error Message
TypeError: Cannot read property 'name' of undefined
at processUser (src/users.ts:42:15)
at handleRequest (src/api.ts:18:10)This tells you:
- Error type:
TypeError - What failed: accessing
.nameonundefined - Where:
src/users.tsline 42 - Call stack:
handleRequest→processUser
Common Error Patterns
| Error | Likely Cause |
undefined is not a function | Calling something that doesn't exist |
Cannot read property of undefined | Accessing nested property on null/undefined |
Maximum call stack exceeded | Infinite recursion |
ECONNREFUSED | Service not running |
ETIMEDOUT | Network/service too slow |
Hypothesis Testing
- Form hypothesis: "The bug occurs because X"
- Make prediction: "If X is true, then Y should happen"
- Test prediction
- Refine hypothesis based on result
Step 4: Fix
Make the minimal change that fixes the bug.
Good Fix
// Add null check where the crash occurs
function processUser(input: Input) {
if (!input.userId) {
throw new Error('userId is required');
}
// ... rest of function
}Bad Fix
// Don't just suppress the error
function processUser(input: Input) {
try {
// ... entire function wrapped in try/catch
} catch (e) {
return null; // Hides the real problem
}
}Step 5: Verify
Ensure the fix works and doesn't break anything else.
# Run the reproduction case
npm test -- --grep "specific test"
# Run full test suite
npm test
# Manual testing if applicableStep 6: Prevent
Stop this bug from recurring.
// Add test for the bug
it('should throw error when userId is null', () => {
const input = { userId: null };
expect(() => processUser(input)).toThrow('userId is required');
});Debugging Tools
Browser DevTools
- Console: Errors, logs
- Network: Failed requests, slow responses
- Sources: Breakpoints, step through code
- Performance: Find slow operations
Node.js
# Inspect mode
node --inspect src/index.js
# Debug specific test
node --inspect-brk node_modules/.bin/vitest run src/test.tsVS Code Launch Config
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/.bin/vitest",
"args": ["run", "--no-coverage"],
"console": "integratedTerminal"
}Common Bug Categories
| Category | Check For |
| Null/Undefined | Missing null checks, optional chaining |
| Async | Missing await, race conditions |
| State | Stale state, mutation side effects |
| Types | Type coercion, wrong assumptions |
| Environment | Missing env vars, wrong config |
| Dependencies | Version mismatch, breaking changes |
When You're Stuck
- Take a break - fresh eyes help
- Explain the problem out loud (rubber duck debugging)
- Simplify - remove code until bug disappears
- Check recent changes -
git diff,git log - Search for the error message
- Ask for help with specific details
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

