debug
Fix bugs systematically instead of guessing. Use when features break, users report errors, or tests fail. Covers reproducing bugs, gathering diagnostic info, and working with AI tools to fix issues efficiently for non-technical founders.
Best use case
debug is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Fix bugs systematically instead of guessing. Use when features break, users report errors, or tests fail. Covers reproducing bugs, gathering diagnostic info, and working with AI tools to fix issues efficiently for non-technical founders.
Teams using debug should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/7-debug/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How debug Compares
| Feature / Agent | debug | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Fix bugs systematically instead of guessing. Use when features break, users report errors, or tests fail. Covers reproducing bugs, gathering diagnostic info, and working with AI tools to fix issues efficiently for non-technical founders.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Debug ## Debugging Workflow ``` Debug Process: - [ ] Reproduce bug consistently - [ ] Capture what's happening (screenshots, errors) - [ ] Check what changed recently - [ ] Gather diagnostic info - [ ] Give info to AI to diagnose - [ ] AI proposes fix - [ ] Test fix works - [ ] Verify didn't break anything else ``` See [DEBUG-CHECKLIST.md](DEBUG-CHECKLIST.md) for detailed steps. --- ## The Golden Rule **NO GUESSING. GATHER INFO FIRST.** Bad approach: 1. Something broke 2. Try random fix 3. Doesn't work 4. Try another fix 5. Still broken after 5 attempts Good approach: 1. Something broke 2. Reproduce it consistently 3. Gather diagnostic info 4. Give to AI to diagnose 5. AI fixes it (usually first try) **Diagnosis before fixes.** --- ## Reproducing Bugs **Before asking AI to fix, reproduce it:** ``` Can you reproduce it? - [ ] Exact steps to trigger bug - [ ] Happens every time - [ ] Happens on specific browser/device - [ ] Happens with specific data If can't reproduce: - Ask user for exact steps - Try different browser/device - Try with different data - Check if intermittent (timing issue) ``` **Tell AI:** ``` Bug: [description] Steps to reproduce: 1. [Step] 2. [Step] 3. [Bug happens] Happens: [Always / Sometimes / Once] Browser: [Chrome 120 on Mac] Screenshot: [attach] ``` --- ## Capturing Error Info ### Browser Console Errors **Open console:** 1. Right-click page → Inspect 2. Click "Console" tab 3. Look for red errors **Screenshot errors and give to AI:** ``` I see this error in console: [paste error message] When it happens: [what you were doing] Please: 1. Explain what this means 2. Identify the cause 3. Fix the issue ``` ### Network Errors **Check network tab:** 1. Open DevTools → Network 2. Reproduce bug 3. Look for failed requests (red) 4. Click failed request 5. Check response **Tell AI:** ``` API call failing: URL: /api/endpoint Status: 500 Internal Server Error Response: [paste error response] This happens when: [action] ``` ### Visual Bugs **Screenshot everything:** - What you expected to see - What actually shows - Full page context - Error messages **Tell AI:** ``` Visual bug: [description] Expected: [screenshot or description] Actual: [screenshot] Device: [iPhone 14, Chrome on Mac, etc] ``` --- ## What Changed? **Ask yourself:** - Did this work yesterday? - What did AI change today? - Did you deploy recently? - Did you change any settings? **Tell AI:** ``` This worked yesterday, broke today. Changes made today: - [Change 1] - [Change 2] Which could cause: [the bug]? ``` --- ## Common Bug Types ### "Nothing happens when I click" **Check:** - Console errors? - Network request failing? - Button actually clickable? **Tell AI:** ``` Button does nothing when clicked. Button: [which button] Expected: [what should happen] Console errors: [paste any errors] ``` ### "Page won't load" **Check:** - Network errors? - JavaScript errors? - Infinite redirect? **Tell AI:** ``` Page won't load: /page/url Browser shows: [blank / error / loading forever] Console errors: [paste] Network errors: [paste] ``` ### "Wrong data showing" **Check:** - API returning wrong data? - Caching issue? - State management bug? **Tell AI:** ``` Showing wrong data. Expected: [User A's profile] Showing: [User B's profile] API response: [paste from Network tab] ``` ### "Form doesn't submit" **Check:** - Validation errors? - Console errors? - Network request happening? **Tell AI:** ``` Form won't submit. Form: [which form] Filled: [what data entered] Validation errors: [any visible] Console errors: [paste] ``` --- ## Working with AI to Debug ### Step 1: Gather Info ``` Before asking AI to fix, provide: - Exact steps to reproduce - Expected vs actual behavior - Screenshots/error messages - Browser and device - What changed recently (if known) ``` ### Step 2: AI Diagnoses ``` [Paste all info above] Before proposing fixes: 1. What do you think is wrong? 2. Why is it happening? 3. What needs to change? Explain in plain English first. ``` ### Step 3: AI Fixes ``` Okay, now please fix it. After fixing: - Explain what you changed - How to test the fix - What to watch out for ``` ### Step 4: Verify Fix ``` Test the fix: - [ ] Original bug is gone - [ ] Tested same steps, works now - [ ] Related features still work - [ ] No new console errors ``` See [DEBUG-PROMPTS.md](DEBUG-PROMPTS.md) for more patterns. --- ## When You're Stuck **After 2 failed fix attempts:** Stop. Don't try a 3rd fix. **Ask AI:** ``` Tried 2 fixes, both didn't work. Original bug: [description] Fix 1: [what we tried] - didn't work Fix 2: [what we tried] - still broken Questions: - Are we fixing the wrong thing? - Is there a better approach? - Should we start over? ``` **If 3+ fixes failed:** Probably need to rethink approach, not try more fixes. --- ## Intermittent Bugs **"It works sometimes, breaks sometimes"** **Likely causes:** - Race condition (timing) - Caching issue - Network timing - External API flakiness **Tell AI:** ``` Bug is intermittent. Works: [X] out of 10 times Fails: [Y] out of 10 times Pattern noticed: - Fails more often when [condition] - Never fails when [condition] Please add logging to capture when it fails. ``` --- ## Bugs in Production **Users reporting bugs in live app:** **Priority 1: Can users work around it?** - Yes → Fix in next deployment - No → Emergency fix needed **For emergency fixes:** ``` Production bug blocking users. Bug: [description] Impact: [how many users affected] Need quick fix: - Simplest solution that works - Don't optimize, just unblock users - Can improve later ``` **For non-urgent:** ``` Production bug reported by user. Bug: [description] Impact: [minor / major] Can work around: [yes / no] Reproduce in development: [steps] Then fix and test before deploying. ``` --- ## Reading Error Messages **Common error patterns:** **"Cannot read property of undefined"** - Trying to access something that doesn't exist - Check: Is data loaded before accessing it? **"Maximum call stack exceeded"** - Infinite loop or recursion - Check: Function calling itself forever? **"Network request failed"** - API call not working - Check: Network tab for status code **"Unauthorized" or "401"** - Authentication issue - Check: Are you logged in? Token valid? **"Internal Server Error" or "500"** - Backend problem - Check: Server logs for details See [ERROR-MESSAGES.md](ERROR-MESSAGES.md) for more. --- ## Debugging Tools **Built into browser:** - Console: See errors and logs - Network: See API calls and responses - Elements: Inspect HTML/CSS - Sources: Set breakpoints (advanced) **How to use:** 1. Open DevTools (F12 or right-click → Inspect) 2. Click relevant tab 3. Reproduce bug 4. Look for errors/failed requests **Screenshot and give to AI** - AI can interpret errors. --- ## Common Mistakes | Mistake | Fix | |---------|-----| | Trying fixes without info | Gather diagnostic info first | | "It doesn't work" | Be specific: what doesn't work? | | Not reproducing first | Find consistent steps to trigger bug | | Random fixes | Diagnose root cause first | | Ignoring console errors | Always check console | | Not testing after fix | Verify fix works, didn't break other things | --- ## When to Get Help **Consider hiring developer when:** - Stuck after following this process - Critical bug can't figure out - Same bug keeps coming back - Bug in complex integration - Need production fixed urgently **For most bugs:** Following this process with AI is sufficient. --- ## Prevention **After fixing, ask AI:** ``` Bug is fixed. How could we have prevented this? - Better validation? - Better error handling? - Testing we should add? ``` **Build prevention into next features.** --- ## Quick Debug Checklist **When something breaks:** ``` Quick Debug: - [ ] Can I reproduce it? - [ ] Any console errors? - [ ] Any network errors? - [ ] What changed recently? - [ ] Screenshot the issue - [ ] Gather all info - [ ] Give to AI with context - [ ] Test AI's fix ``` **5 minutes of diagnosis > 2 hours of guessing** --- ## Success Looks Like ✅ Bugs fixed on first or second try ✅ Can explain what was wrong ✅ Know how to reproduce bugs ✅ Gather complete info before asking for fixes ✅ Verify fixes work and don't break other things ✅ Bugs getting rarer over time (learning patterns)
Related Skills
chrome-debug
This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.
advanced-debugging
Advanced debugging skill for MyJKKN project. Specialized workflows for debugging Next.js 15, Supabase, React Query, TypeScript, and service layer issues. Includes automated analysis tools, common error patterns, and step-by-step troubleshooting guides for reducing debugging time. Use when investigating bugs, errors, performance issues, or unexpected behavior. (project)
actions-debugger
GitHub Actions のワークフロー実行エラーを調査し、原因を特定して解決策を提案する。「Actions エラー」「ワークフロー失敗」「CI が落ちた」「ビルド失敗」「テスト失敗」「Actions を調べて」「CI のエラーを見て」などで起動。失敗したジョブのログを分析し、具体的な修正方法を提示。
thor-skills
An entry point and router for AI agents to manage various THOR-related cybersecurity tasks, including running scans, analyzing logs, troubleshooting, and maintenance.
ux
This AI agent skill provides comprehensive guidance for creating professional and insightful User Experience (UX) designs, covering user research, information architecture, interaction design, visual guidance, and usability evaluation. It aims to produce actionable, user-centered solutions that avoid generic AI aesthetics.
ontopo
An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.
whisper-transcribe
Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.
modal-deployment
Run Python code in the cloud with serverless containers, GPUs, and autoscaling using Modal. This skill enables agents to generate code for deploying ML models, running batch jobs, serving APIs, and scaling compute-intensive workloads.
vly-money
Generate crypto payment links for supported tokens and networks, manage access to X402 payment-protected content, and provide direct access to the vly.money wallet interface.
tech-blog
Generates comprehensive technical blog posts, offering detailed explanations of system internals, architecture, and implementation, either through source code analysis or document-driven research.
astro
This skill provides essential Astro framework patterns, focusing on server-side rendering (SSR), static site generation (SSG), middleware, and TypeScript best practices. It helps AI agents implement secure authentication, manage API routes, and debug rendering behaviors within Astro projects.
grail-miner
This skill assists in setting up, managing, and optimizing Grail miners on Bittensor Subnet 81, handling tasks like environment configuration, R2 storage, model checkpoint management, and performance tuning.