# How I-Have-ADHD Assists During a Debug Spiral: Breaking the Loop with Focused Diagnostics

> Break debug spirals with I-Have-ADHD. Our skill identifies incorrect assumptions and guides you with focused questions, ending frustrating loops.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: how-to-guide
- Published: 2026-08-27

---

**The i-have-adhd skill detects when you're stuck in a debug spiral and interrupts the loop by naming the most likely incorrect assumption and asking one focused diagnostic question.**

When debugging drags on and repeated fixes fail, developers with ADHD often face a unique challenge: the brain locks into iterative pattern-matching without stepping back to reframe the problem. The **i-have-adhd** skill for LLMs addresses this directly through its **debug-spiral rule**, which triggers after three consecutive "still broken" responses. This open-source plugin reshapes assistant behavior to match how an ADHD brain processes information—prioritizing pattern interruption over endless iteration.

## How the Debug-Spiral Rule Activates

The rule is defined in the canonical skill file [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) under the *When to break the rules* section (lines 123-124). Activation follows a clear trigger sequence:

1. **Detection** – The skill monitors for three consecutive user replies indicating failure (e.g., "still broken," "same error," "didn't work")
2. **Interruption** – The assistant stops rewriting code
3. **Assumption naming** – It explicitly states the most likely incorrect assumption
4. **Single question** – It poses one focused diagnostic query to gather new information

This structure prevents the common trap where both human and AI keep regenerating variations on the same flawed solution.

## Architecture: How the Skill Reaches Different Runtimes

The i-have-adhd plugin lives in the **skills** directory and exposes its rule set through thin runtime-specific adapters:

| Runtime | Adapter Entry Point | Routing Mechanism |
|---------|-------------------|-------------------|
| Claude Code | [`.claude-plugin/plugin.json`](https://github.com/ayghri/i-have-adhd/blob/main/.claude-plugin/plugin.json) → `.opencode/plugins/i-have-adhd.mjs` | Injects rules into Claude's response pipeline |
| OpenCode | [`opencode.json`](https://github.com/ayghri/i-have-adhd/blob/main/opencode.json) → [`.opencode/command/i-have-adhd.md`](https://github.com/ayghri/i-have-adhd/blob/main/.opencode/command/i-have-adhd.md) | `/i-have-adhd` command activates persistent mode until "stop adhd mode" |
| Pi / OMP | [`package.json`](https://github.com/ayghri/i-have-adhd/blob/main/package.json) (`pi`/`omp`) → [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) | TypeScript extension forwards rules to underlying model |

When triggered, each adapter inserts the prescribed response pattern—named assumption plus one question—before the model's normal output. This guarantees consistent **debug spiral** handling across all supported environments.

## Code Example: Claude Code Debug Spiral

Here's how the skill behaves when a debugging session goes circular:

```text
User: /i-have-adhd
Assistant: (initial response…)  
User: The test still fails after applying the fix.
Assistant: (again suggests a change)  
User: Still broken.
Assistant: (again suggests a change)  
User: Still broken.
Assistant: **Debug spiral** – The assumption that the failure is due to a missing header might be wrong.  
❓ Is the test suite loading the correct environment configuration?

```

Notice the explicit **"Debug spiral"** label, the named assumption about headers, and the single targeted question about environment configuration—no additional code suggestions until new information arrives.

## Implementation: Using I-Have-ADHD in Generic Clients

For OpenAI-compatible clients, you can invoke the skill through system prompting:

```javascript
import { OpenAI } from "openai";
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

await client.chat.completions.create({
  model: "gpt-4o",
  messages: [
    { role: "system", content: "You are running with the i-have-adhd skill." },
    { role: "user", content: "/i-have-adhd" },
    // … debugging dialogue …
  ],
});

```

The skill monitors the conversation state; upon detecting three consecutive failure acknowledgments, it outputs the **debug-spiral** response pattern described above.

## Key Source Files for I-Have-ADHD

Understanding the repository structure reveals how the **debug spiral** detection flows from definition to execution:

- **[`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md)** – Defines all 10 ADHD rules, including the debug-spiral clause. This is the canonical source of behavior.
- **`.opencode/plugins/i-have-adhd.mjs`** – OpenCode plugin entry point that wraps and injects the skill.
- **[`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts)** – TypeScript adapter for Pi and OMP runtimes.
- **[`AGENTS.md`](https://github.com/ayghri/i-have-adhd/blob/main/AGENTS.md)** – Navigation guide mapping each runtime to its entry point.
- **[`README.md`](https://github.com/ayghri/i-have-adhd/blob/main/README.md)** – User-facing documentation covering installation and activation.

These files collectively enable the skill to surface hidden assumptions and pose clarifying questions—keeping developers focused and preventing endless **debug spiral** patterns.

## Summary

- **Debug spiral detection** triggers after three consecutive "still broken" responses
- **Behavior change** stops code rewriting and names the most likely faulty assumption
- **Single diagnostic question** breaks the loop and forces new information gathering
- **Runtime adapters** in `.opencode/plugins/i-have-adhd.mjs`, [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts), and related files inject the rule set across Claude Code, OpenCode, and Pi/OMP
- **Canonical definition** lives in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) lines 123-124

## Frequently Asked Questions

### What exactly triggers the debug-spiral rule in i-have-adhd?

The rule activates when the skill detects three consecutive user replies indicating that a debugging attempt failed—phrases like "still broken," "same error," or "didn't work." This threshold is defined in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) to catch circular debugging patterns before they consume excessive time and attention.

### How does the skill change the assistant's behavior during a debug spiral?

Instead of generating another code fix, the assistant outputs a structured response with two components: an explicit statement of the most likely incorrect assumption, and exactly one focused question designed to surface new information. This pattern interruption prevents both the AI and the user from continuing with the same mental model.

### Can I use i-have-adhd with any LLM or only specific ones?

The skill supports multiple runtimes through its adapter architecture. Claude Code, OpenCode, and Pi/OMP have dedicated entry points. For generic OpenAI-compatible clients, you can activate the skill through system prompts, though full state tracking for **debug spiral** detection depends on the client maintaining conversation history.

### Where is the debug-spiral rule actually defined in the source code?

The canonical definition resides in [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) at lines 123-124 within the *When to break the rules* section. Runtime-specific implementations in `.opencode/plugins/i-have-adhd.mjs` and [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) handle the injection and execution of this rule across different environments.