Run playmode
Runs Unity PlayMode tests filtered by class, namespace, or category — via the warm Unity MCP if available (~2s startup), else via batchmode CLI (~30s cold). Thin wrapper over `mcp__UnityMCP__run_tests` / `get_test_job` that also parses failures and prints them in a copy-paste-friendly form. Use when the user asks to run a specific PlayMode test, run tests in Play mode, run `SetValidator` tests, run tests matching a filter, or "run just the FooBar tests".From its SKILL.md
npx -y skills add paologum/claude-skills --skill run-playmodeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.3 KB, as published. Nobody here has run it
Context
Repo root:
!`git rev-parse --show-toplevel 2>/dev/null || pwd`
Is a Unity project?
!`ls ProjectSettings/ProjectVersion.txt 2>/dev/null && head -1 ProjectSettings/ProjectVersion.txt || echo "no Unity project"`
Requested filter:
!`echo "${ARGUMENTS:-<all PlayMode tests>}"`
Existing PlayMode test files matching the filter:
!`find Assets -path '*/Tests/*' -name '*.cs' 2>/dev/null | xargs grep -l "$ARGUMENTS" 2>/dev/null | head -20`
Task
Run PlayMode tests, filtered by the argument, and report results.
Path A — Unity MCP (preferred)
If mcp__UnityMCP__run_tests is available in this session:
- Verify the Editor is idle. Call
mcp__UnityMCP__manage_editoraction: "get_state". IfisPlayingis true, tell the user to stop Play mode first — refuse to run. - Kick off the test job.
The tool returns amcp__UnityMCP__run_tests({ testMode: "PlayMode", testFilter: "$ARGUMENTS" // full class name, namespace, or a fully-qualified test method })jobId. Don't block — the Editor takes 1–10s to enter test-run mode. - Poll: call
mcp__UnityMCP__get_test_jobwith the jobId every ~2s untilstatusisCompletedorFailed. Print a one-line progress update every 3rd poll so the user sees liveness. - Parse and report:
- Total / passed / failed / skipped counts on the first line.
- Each failure as
<test-name>\n <message>\n <first stack frame>— no full stack traces unless the user asks. - If any failure, print the exact filter the user can re-run:
/run-playmode <failing-class>.
Path B — batchmode CLI (fallback)
If MCP isn't available, fall back to /unity-test (the sibling skill) rather than re-implementing the CLI here. Emit:
Unity MCP isn't loaded this session. Run
/unity-test PlayMode <filter>for a batchmode run (~30s cold startup) — same output.
Rules
- PlayMode only. For EditMode tests, tell the user to use
/unity-test EditMode <filter>— this skill exists specifically because PlayMode + MCP is the fastest tight-loop combo, and EditMode is already fast in batchmode. - Refuse if the filter is empty AND the running Editor has more than a few dozen PlayMode tests — a full run in the warm Editor blocks the user's Editor for minutes. Suggest they narrow the filter or use batchmode.
- Do NOT mutate the project. Do NOT enter Play mode manually —
run_testshandles that. - If the filter doesn't match any test class in
Assets/**/Tests/**, warn before running: probably a typo. - If the Editor is compiling (
get_statereportsisCompiling: true), wait for compile to finish before kicking off the run. Poll every 2s, max 60s.