/testing:zsh-done-assertion-word-splittingfrom testing
Two 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.
Trending skills
7-day visitors to each skill page
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.
path clobberTwo symptoms, both on macOS (where the default interactive and login shell is zsh, not bash):
RESOLVED: 0/5 MISSING: 5 — even though each
file exists and resolves fine when you check it by hand.command not found (grep, cat, git, deno, ...), as if the
environment fell apart.Both trace back to the same thing: running a bash-shaped script under zsh.
echo $0 prints
-zsh, or $ZSH_VERSION is set).for x in $var; do ... over a space- or
newline-separated string, or while read fed by an unquoted expansion.path variable and later commands break
with command not found.Two independent zsh behaviors, either of which alone breaks a bash-authored block:
(a) zsh does not word-split unquoted parameter expansions. In bash,
for x in $var splits $var on $IFS into multiple words, and a whole idiom
family (for x in $list, while read over unquoted expansions) leans on that.
zsh, by design, does NOT split unquoted scalars — $var expands to a single
word. So a for x in $paths loop that iterates N times under bash iterates
ONCE (over the whole mashed-together string) under zsh, and your per-path
resolve/exists check runs against one string that matches nothing → MISSING: N.
(b) Assigning to path clobbers $PATH. zsh ties the array parameter
path to the scalar PATH — they are two views (array vs colon-joined string)
of the same thing. So a line like path="$ref_dir/$file" overwrites your
command search path with a bogus value. Every external command after that —
grep, cat, git, deno — fails with command not found, and the block
collapses in a way that looks unrelated to the assignment that caused it.
Author portable verification / done-assertion blocks defensively:
Force bash. Start the block with #!/usr/bin/env bash, or run it as
bash -c '...'. Don't rely on the ambient shell being bash — on macOS it
isn't.
Quote every expansion and split deliberately. To iterate a list, drive
it from a real newline-delimited source and set IFS:
#!/usr/bin/env bash
set -euo pipefail
resolved=0 missing=0
while IFS= read -r filepath; do
if [ -e "$filepath" ]; then
resolved=$((resolved + 1))
else
missing=$((missing + 1))
fi
done < paths.txt
echo "RESOLVED: $resolved MISSING: $missing"
Never name a variable path (or PATH). Use p, filepath, ref, or
target. This trap bites hardest because the failure surfaces far from the
assignment that caused it.
zsh -c '...' and once under bash -c '...' — a
portable block gives the SAME counts in both. A block that only works under
bash is the bug.echo "$PATH" at the end of the block still prints a sane search path; if it
prints one of your file paths, a path= assignment clobbered it.0/N resolved on a macOS/zsh machine while
the files were plainly present. Forcing bash + renaming the path variable
fixed both symptoms.path/PATH tie is zsh-specific — bash has no such linkage, which is
exactly why a block authored and tested under bash passes review and then
fails on someone's Mac.git-rebase-continue-editor-noninteractive and
cron-block-generation-gotchas cover the same family of "runs fine in one
shell or context, breaks silently in another." When in doubt about
portability, test the block under the shell it will actually run in.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cajias/claude-skills --plugin testing4 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.
/mutation-verify-render-testsVerify 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.
/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.