/doe:taguchi [factor=level1/level2 ...]from doe
Plans minimal debugging or testing runs using Taguchi orthogonal arrays when 3+ independent factors make brute-force expensive. Replaces one-factor-at-a-time with designed experiments covering all pairwise factor-level combinations.
Ships in doe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Replace one-factor-at-a-time debugging with a designed experiment. An orthogonal array covers every pair of factor levels in a handful of runs, so any behavior caused by one factor or by a two-factor interaction is guaranteed to show up in at least one run. 11 binary factors need 12 runs instead of 2048.
Every run changes several factors at once. That feels wrong to debugging intuition — resist the urge to "change only one thing". The analysis is column-wise (compare all runs where factor X was at level 1 vs level 2), not row-wise, and the balance of the array is what makes that comparison fair.
Confirm all of these before proceeding; otherwise use the cheaper tool and say so:
design.py prints the ratio and says so.Sibling skills cover the neighboring shapes: an expected single culprit among many boolean toggles → shrink; level counts that fit no array below → pairwise; optimizing knobs rather than hunting a culprit → tune.
Build the factor table with the user (or from the debugging context). Force every factor to 2 or 3 discrete levels:
Smallest array that fits all factors:
| Factors | Array | Runs | Full factorial would be |
|---|---|---|---|
| ≤3 × 2-level | L4 | 4 | 8 |
| ≤7 × 2-level | L8 | 8 | 128 |
| ≤4 × 3-level | L9 | 9 | 81 |
| ≤11 × 2-level | L12 | 12 | 2048 |
| 1 × 2-level + ≤7 × 3-level | L18 | 18 | 4374 |
Mixed 2- and 3-level factors: dummy treatment — a 2-level factor sits in a 3-level column with level 3 repeating level 1 (coverage holds, the repeated level just gets more runs). Its level means stay unbiased but rest on unequal run counts, so its Δ is noisier than the rest of the table — rank a dummy-treated factor against the others only when its effect clears the noise floor by a margin. Up to 4 factors total fit L9 this way at 9 runs; bigger mixes take L18. Extra columns beyond your factor count are simply left unassigned. Level counts that fit none of these shapes (a 4-level factor, uneven mixes) → the pairwise skill generates a covering array for arbitrary levels.
Do not assemble the sheet by hand. scripts/design.py picks the array, assigns the columns, applies the dummy treatment and prints the run sheet with concrete values:
python3 scripts/design.py "os=ubuntu,macos" "node=18,20" "lockfile=frozen,fresh"
python3 scripts/design.py "gc=on,off" "pool=8,16,32" "batch=1,10,100" --json
These tables are pairwise-balanced, and scripts/arrays.py re-checks that at import — a transposed digit raises instead of silently destroying the balance the analysis relies on. They are printed here to be read, not to be retyped: transcribing an L12 by hand is exactly the step the script exists to remove.
run A B C
1 1 1 1
2 1 2 2
3 2 1 2
4 2 2 1
run A B C D E F G
1 1 1 1 1 1 1 1
2 1 1 1 2 2 2 2
3 1 2 2 1 1 2 2
4 1 2 2 2 2 1 1
5 2 1 2 1 2 1 2
6 2 1 2 2 1 2 1
7 2 2 1 1 2 2 1
8 2 2 1 2 1 1 2
run A B C D
1 1 1 1 1
2 1 2 2 2
3 1 3 3 3
4 2 1 2 3
5 2 2 3 1
6 2 3 1 2
7 3 1 3 2
8 3 2 1 3
9 3 3 2 1
run A B C D E F G H I J K
1 1 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 2 2 2 2 2 2
3 1 1 2 2 2 1 1 1 2 2 2
4 1 2 1 2 2 1 2 2 1 1 2
5 1 2 2 1 2 2 1 2 1 2 1
6 1 2 2 2 1 2 2 1 2 1 1
7 2 1 2 2 1 1 2 2 1 2 1
8 2 1 2 1 2 2 2 1 1 1 2
9 2 1 1 2 2 2 1 2 2 1 1
10 2 2 2 1 1 1 1 2 2 1 2
11 2 2 1 2 1 2 1 1 1 2 2
12 2 2 1 1 2 1 2 1 2 2 1
run A B C D E F G H
1 1 1 1 1 1 1 1 1
2 1 1 2 2 2 2 2 2
3 1 1 3 3 3 3 3 3
4 1 2 1 1 2 2 3 3
5 1 2 2 2 3 3 1 1
6 1 2 3 3 1 1 2 2
7 1 3 1 2 1 3 2 3
8 1 3 2 3 2 1 3 1
9 1 3 3 1 3 2 1 2
10 2 1 1 3 3 2 2 1
11 2 1 2 1 1 3 3 2
12 2 1 3 2 2 1 1 3
13 2 2 1 2 3 1 3 2
14 2 2 2 3 1 2 1 3
15 2 2 3 1 2 3 2 1
16 2 3 1 3 2 3 1 2
17 2 3 2 1 3 1 2 3
18 2 3 3 2 1 2 3 1
Assign each factor to a column and render the plan with concrete values, not level numbers:
| Run | OS | Node | Lockfile | Result |
|---|---|---|---|---|
| 1 | ubuntu | 18 | frozen | |
| 2 | ubuntu | 20 | fresh | |
| 3 | macos | 18 | fresh | |
| 4 | macos | 20 | frozen |
Open the journal before the first run. An array is 8-18 CI round-trips — hours or days, and more than one session; a plan that lives only in the chat is gone by the time the last row lands:
python3 scripts/experiment.py new "flaky lockfile" \
--factor "os=ubuntu,macos" --factor "node=18,20" --factor "cache=warm,cold" \
--repeats 2 --hypothesis "the fresh lockfile only breaks on node 18"
It designs the array, writes .doe/<slug>.json, and prints the sheet. show re-prints the state and what is still open, record <slug> --run 3 --result fail --covariate region=eu files an outcome, csv <slug> emits the file analyze.py reads, close <slug> --verdict ... ends it. A session that finds an open experiment resumes it instead of designing a new one — experiment.py list.
When a run is a command rather than a human errand, execute the sheet instead of shepherding it:
python3 scripts/run.py flaky-lockfile --cmd 'make test OS={os} NODE={node} CACHE={cache}'
python3 scripts/run.py latency --cmd './bench --pool {pool}' --metric 'p95=([0-9.]+)' --randomize
Exit code is the outcome unless --metric names a regex whose first group is a number. Repeats sweep the whole array rather than one row at a time, --randomize shuffles each sweep against environment drift, every result is written to the journal the moment it lands, and each run's output is kept under .doe/<slug>-logs/.
Two baseline runs before the array, always. All factors at their known-good levels must pass; all at their suspected-bad levels must fail. A failing good-baseline means the difference lives outside the factor list; a passing bad-baseline means the levels are not extreme enough or the repro needs repeats. Either way the array is about to be spent on a phantom — the shrink skill makes the same two runs mandatory for the same reason, and an array costs more than a bisection does. Record them with experiment.py baseline <slug> --good pass --bad fail; run.py refuses to execute a sheet whose baselines are missing.
Execution notes:
One outcome per run: binary (fail/pass) or numeric (latency, RSS, error count). For flaky repros with repeats, record the failure count per row.
Prefer a numeric outcome over binary whenever one exists (latency, retry count, time-to-first-error): a continuous response discriminates levels in a single pass of the array, while a binary one pays the ×N repetition tax from step 3. Record the covariates from step 1 alongside the outcome of every run.
Feed the finished sheet to scripts/analyze.py rather than averaging by hand — one CSV row per run, the factor columns from the sheet, a result column (numeric, or pass/fail), result_1..n for repeats, covariates in their own columns, prefixed cov_ so they are never ranked as factors. experiment.py csv emits exactly that shape. A binary outcome may be spelled pass/fail, ok/bad, true/false or 1/0 — the digits are the booleans, so 0 is a failure in every spelling, and a sheet mixing spellings reads the same either way. A measurement that happens to take only the values 0 and 1 (an error count, say) is indistinguishable from that, so pass --outcome-type numeric when the zeros are the good runs. cov_ is reserved: a factor cannot be named with it, because the results CSV reads that prefix as a covariate:
python3 scripts/experiment.py csv flaky-lockfile > results.csv
python3 scripts/analyze.py results.csv --covariate region
It prints the table below, ranks the factors, scores each one with a permutation test, computes the noise floor from the repeats, and flags the two outcomes that end the experiment early:
analyze.py ranks them that way before touching the survivors. But the survivors are no longer a balanced array, so the level means among them are a lead at best. Pull the failing levels out of the ranges and run a tightened array (run.py --metric-missing fail records such a row instead of stopping).For each factor, average the outcome over all runs at each level — the array's balance guarantees every other factor contributed equally to both sides:
| Factor | Level 1 mean | Level 2 mean | Effect (Δ) |
|---|---|---|---|
| OS | 0/2 fail | 2/2 fail | 1.00 |
| Node | 1/2 fail | 1/2 fail | 0.00 |
| Lockfile | 1/2 fail | 1/2 fail | 0.00 |
With repeats, establish the noise floor before ranking: the typical spread between repeats of the same row. A Δ below that spread separates nothing — the factor stays unranked until more repeats say otherwise.
Rank factors by Δ. Reading the verdict:
analyze.py prints that expectation next to a permutation p per factor — use them to rank suspects, never to convict one.Before believing a clean split, check the recorded covariates: one that tracks the outcome is both a suspect in its own right and a hole in the balance the array guarantees only for assigned columns. A covariate implicated this way graduates to a real factor — find a way to set it and rerun.
The analysis produces a hypothesis, not a verdict. Run two extra configurations before declaring root cause:
If either run contradicts the prediction, the effect is an interaction — go to step 7. A main-effects table alone is never sufficient proof of root cause.
Orthogonal arrays confound interactions with main effects — that is the price of the run savings. When the signal is not clean, two exits:
If it is still muddy after that, the factor list is missing the real variable — go back to step 1 rather than adding runs.
scripts/analyze.py (opens in a new tab)scripts/arrays.py (opens in a new tab)scripts/design.py (opens in a new tab)scripts/experiment.py (opens in a new tab)scripts/run.py (opens in a new tab)scripts/test_analyze.py (opens in a new tab)scripts/test_design.py (opens in a new tab)scripts/test_experiment.py (opens in a new tab)scripts/test_run.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/pairwiseGenerate a minimal pairwise covering array for factors with arbitrary mixed level counts, using the bundled deterministic generator. TRIGGER — invoke when a debugging or testing plan has 3+ independent factors whose level counts do not fit the fixed taguchi arrays (a 4-level factor, a 5-value enum, uneven mixes like 4x3x2x2) and each run is expensive. DO NOT TRIGGER when every factor has 2-3 levels (use the taguchi skill - balanced arrays support effect ranking), for a single factor (bisect it), or when runs are cheap enough to brute-force the full factorial./shrinkFind the guilty few among many boolean suspects with group testing (split-half, delta debugging) instead of toggling one thing at a time. TRIGGER — invoke when 8+ independently toggleable suspects (feature flags, config lines, env-var deltas, patches, plugins, extensions, imports) hide an expected single culprit or small set and each run is expensive; the moment the plan looks like "disable them one by one" this replaces it. DO NOT TRIGGER for ranking several contributing factors (use the taguchi skill), for ordered history (git bisect does this natively), for suspects that cannot be toggled independently, or for cheap runs./tuneOptimize a numeric outcome (latency, throughput, memory, cost) over 3+ knobs with a Taguchi designed experiment and S/N-ratio analysis instead of tweaking one knob at a time. TRIGGER — invoke when the task is picking values for several potentially interacting knobs (resource limits, timeouts, pool sizes, batch sizes, kernel or runtime parameters) and each measurement is expensive. DO NOT TRIGGER for finding the culprit behind a failure (use the taguchi or shrink skills), for a single knob (sweep it), or for measurements cheap enough to grid-search.npx claudepluginhub lexfrei/ccc --plugin doeOther plugins' skills for the same job