Ai debug

From breethomas/bette-think · View interactive version

Ai debug is an AI agent skill from the GitHub repository breethomas/bette-think. Diagnose why an AI feature is underperforming, hallucinating, or behaving inconsistently. Uses 4D audit to work backwards from symptoms to root cause.

How to use this skill

Skill file

AI Debug

Figure out why an existing AI feature is broken.

Works with:

Entry Point

When this skill is invoked, start with:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 AI DEBUG
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

When AI fails, teams blame the model.
But 90% of failures are context failures.

What's going wrong?

  1. Provide a Linear issue ID
  2. Describe the symptoms

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Usage

/ai-debug                 # Describe symptoms manually
/ai-debug LIN-123         # Start from Linear bug/issue

What It Does

Works backwards from symptoms to root cause using the 4D audit:

| Symptom | Likely Root Cause | Focus Area |

|---------|-------------------|------------|

| Hallucinations | Missing domain context, no grounding | D2, D4 |

| Inconsistency | Vague job definition, missing rules | D1, D4 |

| Generic outputs | Missing user/environment context | D2 |

| Wrong tone/format | Missing constraints, no examples | D1, D4 |

| Slow responses | Too much context, bad discovery | D2, D3 |

| High costs | Dumping everything in prompt | D2, D3 |

| Demo vs prod mismatch | Discovery strategy broken | D3, D4 |

Key insight: When AI fails, teams blame the model. But 90% of failures are context failures.

The 4D Audit

D1: Was the Job Defined?

D2: Is Context Right?

D3: Is Context Fetched Reliably?

D4: Are Failures Being Caught?

Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 CONTEXT AUDIT COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Feature: [Name]
Symptoms: [What was reported]

  D1 Demand:      [CLEAR / GAP / CRITICAL]
  D2 Data:        [CLEAR / GAP / CRITICAL]
  D3 Discovery:   [CLEAR / GAP / CRITICAL]
  D4 Defense:     [CLEAR / GAP / CRITICAL]

Primary Issue: [Root cause summary]

RECOMMENDED FIXES (prioritized):
1. [Highest impact fix]
2. [Second fix]
3. [Third fix]

Quick Win: [Smallest change that would help]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Workflow

  1. Collect symptoms (what's going wrong)
  2. Map symptoms to likely causes using the table above
  3. Audit each D dimension with diagnostic questions
  4. Identify root cause and prioritize fixes
  5. Offer to add findings to Linear or export

Questions to ask at each step:


Framework: 4D Context Canvas (Aakash Gupta & Miqdad Jaffer)

Best for: Debugging hallucinations, inconsistency, performance issues in AI features

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.