Diagnostic reasoning

From xD4O/praxis · View interactive version

Diagnostic reasoning is an AI agent skill from the GitHub repository xD4O/praxis. MANDATORY debugging protocol. You MUST invoke this skill when debugging complex issues, investigating failures, diagnosing intermittent problems, or performing root cause analysis. Do NOT start changing code before collecting observations. Do NOT guess at causes — generate 5 competing hypotheses and

How to use this skill

Skill file

Diagnostic Reasoning Protocol

EXTREMELY_IMPORTANT: This is a MANDATORY protocol, not a suggestion. Follow every step.

Do not skip steps. Do not combine steps. Do not summarize. Work through each gate in order.

Something is broken. Do NOT start changing code. Follow this protocol.

PHASE 1 — Observe precisely

Before forming any hypothesis, collect facts. Answer each:

Do NOT proceed until you can state the problem in one precise sentence that

another engineer could verify independently.

PHASE 2 — Generate competing hypotheses

Produce at least 5 hypotheses. Fewer and you are anchored on your first guess rather

than diagnosing. Add more if the observations genuinely suggest them; stop when new

candidates are restatements of ones you already have, not at a count.

For each hypothesis, state:

Order by: (explanatory power) × (prior probability), highest first.

Mandatory check: Is your #1 hypothesis the simplest explanation?

Simple causes first: config error, permissions, missing dependency, wrong

environment, typo. Check these before investigating race conditions,

memory corruption, or kernel bugs.

PHASE 3 — Design a discriminating test

Do NOT test hypotheses one by one. Design a single observation that

distinguishes between your top 3 hypotheses simultaneously.

Template: "If I observe [X], then hypothesis A is supported.

If I observe [Y], then hypothesis B is supported.

If I observe [Z], then hypothesis C is supported."

This is Strong Inference. One test, maximum information.

If no single test distinguishes all three, design the test that eliminates

the most hypotheses regardless of outcome (maximum information gain).

PHASE 4 — Execute and update

Run the test. Observe the result.

Update your hypothesis ranking. If the top hypothesis is now >80% likely,

proceed to verification. If not, return to Phase 3 with the surviving

hypotheses.

PHASE 5 — Root cause drilling

You found WHAT is broken. Now find WHY.

Ask "Why?" five times minimum:

  1. Why did [the immediate failure] happen?
  2. Why did [the cause from #1] happen?
  3. Why did [the cause from #2] happen?
  4. Why did [the cause from #3] happen?
  5. Why did [the cause from #4] happen?

Stop when you reach a systemic cause (process, tooling, policy) rather than

an individual cause (person made a mistake). Fix the systemic cause.

PHASE 6 — Verify the fix

After applying the fix:

<HARD-GATE>

Do NOT declare an issue fixed until:

Red flags that this skill catches:

</HARD-GATE>

Superpowers handoff

After root cause is identified and fix is designed:

If Superpowers is installed → invoke Skill(superpowers:systematic-debugging) or

Skill(superpowers:test-driven-development) to implement the fix. Pass your ranked

hypotheses, discriminating test results, and root cause analysis. The fix should be

implemented via TDD: write a test that reproduces the root cause, verify it fails,

then fix. Do NOT write the fix inside this skill. PRAXIS diagnosed. Superpowers fixes.

If Superpowers is NOT installed → implement the fix yourself, following TDD principles

where possible.

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.