Sd hypothesis tree

From developzoneio/specwright · View interactive version

Sd hypothesis tree is an AI agent skill from the GitHub repository developzoneio/specwright. Structured hypothesis enumeration and verification for specwright debugging workflows.

How to use this skill

Skill file

sd-hypothesis-tree

Structured hypothesis enumeration and verification for specwright debugging workflows.

Used by sd-debugger in both bug investigation and perf hotspot analysis.


Enumeration protocol (`TASK = enumerate`)

Produce 4–8 ranked hypotheses. Fewer than 4 means at least one of the 5 models was not applied — go back.

The 5 mental models

Apply each model in sequence. For each, ask: "What hypothesis does this model suggest?"

| Model | What to probe |

|---|---|

| Boundary | Off-by-one, null handling, empty collections, max int, edge of valid range, time zones, locale, encoding. |

| State | Stale cache, dirty database row, partial write, in-memory state diverged from persisted, leftover from previous transaction. |

| Concurrency | Race condition, lock contention, double-execution, retry without idempotency, ordering assumption between async chains. |

| Recent changes | Diff vs working state at last green: which commits, deploys, config changes, dependency bumps fall in the suspect window? |

| Environment | Differs between prod and local: TLS, secrets, DNS, time, file-system case-sensitivity, container resource limits, OS, library versions. |

Per-hypothesis fields

Each hypothesis must have:

Output format

## Hypothesis tree (sd-debugger enumerate)

| # | Statement | Model | L | I | C | Score | Verification plan |
|---|---|---|---|---|---|---|---|
| H1 | <statement> | concurrency | 4 | 5 | 2 | 10.0 | grep for `Lock(` in PaymentHandler; read tests/concurrent/PaymentTests.cs |
| H2 | ... | ... | ... | ... | ... | ... | ... |

Rank rows by Score descending.


Verification protocol (`TASK = verify`)

Execute the verification plan for ONE hypothesis at a time. Produce a verdict.

Verdict format

### H<N> verification: <CONFIRMED|REJECTED|INCONCLUSIVE>

**Evidence**:
- `file:line` - <observation>
- `EVIDENCE_DIR/<artifact>` - <what it shows>

**Reasoning**: <2–4 sentences. For REJECTED: explain WHY evidence rules out this hypothesis — this is knowledge preservation.>

**Confidence**: <low | medium | high>

**Proximate vs root**: <For CONFIRMED only> Is this the root cause, or a symptom of a deeper cause? If the latter, name the next "why" to ask.

Proximate vs root — the "why" ladder

After CONFIRMING a hypothesis, ask "why" one more time. The ROOT must be: NAMED, FIXABLE, and explain why the test gap existed. If your "root" is just a deeper symptom, keep going.

Example:


Anti-patterns

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.