Debug protocol

From yanacuti1121/Yana-AI · View interactive version

Debug protocol is an AI agent skill from the GitHub repository yanacuti1121/Yana-AI. Use when encountering any bug, error, test failure, or unexpected behavior — before proposing any fix. Triggers on: seeing an error message, a failing test, 'it's broken', 'not working', 'weird behavior'. Works alongside the /debug command.

How to use this skill

Skill file

Debug Protocol Skill

Random fixes create new bugs. This skill enforces root-cause investigation before fixes.

Relationship with /debug command: /debug creates a structured debug document and

runs multi-phase investigation. This skill is the lightweight auto-trigger version —

it fires before you touch any code and ensures the four phases are followed.

For complex bugs, use /debug to create the full document.

The Rule

NO FIX WITHOUT A WRITTEN ROOT CAUSE AND FALSIFICATION TEST.

If you cannot write a falsification test, you don't have a hypothesis — you have a guess.

When to use this skill

The Four Phases

Phase 1 — Reproduce and locate (before any fix)

# 1. What does git say changed recently?
git log --oneline -5

# 2. Can you reproduce the error consistently?
# Run the failing command again — show the exact error

# 3. Where in the code does it fail?
# Read the stack trace. Note the file:line.

Write down:

Phase 2 — Form a hypothesis

Write ONE hypothesis:

"I think [specific thing] is wrong because [evidence].
Falsification test: if I [run this command/check this value], I should see [X] if wrong."

Do not propose a fix yet.

Phase 3 — Test the hypothesis (smallest possible change)

Run the falsification test. Show the output.

Phase 4 — Fix and verify

Only after root cause is confirmed:

  1. Describe the fix in one sentence before coding it
  2. Make the smallest possible change
  3. Run the failing test again — show it passes
  4. Run the full test suite — show no regression

Constraints

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.