Debugging Skill
Systematic Approach
Before suggesting any changes, complete ALL of these steps:
- •
Understand the Project
- •Read the entire folder structure
- •Understand architecture and patterns
- •Review existing documentation (README.md, docs/)
- •
Analyze the Error
- •Read full error message and stack trace
- •Identify the source file and line number
- •Check recent changes that might have caused it
- •
Check Documentation
- •Review project docs for known issues
- •Check if issue was documented before with a fix
- •Look for similar patterns in the codebase
- •
Web Search for Solutions
- •Use webfetch to search for similar issues
- •Check GitHub issues on relevant repositories
- •Use gh_grep to find how others solved it
- •Look for Stack Overflow discussions
- •
Find Existing Fixes
- •Check if the issue was fixed before
- •Look in docs/ folder for documented fixes
- •Check git history for related changes
- •
Only Then Suggest Changes
- •Provide specific, actionable fix
- •Explain why the fix works
- •Note any side effects or considerations
Common Error Patterns
| Error Type | Check First |
|---|---|
| Module not found | package.json, node_modules, import paths |
| Type errors | TypeScript config, type definitions |
| Runtime errors | Environment, dependencies, config |
| Build errors | Build config, dependencies, syntax |
| Network errors | URLs, CORS, firewall, API keys |
Documentation Requirement
Every bug fix must be documented in README.md:
- •What was the error/issue
- •What caused it
- •How it was fixed
- •When it was fixed
This is useful if the bug appears again in future.
Tools to Use
- •context7: Look up framework troubleshooting guides
- •gh_grep: Search for similar errors in GitHub repos
- •webfetch: Search for error messages online
- •read: Examine error-related files
- •grep: Search codebase for related patterns
Key Principle
Do NOT suggest changes until you have:
- •Understood the entire project
- •Analyzed the error thoroughly
- •Searched for existing solutions
- •Checked documentation for prior fixes