Catalogue / testwright
testwright
MITSignedTest any code in any language or stack, any kind of test: unit, integration, end-to-end, API, property-based, mutation, snapshot and visual, performance, data and pipeline, game, manual and exploratory. Plan tests by risk, run a suite into one summary (failures, flaky reruns, slow tests, changed-lin…--- name: testwright description: "Test any code in any language or stack, any kind of test: unit, integration, end-to-end, API, property-based, mutation, snapshot and visual, performance, data and pipeline, game, manual and exploratory. Plan tests by risk, run a suite into one summary (failures, flaky reruns, slow tests, changed-line coverage), judge suite quality (mutation, assertions that never fail, tests of mocks), pin legacy code with characterization tests, test games. Knows .NET, Unity, TypeScript/npm, Python and Roblox Luau so far and adds a reference for each new stack it meets. Use on 'what should I test', 'write tests for this', 'run the tests and tell me what failed', 'is this test flaky', 'are my tests any good', 'coverage on my diff', 'add tests before I refactor this', 'test my Go service', 'test my Unity game'. Not for skill evals (evergreen-test)." license: MIT metadata: version: 0.1.5 ---
testwright
Outcome: tests that would fail if the code broke, aimed at what costs most when it breaks, with every claim about the suite backed by a run.
Scope: all testing, in any language and stack, of any kind. The method (risk-first planning, suite quality, characterization of legacy code) applies everywhere; stack references hold what was learned per stack. .NET, Unity, TypeScript/npm, Python and Roblox Luau are the first stacks, not the limit.
TW means python scripts/tw.py from the plugin root (run it, do not read it). Standard library only; --json gives one JSON object.
1. Plan by risk, not by coverage
TW plan <repo>ranks source files by risk (money, saves, deletes, auth, migrations, parsing, public API) and doubles the score of files with no test. Read the top ten, not the whole repo.- For each risky unit write the failure you fear in one line ("a save from 1.2 loads with no inventory"), then the smallest test that catches it. Edge cases first: empty, one, many, boundary, bad input, concurrency.
- Skip tests for getters, framework glue and generated code. A coverage percentage is never the goal; changed-line coverage (section 3) is the check.
2. Run and read
TW detect <repo>names the stack and runner. Load only that stack's reference: dotnet, unity, js, python, luau.unknownmeans a new stack: see section 7.TW run <repo> --reruns 2runs dotnet, Vitest/Jest or pytest with report flags and prints failures, flaky tests (failed, then passed on rerun) and totals. Unity and Luau run by the commands in their reference; thenTW parse <results files>.TW slow <results> --top 10lists the slowest tests.
Performance regressions: have a scripted run (nightly, or a gate before merge) write one metrics JSON ({"label": "2026-11-22", "frame_ms_p95": 15.2, "chunk_load_ms": 38, "avg_fps": 61}; lower is better unless a name ends _fps or _per_sec). TW perf run.json --golden perf/golden.json --history perf/history.jsonl writes the golden on first use, then flags metrics past --tolerance (default 10%) and appends a line per run, so day-over-day drift shows. Re-baseline only on purpose with --bless. Start this on day one of a game.
- Report failures with file, test name and first message line. A flaky test is a bug to report, never a pass; do not raise retries to hide it.
3. Coverage on the change
TW changed <coverage.xml|lcov.info> --base origin/main gives covered and missed changed lines (diff-cover when installed, else git diff plus the coverage file). "No changed lines" usually means coverage paths do not match repo paths; fix the paths, never report 100%.
4. Are the tests any good
TW lint <tests dir>flags assertions that can never fail (assert True,Assert.True(true), a value compared with itself), tests with no assertion, and tests that assert only on mocks.- Mutation testing on changed code proves the tests catch breakage: quality has Stryker.NET, StrykerJS and mutmut. Unity and Luau have no tool: make three to five hand mutants (flip a comparison, drop a call, off by one) in a worktree and confirm a test fails for each.
TW crap <src> --coverage coverage.jsonranks Python functions by CRAP (complexity times missing coverage; over 30 is complex and under-tested, test or split those first);TW dupes <src>lists near-duplicate functions worth one shared helper.- Before claiming a new test works, break the code it covers once and watch it fail.
5. Legacy code without tests
Pin behaviour before changing it: characterization tests record what the code does now (Verify, syrupy, snapshots), then change. Seams, sprout and wrap: legacy.
6. Games
Play-mode tests, simulated input, seed replays, save/load round trips with old save fixtures, bot playthroughs that fail on errors or softlocks, TW model to walk every state of a declared flow table for deadlocks and broken rules: games. Failing bot logs go to logwright (lgw.py query); proposed work goes to grindwright, never written into its ledger from here.
7. A new stack
TW detectsaysunknown, or names nothing for the language you see.- Check
references/for that stack. If missing, research from primary docs its usual runner, how to get a machine-readable report (JUnit XML is the common target, whichTW parsereads), and its coverage and mutation tools. - Write
references/<stack>.mdin the shape of the others (run command, report flags, coverage, mutation, gotchas) and add a LEARNINGS line naming the stack. Teachdetectthe marker file when it is cheap. - Then carry on with sections 1 to 5 as usual.
Rules
- Test edits happen in a worktree and a PR, like any code change.
- Never weaken or delete a failing assertion to get green; fix the code or report it.
- Never skip or quarantine a test without saying so in the report.
- Browser end-to-end: drive Playwright (or the webapp-testing skill) under the same rules. Skill evals: evergreen-test.
Maintenance
Evergreen unit at the plugin root (evergreen.json, RESEARCH.md, LEARNINGS.md, CHANGELOG.md, TESTS.md). On 'refresh testwright', re-check the volatile claims in evergreen.json against primary docs, log changes in CHANGELOG and lessons in LEARNINGS, and rerun evals/evals.json.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 6.5 kB | 97394a30172b |
| SKILVAULT_SOURCE.json | 1.1 kB | e1085736c973 |
| THIRD_PARTY_NOTICES.md | 1.1 kB | df41f6bb69c8 |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 0.1.0 Current | 84c96c389325 | 29 Nov 2026 |
Locking a skill to one version needs Pro.