mode-debug

star 0

Debug mode for fixing bugs, errors, and crashes. Use when user reports bugs or errors that need fixing. Follows 5W1H approach: gather info, reproduce, analyze root cause, fix, and prevent recurrence.

mahamaneharouna9-cpu By mahamaneharouna9-cpu schedule Updated 1/21/2026

name: mode-debug description: >- Debug mode for fixing bugs, errors, and crashes. Use when user reports bugs or errors that need fixing. Follows 5W1H approach: gather info, reproduce, analyze root cause, fix, and prevent recurrence. license: MIT compatibility: opencode metadata: category: workflow source: antigravity-kit

Debug Mode

Goal: Find the correct cause, fix the right place, prevent recurrence.

Process

  1. Gather information (5W1H)
  2. Reproduce the bug
  3. Analyze root cause
  4. Propose fix + explanation
  5. Propose prevention measures

Required Questions If Information Is Missing

  1. Exact error message? (Copy verbatim)
  2. Which screen/feature does it occur on?
  3. Can it be reproduced? Specific steps?
  4. Any recent code changes?
  5. Anything unusual in logs?
  6. Which language/framework are you using?

Common Bug Patterns

Null/None Reference Errors

Language Error Message Typical Cause
JS/TS Cannot read property of undefined Missing null check
Python AttributeError: 'NoneType' has no attribute Variable is None
Java NullPointerException Object not initialized
Go panic: runtime error: invalid memory address Nil pointer

Type/Cast Errors

Language Error Message Typical Cause
JS/TS TypeError: X is not a function Wrong type assignment
Python TypeError: unsupported operand type Type mismatch
Java ClassCastException Invalid casting

Common Logic Bugs

Bug Type Symptom All Languages
Off-by-one Wrong loop bounds < vs <=, index starts at 0 or 1
Race condition Inconsistent data Async/threading without sync
Memory leak Performance degrades Missing cleanup, circular refs
Infinite loop App hangs/freezes Missing break condition

Output Format

## DEBUG

**Symptom:** [error description]
**Language:** [JS/Python/Java/Go/PHP/Ruby]

**Reproduction:**
1. [Step 1]
2. [Step 2]
3. [Error appears]

---

### Analysis:
**Root Cause:** [root cause]
**Location:** `[file:line]`

### Fix:
```diff
- [old code]
+ [new code]

Reason: [explanation]

Prevention:

Suggestion Priority
[Add validation] High
[Write unit test] Medium

## Quick Fix Examples

### JavaScript
```diff
- const userName = user.name;
+ const userName = user?.name ?? 'Unknown';

Python

- email = data['email']
+ email = data.get('email', '')

Go

- value := items[index]
+ if index < len(items) {
+     value := items[index]
+ }

Principles

DON'T DO
Guess randomly Request log/screenshot
Refactor randomly Fix the right place, minimal change
Stop after fixing Propose prevention
Fix symptoms Find and fix root cause
Skip testing fix Verify fix works before delivering
Install via CLI
npx skills add https://github.com/mahamaneharouna9-cpu/Apex-invoice-billing-automation --skill mode-debug
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator
mahamaneharouna9-cpu
mahamaneharouna9-cpu Explore all skills →