refine-tests

A code-review skill for improving tests according to a project's test-design and test-writing guides. Tests are code that checks whether other code behaves correctly.

In plain words
What is it for?
Use it when you have test files that need review and refinement. It is not for adding tests for a new feature or fixing a test that checks the wrong behaviour.
Why use it?
It helps bring existing tests into line with team conventions without treating new features or failing tests as its target.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/nowsprinting/unity-coding-skills/refine-tests
Any agent
npx skills add nowsprinting/unity-coding-skills --skill refine-tests
Clone the repo
git clone --depth 1 https://github.com/nowsprinting/unity-coding-skills

Made for: Claude Code, Codex.

Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,080 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00064 $0.02080
Opus 5 $0.00032 $0.01040
Sonnet 5 $0.00013 $0.00416
Haiku 4.5 $0.00006 $0.00208

Measured 2d ago against content hash f37f3b26f38d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refine-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/refine-tests/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reviews existing test code for conformance to the test-designing-guide and test-writing-guide, then applies the refinements.

Scope Check

This skill is for refining existing tests for conformance to the guides. If the request is out of scope, redirect:

  • Adding tests for a new feature or spec change → use /plan-feature instead
  • A failing test, or a test that verifies incorrect behavior → use /fix-bug instead

Input

One or more file path arguments. Resolve them to the concrete set of test files to review before proceeding.

If no path argument is given, use AskUserQuestion to ask the user for the targets. Do not derive targets from git status — that would silently widen the scope beyond what was requested.

Workflow

Recording implementation notes: Notes for this run go in /tmp/refine-tests-notes-$CLAUDE_CODE_SESSION_ID.md. Immediately before your first append in this run — and only then — delete that file if it exists (usually it will not), so this run starts from an empty one: the session id is shared by every /refine-tests run in the session, so an earlier run abandoned before Step 7 would otherwise leak its notes into this one.

While working through Steps 5–6, whenever one of the following occurs, immediately append a line to that file — do not wait until the end to reconstruct these from memory:

  • A Finding was ambiguous, or proved wrong once applied, and you made a judgment call → Design decisions
  • You intentionally departed from a Finding, and why → Deviations
  • You considered alternatives and chose one, and why → Tradeoffs
  • You changed production code — a method demoted to private, a dead test-only seam removed, or any other production edit — and why → Production code changes

Append with Bash so the shell expands $CLAUDE_CODE_SESSION_ID — the Write tool cannot append and does not expand environment variables:

cat >> "/tmp/refine-tests-notes-$CLAUDE_CODE_SESSION_ID.md" <<'EOF'
- **Production code changes**: <one line>
EOF

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 125 lines · 64 tokens per session scan A f37f3b26f38d

Subscribe to this mod's changes

refine-tests is a skill published in the GitHub repository nowsprinting/unity-coding-skills (19 stars, last pushed 2d ago), licensed Unlicense. It adds 64 tokens to every session and 2,080 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

unity

Compile, test, and drive Unity for this repo's C# packages (unity/core, jint, quickjs, clearscript) and the two Unity projects (tests/, kitchen-sink/). Use when a change touches C# under unity/, when Unity test results are needed, when a rendering snapshot has to be checked or regenerated, or when the app has to be…

ReactUnity/core · 108 tokens

uloop-execute-dynamic-code

Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for reachable scene/component state, scene/prefab/menu automation, and PlayMode checks.

hatayama/unity-cli-loop · 43 tokens

uloop-simulate-mouse-input

Simulate Mouse.current input in PlayMode through Unity Input System. Use for gameplay mouse clicks, long-press (LongPress), movement delta (MoveDelta/SmoothDelta), or scroll. Use --dry-run to check what a Game View coordinate hits in 3D physics before clicking (works in EditMode; no Input System required). Use…

hatayama/unity-cli-loop · 113 tokens

uloop-simulate-mouse-ui

Simulate PlayMode EventSystem UI mouse actions using screen coordinates. Use for UI clicks, long-presses, or drags from annotated screenshots.

hatayama/unity-cli-loop · 39 tokens

uloop-pause-point

Pauses Unity playback at any source file:line without editing code or recompiling, and returns a snapshot of the locals, parameters, and instance fields at that exact frame. Use for bug investigation, PlayMode/E2E verification, checking variable values at a specific frame, or confirming that a code path executed.

hatayama/unity-cli-loop · 69 tokens

uloop-screenshot

Capture Unity Editor windows or Game View rendering as PNG. Use for visual checks, debugging, documentation, or annotated UI element coordinates.

hatayama/unity-cli-loop · 31 tokens