Debugging Assistant
When to activate
- Tests fail or produce unexpected behavior
- Application crashes or throws errors in production or development
- Feature works partially but not as expected
- Performance degradation or memory leaks detected
- Integration between components breaks after changes
- Need systematic root-cause analysis for flaky or intermittent bugs
When NOT to use
- Architecture or design questions (use design review skills instead)
- Feature requests or new functionality planning
- General refactoring or code cleanup (use simplify/code-review skills)
- Debugging external services or third-party APIs (delegate to those services' documentation/support)
- Static analysis or linting issues (use code-review skill)
Instructions
Step 1: Establish Reproducibility
- Ask for exact reproduction steps, error messages, and logs
- Create minimal reproducible example (MRE) if not provided
- Identify: does it always fail, intermittently, or only under specific conditions
- Check error logs, stack traces, and console output
- Verify: is this new (regression) or pre-existing behavior
Step 2: Narrow Scope
- Identify which subsystem is affected (frontend, backend, database, network, etc.)
- Use binary search: disable/enable features to isolate the problem
- Check recent changes: git diff, git log with
--since flags
- Verify environment: dependencies versions, configuration, OS differences
- Confirm: is this a code issue or environment/infrastructure issue
Step 3: Inspect Root Cause
- Read error messages carefully — stack traces point to the failure location
- Add debugging statements (console.log, print, debugger breakpoints) at suspected points
- Use IDE debugger to step through code execution
- Check variable states at breakpoints — are they what you expect
- Inspect network requests/responses using browser DevTools or tools like curl/Postman
- Review logs systematically — search for ERROR, WARN, and EXCEPTION patterns
Step 4: Form Hypothesis
- Based on evidence gathered, propose what's broken and why
- State what behavior is expected vs. actual
- Identify the exact line/function causing the issue
- Check: does this hypothesis explain all observed symptoms
Step 5: Test Hypothesis
- Apply minimal fix to test theory
- Run reproduction steps again
- Verify: does the fix resolve ALL symptoms, not just one
- Check for side effects — does the fix break other functionality
- Add regression test to prevent recurrence
Step 6: Implement & Verify
- Apply the permanent fix
- Run existing test suite
- Add new test case covering this bug
- Update documentation if behavior changed
- Verify in development, staging, and production-like environments
Debugging Toolkit
For Frontend (JavaScript/TypeScript):
- Browser DevTools console and debugger
- Network tab for API requests
- React/Vue DevTools extensions
- Performance profiler for memory leaks
For Backend (Node/Python/Java):
- Console/print statements with context
- IDE debugger with breakpoints and watch expressions
- Log aggregation tools (grep, tail, structured logging)
- APM tools for performance bottlenecks
- Database query logs for ORM issues
For Full Stack:
- Request/response inspection (curl, Postman, fetch)
- Environment variable verification
- Dependency version conflicts (package-lock.json, requirements.txt)
- Git blame for when behavior changed
- Docker logs and container state inspection
Example
Scenario: Authentication token expires mid-request
Problem: User gets "Unauthorized" error mid-workflow after 30 minutes of inactivity.
Step 1 — Reproducibility:
- Reproduction: Login, wait 30+ minutes, attempt API call
- Error: 401 Unauthorized from backend
- Logs show: Token validation failed
Step 2 — Scope:
- Affected: API requests from frontend
- Recent changes: Token refresh logic updated 2 commits ago
- Environment: Both dev and staging show issue
Step 3 — Root Cause Inspection:
- Added debugger to token refresh middleware
- Inspected localStorage: token expires at timestamp X
- Checked network: refresh endpoint returns 401 instead of new token
- Git diff shows: refresh endpoint authorization check added, but refresh itself requires valid token (circular dependency)
Step 4 — Hypothesis:
Refresh endpoint requires a valid token to refresh, but the token is expired. The circular dependency prevents token renewal.
Step 5 — Test Fix:
- Remove token requirement from refresh endpoint temporarily
- Retry reproduction: token refreshes successfully
- User workflow completes without 401
Step 6 — Permanent Fix:
- Use refresh token (separate, longer-lived token) for refresh endpoint
- Update token refresh logic to use refresh token, not access token
- Add test: verify token refreshes when access token expired but refresh token valid
- Deploy and verify in staging
1---2name: debugging-assistant3description: Debugging Assistant4metadata:5 source: https://skillmd.com/skills/uitbreidenos/debugging-assistant6---7# Debugging Assistant89## When to activate1011- Tests fail or produce unexpected behavior12- Application crashes or throws errors in production or development13- Feature works partially but not as expected14- Performance degradation or memory leaks detected15- Integration between components breaks after changes16- Need systematic root-cause analysis for flaky or intermittent bugs1718## When NOT to use1920- Architecture or design questions (use design review skills instead)21- Feature requests or new functionality planning22- General refactoring or code cleanup (use simplify/code-review skills)23- Debugging external services or third-party APIs (delegate to those services' documentation/support)24- Static analysis or linting issues (use code-review skill)2526## Instructions2728### Step 1: Establish Reproducibility29- Ask for exact reproduction steps, error messages, and logs30- Create minimal reproducible example (MRE) if not provided31- Identify: does it always fail, intermittently, or only under specific conditions32- Check error logs, stack traces, and console output33- Verify: is this new (regression) or pre-existing behavior3435### Step 2: Narrow Scope36- Identify which subsystem is affected (frontend, backend, database, network, etc.)37- Use binary search: disable/enable features to isolate the problem38- Check recent changes: git diff, git log with `--since` flags39- Verify environment: dependencies versions, configuration, OS differences40- Confirm: is this a code issue or environment/infrastructure issue4142### Step 3: Inspect Root Cause43- Read error messages carefully — stack traces point to the failure location44- Add debugging statements (console.log, print, debugger breakpoints) at suspected points45- Use IDE debugger to step through code execution46- Check variable states at breakpoints — are they what you expect47- Inspect network requests/responses using browser DevTools or tools like curl/Postman48- Review logs systematically — search for ERROR, WARN, and EXCEPTION patterns4950### Step 4: Form Hypothesis51- Based on evidence gathered, propose what's broken and why52- State what behavior is expected vs. actual53- Identify the exact line/function causing the issue54- Check: does this hypothesis explain all observed symptoms5556### Step 5: Test Hypothesis57- Apply minimal fix to test theory58- Run reproduction steps again59- Verify: does the fix resolve ALL symptoms, not just one60- Check for side effects — does the fix break other functionality61- Add regression test to prevent recurrence6263### Step 6: Implement & Verify64- Apply the permanent fix65- Run existing test suite66- Add new test case covering this bug67- Update documentation if behavior changed68- Verify in development, staging, and production-like environments6970### Debugging Toolkit7172**For Frontend (JavaScript/TypeScript):**73- Browser DevTools console and debugger74- Network tab for API requests75- React/Vue DevTools extensions76- Performance profiler for memory leaks7778**For Backend (Node/Python/Java):**79- Console/print statements with context80- IDE debugger with breakpoints and watch expressions81- Log aggregation tools (grep, tail, structured logging)82- APM tools for performance bottlenecks83- Database query logs for ORM issues8485**For Full Stack:**86- Request/response inspection (curl, Postman, fetch)87- Environment variable verification88- Dependency version conflicts (package-lock.json, requirements.txt)89- Git blame for when behavior changed90- Docker logs and container state inspection9192## Example9394### Scenario: Authentication token expires mid-request9596**Problem:** User gets "Unauthorized" error mid-workflow after 30 minutes of inactivity.9798**Step 1 — Reproducibility:**99- Reproduction: Login, wait 30+ minutes, attempt API call100- Error: 401 Unauthorized from backend101- Logs show: Token validation failed102103**Step 2 — Scope:**104- Affected: API requests from frontend105- Recent changes: Token refresh logic updated 2 commits ago106- Environment: Both dev and staging show issue107108**Step 3 — Root Cause Inspection:**109- Added debugger to token refresh middleware110- Inspected localStorage: token expires at timestamp X111- Checked network: refresh endpoint returns 401 instead of new token112- Git diff shows: refresh endpoint authorization check added, but refresh itself requires valid token (circular dependency)113114**Step 4 — Hypothesis:**115Refresh endpoint requires a valid token to refresh, but the token is expired. The circular dependency prevents token renewal.116117**Step 5 — Test Fix:**118- Remove token requirement from refresh endpoint temporarily119- Retry reproduction: token refreshes successfully120- User workflow completes without 401121122**Step 6 — Permanent Fix:**123- Use refresh token (separate, longer-lived token) for refresh endpoint124- Update token refresh logic to use refresh token, not access token125- Add test: verify token refreshes when access token expired but refresh token valid126- Deploy and verify in staging