Skip to content

28 eval-informed mental models and critical-thinking skills for Claude Code, GitHub Copilot, Codex, Cursor, and other Agent Skills-compatible tools

feat(scientific-method): ship hypothesis-differential debugging, retire v2 prototype

Travis Boudreaux4a176d9f4d92
diff --git a/skills/thinking-scientific-method-v2/SKILL.md b/skills/thinking-scientific-method-v2/SKILL.md
deleted file mode 100644
index f944a3b..0000000
--- a/skills/thinking-scientific-method-v2/SKILL.md
+++ /dev/null
@@ -1,42 +0,0 @@
----
-name: thinking-scientific-method-v2
-description: Localize a bug by ranking falsifiable hypotheses by likelihood×cheapness-to-check and testing the cheapest discriminating one first. Use when a symptom could have several causes and you must find the faulty code.
----
-
-# Hypothesis-Differential Debugging (reworked)
-
-Agent-native rewrite of the scientific method, scoped to its native domain — finding the faulty code behind a symptom. The original's value was buried under observe→question narration and human-only "run a canary / A/B test" steps an agent can't execute. This version is just the differential.
-
-**Core principle:** Don't guess-and-patch and don't narrate. Enumerate competing causes, then spend your cheapest observation on the one that best discriminates between them.
-
-## When to Use
-- A bug/incident symptom could plausibly come from more than one place.
-- You have read access to the code, logs, diffs, and tests but cannot run expensive experiments.
-
-## When NOT to use (stop conditions)
-- The cause is already obvious from a single trace or the recent diff → just fix it; skip the differential.
-- Only one plausible hypothesis exists → test it directly.
-- You cannot make any observation (no code/log access) → gather access first; don't speculate.
-
-## The procedure
-1. **Enumerate 3–5 falsifiable hypotheses** for where the fault lives (be specific: a file/function/condition, not "something in the backend"). If you can only think of one, you're guessing — force alternatives.
-2. **For each hypothesis, name the *cheapest discriminating observation* available to a code-reading agent** — e.g. "read `auth/session.py:refresh`", "grep for callers of `parse_token`", "check the error in the eu-west log line", "diff the function the issue's stack trace points to". NOT "deploy a canary" or "run a 2-week A/B test."
-3. **Rank by likelihood × cheapness** and make the top observation first.
-4. **State what result would falsify each hypothesis** before you look, so the observation actually updates you instead of confirming a prior.
-5. **Stop** when one hypothesis is confirmed by direct evidence AND the others are ruled out — then name the file/function to change. Do not keep narrating once the fault is located.
-
-## Anti-patterns
-- Narrating "Observe → Question → Hypothesize" without ever proposing competing causes.
-- Proposing a "test" the agent cannot run (canary, A/B, load test) — the test must be an observation you can actually make now.
-- Confirmation: looking only for evidence that supports your first guess.
-
-## Worked shape (fault localization)
-```
-Symptom: intermittent 500s on /export, only eu-west, started 3 days ago.
-Hypotheses (ranked by likelihood×cheapness):
- H1 recent diff to export serializer (grep last 3-day commits touching export*) — cheap, high prior
- H2 eu-west Redis rotation 4 days ago broke a cache key (read cache client config) — cheap, region-specific fits
- H3 upstream timeout under load (would need traffic — expensive, defer)
-Falsifier: if H1's diff doesn't touch the failing codepath, drop it.
-→ Observe H1 then H2; name the file the evidence implicates.
-```
diff --git a/skills/thinking-scientific-method/SKILL.md b/skills/thinking-scientific-method/SKILL.md
index fc542bd..8db9cdd 100644
--- a/skills/thinking-scientific-method/SKILL.md
+++ b/skills/thinking-scientific-method/SKILL.md
@@ -1,107 +1,162 @@
---
name: thinking-scientific-method
-description: Use when a symptom could have several causes and you must find the faulty one—enumerate falsifiable hypotheses, rank by likelihood×cheapness-to-check, test the cheapest discriminating one first.
+description: Use when a symptom could have several causes and you must find the faulty code by ranking falsifiable hypotheses and checking the cheapest discriminating observation first.
---
-# Scientific Method (evidence-ranked differential)
-
-> A reworked, agent-native version of this skill lives at `thinking-scientific-method-v2` (Hypothesis-Differential Debugging). This file is aligned to that approach. If you only need the lean procedure, use v2; the material below adds the falsification discipline behind it.
+# Hypothesis-Differential Debugging
## Overview
-The scientific method's payoff for an agent is not narrating "observe → question." It is the **differential**: when a symptom could come from several places, enumerate competing falsifiable hypotheses and spend your cheapest observation on the one that best discriminates between them. A good hypothesis is one you could prove **wrong**.
+The scientific method's payoff for an agent is not narrating "observe -> question." It is the **differential**: when a symptom could come from several places, enumerate competing falsifiable hypotheses and spend your cheapest observation on the one that best discriminates between them.
+
+This is the proven replacement for the old broad scientific-method skill. In SWE-bench fault localization, the original was flat; this agent-native version turned it into the strongest measured debugging lift in the current eval set.
**Core Principle:** Don't guess-and-patch. Enumerate competing causes, then make the cheapest observation that would falsify the most likely one.
## When to Use
-- A bug/incident symptom could plausibly come from more than one place
-- Performance investigation with several candidate causes
-- Root-cause analysis where you have read access to code, logs, diffs, and tests
+- A bug or incident symptom could plausibly come from more than one place
+- You have read access to code, logs, diffs, traces, or tests
+- You need to localize the faulty file, function, branch, config, or invariant before fixing
```
-Investigating a symptom?
- → Could it have more than one cause? → no → just test/fix the one cause
- → Can you list 3–5 falsifiable causes? → no → you're guessing—force alternatives
- → Have you named what would FALSIFY each?→ no → do that before observing
+Symptom has several plausible causes?
+ -> no -> test or fix the obvious cause directly
+ -> yes -> can you make cheap observations now?
+ -> no -> gather access/evidence first
+ -> yes -> apply hypothesis-differential debugging
```
## When NOT to Use
-- The cause is already obvious from one trace or the recent diff → just fix it; skip the differential.
-- Only one plausible hypothesis exists → test it directly.
-- You can't make any observation (no code/log access) → get access first; don't speculate.
-- You're tempted to design an A/B test, canary, or multi-week experiment → you (an agent) can't run those. The "test" must be an observation you can make **now** (read a file, grep callers, inspect a log line, diff a function).
+- The cause is already obvious from a single trace, failing test, or recent diff -> fix directly.
+- Only one plausible hypothesis exists -> test it directly.
+- You cannot make any observation -> get access first; don't speculate.
+- You are designing an A/B test, canary, or multi-week experiment -> this skill is for observations an agent can make now.
## The Procedure
-1. **Enumerate 3–5 falsifiable hypotheses** for where the fault lives. Be specific—a file/function/condition, not "something in the backend." If you can only think of one, you're guessing; force alternatives.
-2. **For each, name the cheapest discriminating observation** a code-reading agent can actually make: read `auth/session.py:refresh`, grep callers of `parse_token`, check the error on the eu-west log line, diff the function the stack trace points to. Not "deploy a canary."
-3. **Rank by likelihood × cheapness** and make the top observation first.
-4. **State what result would falsify each hypothesis** *before* you look, so the observation updates you instead of confirming a prior.
-5. **Stop** when one hypothesis is confirmed by direct evidence AND the others are ruled out. Name the file/function to change. Stop narrating once the fault is located.
+### Step 1: Enumerate competing hypotheses
-## Worked Shape (fault localization)
+List 3-5 specific, falsifiable hypotheses. Name the likely file, function, subsystem, input condition, or invariant. Avoid vague buckets like "backend issue" or "race condition somewhere."
+```markdown
+| # | Hypothesis | Why plausible? |
+|---|------------|----------------|
+| H1 | `auth/session.py:refresh` drops rotated tokens | failures start after token rotation |
+| H2 | cache TTL mismatch in `session_cache` | stale sessions persist across deploys |
+| H3 | frontend retries reuse expired cookie | only browser flow is affected |
```
-Symptom: intermittent 500s on /export, only eu-west, started 3 days ago.
-Hypotheses (ranked by likelihood × cheapness):
- H1 recent diff to the export serializer
- → cheap: grep last 3-day commits touching export* | high prior
- H2 eu-west Redis rotation 4 days ago broke a cache key
- → cheap: read the cache client config | region fits
- H3 upstream timeout under load
- → expensive: would need live traffic | defer
+If you can only think of one hypothesis, you are guessing. Force alternatives before inspecting deeper.
+
+### Step 2: Name the cheapest discriminating observation
+
+For each hypothesis, name one observation you can make now that would separate it from the others.
-Falsifier set before looking:
- if H1's diff doesn't touch the failing codepath → drop H1
- if the cache key resolves fine in eu-west → drop H2
+Good observations:
+- read the function the stack trace names
+- grep callers of a parser or config key
+- inspect the recent diff touching the failing path
+- compare two log lines across working and broken cases
+- check a test fixture or schema invariant
-→ Observe H1, then H2. Name the implicated file.
+Bad observations:
+- deploy a canary
+- run a long experiment
+- ask users to wait
+- inspect every file in the subsystem
+
+### Step 3: State falsifiers before looking
+
+For each hypothesis, write what result would make you drop it. This prevents confirmation search.
+
+```markdown
+| Hypothesis | Falsified if... |
+|------------|-----------------|
+| H1 token refresh | refresh path never reads rotated token state |
+| H2 cache TTL | cache entry expires before the observed stale window |
+| H3 frontend retry | same failure occurs in API-only reproduction |
```
-## Multi-Hypothesis Debugging Table
+### Step 4: Rank by likelihood x cheapness
+
+Test the observation with the best expected information per unit of effort. Start with the cheapest observation that separates your top hypotheses, not the most elaborate investigation.
+
+```
+For each hypothesis → name falsifier → rank by likelihood x cheapness → observe → update/drop → localize fault
+```
+
+### Step 5: Stop on direct localization
+
+Stop when one hypothesis is supported by direct evidence and the key alternatives are ruled out. Name the file/function/config to change and the evidence that localizes it.
+
+## Investigation Template
+
+```markdown
+## Symptom
+[Specific failing behavior, scope, timing, and known constraints]
+
+## Hypotheses
+| # | Hypothesis | Why plausible? | Cheapest observation | Falsified if... |
+|---|------------|----------------|----------------------|-----------------|
+| H1 | [specific file/function/config cause] | [evidence] | [read/grep/diff/check] | [drop condition] |
+| H2 | [specific alternate cause] | [evidence] | [read/grep/diff/check] | [drop condition] |
+| H3 | [specific alternate cause] | [evidence] | [read/grep/diff/check] | [drop condition] |
+
+## Test Order
+1. [Cheapest discriminating observation]
+2. [Next observation if H1 is falsified]
+3. [Deferred only if cheap observations do not localize]
+
+## Localization
+[Supported hypothesis, ruled-out alternatives, and the file/function/config to change]
+```
-When the cause is genuinely ambiguous, lay it out and test in order of (cheapness × likelihood):
+## Worked Shape
```markdown
-## Bug: users sometimes see stale data
-
-| # | Hypothesis | Discriminating observation (now) | Falsified if… |
-|---|------------|----------------------------------|---------------|
-| 1 | CDN serving old content | check CDN cache-status headers | timestamps are fresh |
-| 2 | Browser caching | force-refresh in repro | stale persists after refresh |
-| 3 | Read-replica lag | correlate report times with lag metric | no correlation |
-| 4 | Cache not invalidating | inspect invalidation path in code | invalidation fires correctly |
-
-Test order: 1, 2 (cheapest), then 3, 4.
-Result: 1 ruled out (fresh), 2 ruled out (stale after refresh),
- 3 strong correlation with lag spikes → SUPPORTED. Cause: replica lag.
+Symptom: intermittent 500s on /export, only eu-west, started three days ago.
+
+Hypotheses:
+1. recent diff to export serializer
+ Observation: inspect commits touching `export_serializer`
+ Falsified if: no diff touches the failing codepath
+2. eu-west Redis rotation broke a cache key
+ Observation: read cache key construction + region config
+ Falsified if: key and TTL match healthy regions
+3. upstream timeout under load
+ Observation: compare timeout logs during failure window
+ Falsified if: no upstream latency spike
+
+Test order: H1, H2, H3.
+Result: H1 diff changed nested export handling and matches stack trace.
+Localized fault: `app/export/serializer.py`.
```
## Anti-Patterns
-- Narrating "Observe → Question → Hypothesize" without ever proposing **competing** causes.
-- Proposing a "test" you can't run (A/B, canary, load test). The test must be an observation available now.
-- Confirmation: looking only for evidence that supports your first guess. State the falsifier first.
-- Diving into speculation past the evidence—if you have no observation for a hypothesis, mark it deferred, don't assert it.
+- Narrating the scientific method without proposing competing causes
+- Looking only for evidence that supports your first guess
+- Calling an expensive experiment a "test" when a cheap observation exists
+- Stopping at a plausible explanation before ruling out alternatives
+- Continuing to analyze after the faulty file/function is localized
## Verification Checklist
-- [ ] Listed 3–5 specific, falsifiable hypotheses (not one)
-- [ ] Each has a discriminating observation you can make now
-- [ ] Stated the falsifier for each before observing
-- [ ] Ranked by likelihood × cheapness; tested the cheapest discriminating one first
-- [ ] Stopped when one was confirmed and the rest ruled out; named the file/function
+- [ ] Listed 3-5 specific hypotheses
+- [ ] Each hypothesis has a cheap observation available now
+- [ ] Each hypothesis has a stated falsifier
+- [ ] Observations are ranked by likelihood x cheapness
+- [ ] Final answer names the localized file/function/config and the evidence
## Key Questions
-- "What would I see if this hypothesis were FALSE?"
-- "Which single observation best separates my top two hypotheses?"
-- "Am I testing my hypothesis, or confirming my first guess?"
-- "Is this a 'test' I can actually run as an agent right now?"
+- What would I see if this hypothesis were false?
+- Which observation best separates the top two hypotheses?
+- Am I testing a hypothesis or confirming my first guess?
+- Can I localize the fault with a cheaper observation?
## Feynman's Wisdom
-"The first principle is that you must not fool yourself—and you are the easiest person to fool." Your intuition generates hypotheses; the differential tests them ruthlessly. When the evidence disagrees with your expectation, the evidence wins.
+"The first principle is that you must not fool yourself - and you are the easiest person to fool." Your intuition generates hypotheses; the differential tests them.