weave-testslisted
Install: claude install-skill kerilpatel/my-claude-plugin-marketplace
# Write Tests for the Working Diff
A test that passes without exercising the change is worse than no test: it makes an untested path look covered. Every test this skill writes has to be able to fail.
## Step 0 — Detect how this project tests
Run `"${CLAUDE_PLUGIN_ROOT}"/scripts/detect-test-runner.sh`. It reports the ecosystem, the runner, the suite command, the single-file command, the test directories, and a sample of existing test files.
**The existing convention is binding.** Read two or three of the sampled test files before writing anything, and copy what they do: file location and naming, import style, fixture and mocking approach, assertion library, how they name test cases, whether they use `describe`/`it` or flat functions. A test that is technically correct but stylistically foreign is a test the owner has to rewrite.
If the runner comes back `unknown`, ask the user how to run the tests and stop until they answer. Do not guess a framework into an untested repo.
## Step 1 — Establish the diff under test
- `--against <ref>`: diff `HEAD` against that ref.
- `--staged`: diff the staged set only (`git diff --cached`).
- Neither: everything uncommitted (`git diff HEAD`), plus untracked source files.
- If `$ARGUMENTS` names a path, restrict to it.
If the diff is empty, say so and stop.
For each changed source file, read the **full current file**, not just the hunks. A test needs the surrounding contract — the function's signature, its callers, what it throws.
##