/test-run:test-run [path|pattern] [--all]from test-run
Run the project's tests, show only compact failures, and fix them in a bounded loop. Manual command (`/test-run:test-run`). Only the detected-runner script is pre-approved; a custom `--cmd` goes through `run_custom.py` and prompts.
Ships in test-run. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
run_tests.py detects the runner, picks the tests, runs them, and prints only the failures. Work from its output. Open the raw log only when a failure block isn't enough to diagnose.
From the project root, run this with a Bash timeout of 600000 ms:
python3 ${CLAUDE_SKILL_DIR}/scripts/run_tests.py $ARGUMENTS
scope: line says which.run_tests.py rejects --cmd (exit 2). For a command the user gave, run python3 ${CLAUDE_SKILL_DIR}/scripts/run_custom.py --cmd "…" [targets]. It shares the parse and plan code but is not pre-approved, so each call prompts.npm test still runs project code, which is inherent, so use this skill on trusted projects only.--help for the other flags.Detected runners, scanning the repo root and two levels down:
test script, cargo, and make test at the root.*.slnx, *.sln or *.csproj that has a test project means dotnet test. A global.json test.runner of Microsoft.Testing.Platform selects native MTP (--solution/--project). A project that sets TestingPlatformDotnetTestSupport with an MTP runner, or uses TUnit, selects the bridge, which puts MTP args after --. Otherwise VSTest. Name filters follow the mode: --filter FullyQualifiedName~, xUnit v3 --filter-method, TUnit --treenode-filter.project.godot plus addons/gut runs GUT, plus addons/gdUnit4 runs gdUnit4's GdUnitCmdTool.gd, and plus test/test_runner.gd runs that SceneTree script. All run headless with a 540 s timeout. The binary is GODOT_BIN, else godot, godot4 or godot-mono on PATH. A checkout with no .godot/ is imported first. gdUnit4 selects by suite, so a path::test id reruns the whole suite. The bare runner reports only its exit code and output tail.Output starts with runner: (the exact command) and scope:, then a summary line and one ### n. <id> block per failure with its location, message, and user-code trace. The last line is log: <path> to the full raw output.
| Exit | Meaning | Next step |
|---|---|---|
| 0 | All selected tests passed | Report the result and its scope. Stop. |
| 1 | Test failures | Go to step 2. |
| 2 | Usage, detection, or runner error (collection or compile error, no tests ran) | Read the error: block. Fix a code error like a failure. For detection problems, rerun with a target path or ask the user for a command to pass to run_custom.py --cmd. Treat a missing tool or dependency as environmental. |
For each failure:
Diagnose the root cause before editing. Read the failing line and the code under test. Treat production code as the suspect first.
Make the smallest fix. Never weaken assertions, broaden matchers, delete tests, or add skips.
Rerun only the failing tests. Each ### n. id is a valid target:
python3 ${CLAUDE_SKILL_DIR}/scripts/run_tests.py "<id>" ["<id>" ...]
If the first run used run_custom.py --cmd "…", rerun with the same script and --cmd.
Allow at most 3 materially distinct attempts per failure. After the third, stop working on it and record it as remaining.
Stop and ask the user with AskUserQuestion, explaining each option, when:
For deeper method, use problem-solving for hard diagnoses and unit-testing for test-quality questions, if installed.
Once every targeted failure passes, run the full suite once with --all. Treat new failures from it with the same loop, within the same attempt budget.
ruff.toml (opens in a new tab)scripts/detect.py (opens in a new tab)scripts/parse.py (opens in a new tab)scripts/plan.py (opens in a new tab)scripts/run_custom.py (opens in a new tab)scripts/run_tests.py (opens in a new tab)tests/conftest.py (opens in a new tab)tests/fixtures/cargo_compile.out (opens in a new tab)tests/fixtures/cargo_failures.out (opens in a new tab)tests/fixtures/dotnet_build.out (opens in a new tab)tests/fixtures/dotnet_mtp_failures.out (opens in a new tab)tests/fixtures/dotnet_vstest_failures.out (opens in a new tab)tests/fixtures/gdunit4_failures.out (opens in a new tab)tests/fixtures/go_build.json (opens in a new tab)tests/fixtures/go_failures.json (opens in a new tab)tests/fixtures/gut_failures.err (opens in a new tab)tests/fixtures/gut_failures.xml (opens in a new tab)tests/fixtures/gut_parse_error.err (opens in a new tab)tests/fixtures/jest_failures.json (opens in a new tab)tests/fixtures/jest_load_error.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin test-run