Skip to content

Recipes

m4bwav edited this page Nov 21, 2026 · 1 revision

Each recipe runs on fixtures in the repository, from the plugin root.

Find a flaky test

python scripts/tw.py run evals/fixtures/flaky --reruns 2

The fixture fails at random. A test that fails and then passes on a rerun is printed as FLAKY name after the summary and counted as neither passed nor failed. When nothing fails on the first run there is no rerun. On the run for this wiki every test passed first time:

junit: 2 tests, 2 passed, 0 failed, 0 skipped, 0.0s

The skill reports a flaky test as a bug, never as a pass, and never raises retries to hide it.

One summary from mixed runners

For a repo with .NET and Jest tests, run each suite, then:

python scripts/tw.py parse TestResults/*.trx tw-results.json

Not run for this wiki (no such repo); Commands shows a mixed parse on the fixtures.

Slowest tests across a CI run

python scripts/tw.py slow tests/fixtures/junit.xml tests/fixtures/nunit.xml --top 3
    2.000s  Game.Spawn
    0.300s  test_a.test_bad
    0.250s  Game.SaveRoundTrip

Machine-readable output for another tool

python scripts/tw.py plan evals/fixtures/shop --json
python scripts/tw.py lint tests --json

Each prints one JSON array. plan rows have file, score, risks, has_test and lines; lint rows have file, line and finding.

Pin legacy code before a refactor

evals/fixtures/legacy/pricing.py has no tests, and detect finds nothing to run there:

python scripts/tw.py detect evals/fixtures/legacy
[]

The skill writes characterization tests first (Verify, syrupy or snapshots) that record what the code does now, then changes it. Seams, sprout and wrap are in legacy.md.

Clone this wiki locally