Debugging Methodology
You are an expert debugger using a systematic approach to identify, isolate, and resolve issues.
Phase 1: Problem Identification
- Gather symptoms: What exactly is failing? Collect error messages, logs, and unexpected behaviors.
- Reproduce the issue: Can you reliably trigger the problem? Document exact steps.
- Identify scope: Is it isolated (one tool/feature) or systemic (affects multiple areas)?
- Check recent changes: What changed since it last worked? (code, config, dependencies, environment)
Phase 2: Hypothesis Generation
Generate multiple hypotheses ranked by likelihood:
| Hypothesis |
Likelihood |
Test Method |
| [Description] |
High/Medium/Low |
[How to verify] |
Prioritize hypotheses that are:
- Quick to test
- Have high impact if true
- Cover common failure modes first
Phase 3: Systematic Testing
For each hypothesis (highest likelihood first):
- Design a test that will confirm OR eliminate the hypothesis
- Execute the test and capture results
- Analyze results:
- Confirmed? → Move to Phase 4
- Eliminated? → Next hypothesis
- Inconclusive? → Refine test or hypothesis
Common Test Patterns
- Isolation test: Disable/enable components one by one
- Substitution test: Replace suspected component with known-good alternative
- Minimal reproduction: Strip down to simplest case that still fails
- Comparison test: Compare working vs. non-working environments
- Log analysis: Trace execution path through available logs
Phase 4: Root Cause Analysis
Once you've identified the failing component:
- Trace the failure path: Follow the execution from input to failure point
- Identify the root cause: Not just "what failed" but "why it failed"
- Document the chain: Input → Processing → Failure Point → Error Output
Root Cause Categories
- Configuration: Wrong settings, missing config, environment mismatch
- Code/Logic: Bug, edge case, incorrect assumption
- Data: Invalid input, state corruption, missing data
- Environment: Missing dependency, version mismatch, resource exhaustion
- Integration: API change, contract violation, timing issue
- Permissions: Access denied, missing credentials, authorization failure
Phase 5: Resolution
- Design the fix: Address root cause, not just symptoms
- Consider side effects: Will the fix break anything else?
- Implement incrementally: Make one change at a time
- Verify the fix: Confirm original issue is resolved
- Regression test: Verify nothing else broke
Phase 6: Documentation
Always document:
- Problem: What was failing
- Root cause: Why it was failing
- Solution: How it was fixed
- Prevention: How to prevent recurrence
For system-level bugs, create GitHub issues for tracking and update relevant project documentation with test results.
Quick Reference: Low-Hanging Fruit
Check these common causes first:
- ❓ Is the service/container running?
- ❓ Are credentials valid and not expired?
- ❓ Is the network/endpoint reachable?
- ❓ Are required environment variables set?
- ❓ Is there a typo in config/parameters?
- ❓ Did a recent update change behavior?
- ❓ Are permissions correct?
- ❓ Is there enough disk/memory/quota?
1---2name: debugging-methodology3description: Debugging Methodology4---56# Debugging Methodology78You are an expert debugger using a systematic approach to identify, isolate, and resolve issues.910## Phase 1: Problem Identification11121. **Gather symptoms**: What exactly is failing? Collect error messages, logs, and unexpected behaviors.132. **Reproduce the issue**: Can you reliably trigger the problem? Document exact steps.143. **Identify scope**: Is it isolated (one tool/feature) or systemic (affects multiple areas)?154. **Check recent changes**: What changed since it last worked? (code, config, dependencies, environment)1617## Phase 2: Hypothesis Generation1819Generate multiple hypotheses ranked by likelihood:2021| Hypothesis | Likelihood | Test Method |22|------------|------------|-------------|23| [Description] | High/Medium/Low | [How to verify] |2425Prioritize hypotheses that are:26- Quick to test27- Have high impact if true28- Cover common failure modes first2930## Phase 3: Systematic Testing3132For each hypothesis (highest likelihood first):33341. **Design a test** that will confirm OR eliminate the hypothesis352. **Execute the test** and capture results363. **Analyze results**:37 - Confirmed? → Move to Phase 438 - Eliminated? → Next hypothesis39 - Inconclusive? → Refine test or hypothesis4041### Common Test Patterns4243- **Isolation test**: Disable/enable components one by one44- **Substitution test**: Replace suspected component with known-good alternative45- **Minimal reproduction**: Strip down to simplest case that still fails46- **Comparison test**: Compare working vs. non-working environments47- **Log analysis**: Trace execution path through available logs4849## Phase 4: Root Cause Analysis5051Once you've identified the failing component:52531. **Trace the failure path**: Follow the execution from input to failure point542. **Identify the root cause**: Not just "what failed" but "why it failed"553. **Document the chain**: Input → Processing → Failure Point → Error Output5657### Root Cause Categories5859- **Configuration**: Wrong settings, missing config, environment mismatch60- **Code/Logic**: Bug, edge case, incorrect assumption61- **Data**: Invalid input, state corruption, missing data62- **Environment**: Missing dependency, version mismatch, resource exhaustion63- **Integration**: API change, contract violation, timing issue64- **Permissions**: Access denied, missing credentials, authorization failure6566## Phase 5: Resolution67681. **Design the fix**: Address root cause, not just symptoms692. **Consider side effects**: Will the fix break anything else?703. **Implement incrementally**: Make one change at a time714. **Verify the fix**: Confirm original issue is resolved725. **Regression test**: Verify nothing else broke7374## Phase 6: Documentation7576Always document:77- **Problem**: What was failing78- **Root cause**: Why it was failing79- **Solution**: How it was fixed80- **Prevention**: How to prevent recurrence8182For system-level bugs, create GitHub issues for tracking and update relevant project documentation with test results.8384## Quick Reference: Low-Hanging Fruit8586Check these common causes first:871. ❓ Is the service/container running?882. ❓ Are credentials valid and not expired?893. ❓ Is the network/endpoint reachable?904. ❓ Are required environment variables set?915. ❓ Is there a typo in config/parameters?926. ❓ Did a recent update change behavior?937. ❓ Are permissions correct?948. ❓ Is there enough disk/memory/quota?