Skip to main content

Debugging with AI DevKit

Learn how to systematically debug issues using AI DevKit's structured debugging workflows

Debugging with AI assistants often becomes a guessing game—trying random fixes until something works. The /debug command changes this by providing a structured methodology that ensures you understand the problem before attempting a solution.

#

When to Use /debug

Use this command when:

  • Something isn't working as expected
  • You're facing a bug you can't immediately explain
  • You need to troubleshoot performance or integration issues
  • You want a systematic approach instead of trial-and-error
#

Quick Example

Here's what a /debug session looks like:

You: /debug

AI: What issue are you experiencing?

You: Users are getting a 500 error when trying to upload images larger than 5MB.

AI: Let me help you debug this systematically.

**Step 1: Gather Context**
- What's the expected behavior? (Users should upload images up to 10MB)
- When did this start? (After last deployment)
- Error logs? (Request entity too large)

**Step 2: Clarify Expectations**
Based on your requirements doc, the upload limit should be 10MB.
Current config shows: maxFileSize: '5mb'

**Step 3: Reproduce & Isolate**
I can reproduce with any file > 5MB. The issue is in the upload middleware.

**Step 4-7: Analysis → Solution**
Root cause: Config mismatch between frontend (10MB) and backend (5MB).
Recommended fix: Update backend config to match requirements.
#

The 7-Step Debugging Process

The /debug command follows a proven methodology:

StepPurpose
1. Gather ContextUnderstand what's happening vs. what should happen
2. Clarify ExpectationsConfirm requirements and success criteria
3. Reproduce & IsolateCreate reliable reproduction steps
4. Analyze CausesIdentify potential root causes with evidence
5. Surface OptionsPresent multiple resolution approaches
6. Confirm PathSelect the best approach and plan validation
7. Track ActionsDocument tasks, owners, and follow-ups
#

Step Details

1. Gather Context

  • Understand what's happening vs. what should happen
  • Identify the scope and impact of the issue
  • Collect error messages, logs, and symptoms

2. Clarify Expectations

  • Confirm requirements and acceptance criteria
  • Define success metrics for the fix
  • Identify relevant documentation or tickets

3. Reproduce & Isolate

  • Create reliable reproduction steps
  • Isolate the problem to specific components
  • Identify environment-specific factors

4. Analyze Causes

  • Brainstorm potential root causes
  • Gather supporting evidence (logs, metrics, traces)
  • Identify gaps in understanding

5. Surface Options

  • Present multiple resolution approaches
  • Evaluate pros, cons, and risks for each option
  • Consider implementation complexity and timeline

6. Confirm Path

  • Select the best resolution approach
  • Define success criteria and validation steps
  • Plan required approvals and coordination

7. Track Actions

  • Document specific tasks and owners
  • Set timelines and follow-up actions
  • Plan monitoring and communication
#

Use Cases

  • Bug Fixes — Resolve unexpected behavior or errors
  • Integration Issues — Troubleshoot system interactions
  • Performance Problems — Analyze and fix slowdowns
  • Security Concerns — Investigate and resolve vulnerabilities
  • Validation — Verify fixes before deployment
#

Next Steps

Getting Started Guides by Tool

Choose your AI tool for a tailored setup guide.