ai-debug

Enforces a structured hypothesis-test-observe debugging loop with a three-cycle budget for failing tests.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/Vimurai/ai-os --skill ai-debug-vimurai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-debug
Source: https://github.com/Vimurai/ai-os/tree/main/.claude/skills/ai-debug
Command: npx skills add https://github.com/Vimurai/ai-os --skill ai-debug-vimurai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging sessions often devolve into trial-and-error changes that burn tokens and never converge. This Skill enforces a disciplined hypothesis→test→observe loop for failing tests or bugs, blocks git commits while tests are red, and caps each failing assertion at three iterations before escalating to the Architect. ## Core Features & Use Cases - Structured Debugging Cycle: One hypothesis, one targeted fix, one verification per cycle — no shotgun changes or unrelated refactors. - TASK_BUDGET Enforcement: A strict 3-iteration cap per failing assertion, tracked as explicit state, with an AI_DEBUG_BUDGET override for exceptional cases. - LOCKED State Guardrails: Forbids git add and git commit until the full test suite passes, preventing broken code from entering history. - Automatic Escalation: On BUDGET_EXHAUSTED, formats a structured A2A query with all tried hypotheses and consults the Architect via advisor-mcp before continuing. - Use Case: A test suite fails after a refactor. The Skill runs the suite, isolates the failing assertion, walks through at most three distinct hypotheses, and either returns to green or escalates with full context instead of thrashing. ## Quick Start Ask the agent to debug the currently failing tests using the ai-debug skill and follow its hypothesis-driven cycle until the suite passes or the budget is exhausted.

Frequently Asked Questions about ai-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug failing tests without trial-and-error changes?▼

Use a structured hypothesis-test-observe loop: state one hypothesis, find the minimum reproduction, apply one targeted fix, then rerun the full suite. This Skill enforces exactly that cycle and forbids multiple simultaneous changes.

How does the 3-cycle debugging budget work?▼

Each failing assertion gets at most three iterations, each requiring a distinct hypothesis. If the assertion still fails at iteration three, the status becomes BUDGET_EXHAUSTED and the loop halts for escalation instead of starting a fourth cycle.

Can I commit code while tests are still failing?▼

No. While any test is red the Skill enters a LOCKED state where git add and git commit are forbidden. Commits are only allowed after the full test suite passes and the state becomes UNLOCKED.

Can I increase the debugging iteration limit?▼

Yes. Set AI_DEBUG_BUDGET to a higher number in the .claude/settings.json env block to raise the default 3-iteration cap for a given task.

What happens when the debugging budget is exhausted?▼

The Skill formats an A2A query listing the failing test, all tried hypotheses with outcomes, and the code under test, then calls the advisor-mcp ask_architect tool. It halts until the architect's ruling arrives rather than continuing to guess.

Why should shell helpers not set state inside pipelines or command substitution?▼

Command substitution, pipelines, and while-read loops run in subshells, so any variables, arrays, or traps the helper sets die when the subshell exits. The rule is that a helper either returns data on stdout or sets caller state, never both.