/testing:mutation-verify-render-testsfrom testing
Verify that "scene-capture" / pixel-analysis tests for a graphical renderer (pygame, canvas, matplotlib, headless GL, screenshot-diff) actually CATCH a broken render — by mutation testing. Use when: (1) you've written or received tests that render a frame headlessly and assert properties of the pixels (e.g. "pitch is green", "HUD present", "sprites on screen"); (2) an agent reports "N scene tests passing" and you need to know if they're REAL or hollow; (3) a pixel/region assertion passes but you suspect it's satisfied by the wrong pixels (background, anti-aliasing, adjacent UI); (4) before trusting any image-correctness test as a guard. The core technique: temporarily break the renderer (stub the draw call) and confirm the test FAILS; then restore and confirm it PASSES. A scene test that passes when the thing it checks is removed is worthless.
Ships in testing. 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.
None: SKILL.md is the whole skill.
Tests that render a graphical frame and assert properties of the resulting pixels are easy to write so loosely that they pass no matter what. A green suite of "scene-capture" tests gives false confidence: the assertion may be satisfied by background pixels, UI chrome, anti-aliased line art, or an adjacent element — not the thing it claims to check.
A real example: a test asserted "goal nets are present" by counting white/grey pixels in
a screen region. It PASSED even after both _draw_goal_net() calls were stubbed out —
because the region also contained the pitch's white boundary lines, which satisfied the
count. The test verified nothing.
surface.get_at, pygame.surfarray, np on a screenshot) → assert color/region/cluster
properties.For each scene-capture test, prove it is REAL by breaking the renderer and confirming the test goes RED, then restoring and confirming GREEN. A test that can't fail isn't testing.
# 1. Back up the renderer (NOT the test).
cp path/to/renderer.py /tmp/r_backup.py
# 2. Stub the draw call for the feature the test checks (make it draw nothing).
# e.g. replace the helper invocation with `pass` / early return:
sed -i '' 's/ draw_goal_net(surface, sign)/ pass/' path/to/renderer.py
# 3. Run JUST that test — it MUST FAIL now.
uv run --no-sync pytest tests/test_scene.py::test_goal_nets -q # expect: 1 failed
# 4. Restore and confirm byte-identical + test passes again.
cp /tmp/r_backup.py path/to/renderer.py
diff -q path/to/renderer.py /tmp/r_backup.py # must be identical
uv run --no-sync pytest tests/test_scene.py::test_goal_nets -q # expect: 1 passed
Repeat for each feature: stub draw_players → player/cluster/perspective tests must fail;
stub draw_hud → HUD test must fail; recolor the pitch constant → pitch-green test must
fail; etc. Any test that stays GREEN through its mutation is a false positive — fix it.
NET_GREY ~(206,214,224): light, slightly blue, dimmer
than pure-white 238 lines) from the pitch lines via a range predicate is_net_mesh,
so the white boundary lines no longer satisfied it.The acceptance criterion for any scene-capture test is the pair:
Do this yourself — do not accept an agent's "it passes". Passing is half the proof; failing-when-it-should is the other half.
sed on the call site (fast, reversible) rather than editing logic; always
diff -q against the backup after restoring so a mutation never leaks into a commit.savefig + array asserts, headless WebGL) should be mutation-verified.What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/claude-workflow-tdd-harnessReusable Node.js harness for unit-testing Claude Code Workflow scripts
(the `Workflow` tool's `.js` files) with `node:test`. Use when: (1) you
need to test a Workflow script's args contract / phase order / per-agent
schema shape WITHOUT actually invoking the Workflow tool (which spawns
real agents, costs tokens, is slow, and is only available in the parent
session); (2) `node --test` rejects the file with `SyntaxError:
Unexpected token 'export'` or `Illegal return statement` because the
script uses top-level `await`, top-level `return`, and injected globals
(`agent`, `phase`, `log`, `budget`, `parallel`, `pipeline`, `workflow`);
(3) you want a per-label mock-agent dispatch pattern so each `agent()`
call can return a different shape; (4) you want budget-gate /
short-circuit / phase-order tests to land before any live Workflow call.
Ships a ~110-line ESM harness (no deps) that strips `export const
meta = {...}` via brace-counting, wraps the body in `AsyncFunction`,
injects configurable mocks for all Workflow globals.
/streamlit-ui-visual-verificationVerify Streamlit dashboard changes by opening a real browser — not just probing
the HTTP server. Use when: (1) you modified a Streamlit app and want to sign
off on the change, (2) a smoke test passed via curl/HTTP 200 but you haven't
actually looked at the page, (3) the change touched data-source selection,
tab widgets from `extra-streamlit-components`, or dropdown population wired
to a backend, (4) an exit gate / PR review needs UI evidence not just import
evidence. Covers the "server-up ≠ UI-works" trap, iframe-isolated widget
gotcha in extra-streamlit-components, Playwright MCP fallback when the
claude-in-chrome extension is disconnected, and the specific failure signature
where HTTP 200 + zero tracebacks + empty dropdowns means data binding silently
broke between modules and the UI layer.
/zsh-done-assertion-word-splittingTwo zsh traps that make a portable Done-assertion / verification bash block
silently return FALSE all-MISSING results (e.g. "RESOLVED: 0/N MISSING: N")
even though every file exists and resolves fine — or make a loop over paths
mis-parse. Use when: (1) a shell verification / done-assertion block that
resolves reference paths reports everything missing or unresolved though the
files are plainly there; (2) a `for x in $var` / `while read` loop over
space- or newline-separated paths behaves differently than you expect on
macOS; (3) every command in a shell block starts failing with "command not
found" partway through; (4) you are about to WRITE any shell verification,
done-assertion, or check block that will run on a zsh-default machine
(macOS). Root causes: (a) zsh does NOT word-split unquoted variables the way
bash does, so bash-style `for x in $var` loops behave differently; (b)
assigning to a lowercase `path` variable CLOBBERS the command search `$PATH`,
because zsh ties the `path` array and the `PATH` scalar together — so every
command after `path=...` breaks. Fix: force bash (`bash -c '...'` or
`#!/usr/bin/env bash`), quote every expansion, set `IFS` deliberately, and
NEVER name a variable `path` (use `p` / `filepath`). Skip this for genuine
bash-only scripts on Linux CI, or when the block already runs under an
explicit bash shebang and names no `path` variable.
Other plugins' skills for the same job
npx claudepluginhub cajias/claude-skills --plugin testing