/game:safe-refactor-and-reviewfrom Game Design and Build
Prove that a code change in a Godot project keeps behaviour unchanged, find every site that enforces a rule before you change it, scan the code base for measured fix candidates, run read-only reviews whose numbered findings small fix units close, and isolate render or feel bugs whose cause is unknown. Use it whenever someone refactors gameplay, draw, mesh, model or save code; makes hot code faster; switches a renderer or a render path; must prove that a planned mode behind a flag leaves the old path unchanged when the flag is off; moves, renames or deletes a function, constant or rule; asks "did this change anything", "is this dead code", "what should we clean up", "review this build" or "why does this draw nothing / feel wrong / judder"; or sees a measure that differs from a recorded table. Use it even if nobody says "refactor", "golden trace" or "code review".
Ships in Game Design and Build. 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.
Read when SKILL.md points to them; scripts run unread.
A refactor in a game breaks things quietly. A renamed private function still has a caller that uses a string. A speed fix changes a score at float precision. A view and the game logic decide the same rule in two places and drift apart. The method is simple: record a deterministic reference before any edit, change one item at a time, and compare the reference by hash after each item. Find every caller and every copy of a rule first, so that the proof covers the whole change. This works because a byte-equal trace from a seeded, fixed-step run is a proof that a test suite alone cannot give: tests check what someone thought of, and the trace checks everything the game did.
Rules: game:game-code-reviewer holds the rules for game code architecture; this skill is the Godot method to prove a change keeps behaviour.
godot-perf.visual-verification.godot-testing.Record the test baseline. Run the full suite and the focused filters for the affected files. Save each pass, fail and skip count. Check: the counts are in a file, not only in your scroll-back.
Pick the reference by code type.
| Code type | Reference |
|---|---|
| Gameplay logic | A per-tick trace or a path recording: seeded input, fixed ticks, fixed fps |
| Hot gameplay code | An event log (1 line per spawn, hit, kill, drop) or a SHA-256 digest per state |
| Draw code | Window captures of fixed states |
| Mesh code | A digest of vertices, normals and UVs |
| Model or table code | A dump of the computed tables or the simulator output |
| Save code | A fixture save written with the old code, plus a test that loads it |
Check: the reference covers at least 1 deterministic event of the system that you change. If the scenario has no such event, add 1 fixed source for it. For example, if you change combat code and the scenario has no kill, add 1 fixed enemy, so kill events enter the proof.
Remove drift. Use the same seed, a fixed frame rate and no delta smoothing. Pin every timing setting that can vary, for example hit-stop. Make the baseline twice and diff the 2 runs. Check: the 2 runs match byte for byte. If they cannot match, record the normal spread and say so in the report. A proof against a noisy reference proves nothing.
Keep an exact base copy. Extract the base without a git write:
git archive HEAD <project dir> | tar -x -C <temp dir>. A detached worktree also works. For
a single script, save the old file under a temp path and strip its class_name line, so the 2 versions do not clash. Run the Godot import in the copy once. Check: the base copy gives the baseline reference.
Find every caller. Search the whole repository for each name you move or delete. Include string calls and tools outside the game folder. See "Find every enforcement site" below. Keep private forwarders or aliases for callers that you may not edit.
Change 1 item per commit. After each item, compare the reference by hash or cmp, and compare the test counts. Check: the hashes are equal, and the counts are equal plus only your new tests.
For a speed change, run pairs. Run the base probe and the changed probe back to back with the same seed. Equal hashes prove identity. The median and the worst case of each pair show the gain. Report only paired results, because machine load drifts between runs. Reject a change that alters any result, even at float precision.
Turn a path recording into a regression test. Record the fixture on the old commit. Replay it in a test. Check: change 1 constant and watch the test fail. A replay test that cannot fail is decoration.
Put a new mode behind a flag that is off. Run the full suite with the flag off. Add tests for the mode with the flag on. Reset the flag at the end of each test that sets it, because a leaked flag changes later tests.
Check warnings. Run the warning check on the base and on your branch. Check: your files add 0 warnings.
When an outcome differs, find the first difference. Diff the event logs or the telemetry to the first line that differs. The first difference names the cause. Later differences are only its echo.
Use this before you delete, move or rename a name, or before you change a rule or a mechanic. A rule that lives in several places drifts when you fix only 1 copy.
git grep -w <name> or grep -rw <name> .. Do not use \b with git grep -E, because some platform builds give no hits for it."<name>" near .call(, get(, set(, has_method(, connect(. Also search for built names, for example "_on_" + kind.Set test fixtures so that only the rule under test is shut. A fixture that shuts 2 rules at once passes for the wrong reason.
Use this when a measure today differs from a table that someone landed earlier.
git archive <hash> <project dir> | tar -x -C <temp dir>.If a check uses a relative path, the scratch copy fails. Link the missing folder into the copy.
Use this for a measured, ranked list of safe fixes before a cleanup: warnings, dead code, unused signals, large functions, module coupling.
project.godot. Headless runs print no parser warnings, and the editor ignores override.cfg for warnings.Use this when a lead wants a read-only expert review of a build (code, UI, performance, QA, systems, balance, product), and small fix units then close the findings.
RS-07), the file and line, why it matters at this stage, and a fix small enough for 1 worker. Quote the rubric rule text.godot-testing for proof that a test can fail.Use this when something draws wrong or draws nothing (a shader effect, a trail, an overlay), or feels wrong (uneven steering, judder), and the cause is unknown.
--verbose to list the leaked objects. See godot-testing for the full leak hunt.| Symptom | Cause | Fix |
|---|---|---|
| Two identical runs of a fight check give different results | The check is not deterministic | Use a deterministic trace as the proof, not the fight check |
| Two base runs give, for example, 90 and 96 hits | Frame timing noise | Fix the frame rate, turn off delta smoothing, run the base twice to measure the spread |
| The seed differs after a change | A new start rule uses the random generator | Diff the telemetry to the first event that differs |
| A rewrite with cached trig changes scores slightly | Float precision | Reject it; keep only changes that are identical and win in paired timing |
| A later run is faster in unchanged code | Machine load drift | Report only back-to-back pairs |
| The identity proof has no kill events | The scenario kills nothing | Add a fixed enemy to each case |
| A golden compare fails on float rounding | The reference holds floats | Compare with a stated tolerance where the reference is float |
| A batching switch changes a few pixels in some pairs | Draw order or precision | Report the exact pixel count and decide; do not call it identical |
| Tests outside your file list fail after a rename | They call the old name through call() | Search string calls first; keep private forwarders |
| A rename breaks the parse | The new name already exists in that scope | Run the parse check; pick a new name |
| The suite fails after a move | A test calls a moved private function | Search the tests for every moved name before the full suite |
| A capture diff appears in a "pure cleanup" commit | The cleanup changed a draw argument | Capture again before that commit; keep cleanups in their own commits |
git grep -E '\bname\b' finds nothing | \b is not portable | Use git grep -w |
| An image diff script fails to start | The imaging library is not in the default Python | Use another Python, or ImageMagick compare |
| Your new tool shows a gap against an old table | A later game change, not the tool | Run the old tool on today's game first |
A probe run with -s fails to compile | It names class names before autoloads exist | Load game scripts at run time with load(); see headless-godot-runs |
| A dead-code search misses callers | It covers the game folder only | Search the whole repository, including tools |
| A rule fix leaves drift | The rule has several copies (logic, view, demo, tool) | Map all copies first; move the rule to 1 helper |
| A parity test passes for the wrong reason | The fixture shuts 2 rules at once | Shut only the rule under test |
| A test outside scope names a removed constant | The constant moved | Ask for a grant; make the test read values from data |
| Headless runs show no parser warnings | The runtime does not print them | Read them from the language server |
override.cfg does not turn on warnings | The editor ignores it for warnings | Edit project.godot in a scratch copy |
| A "dead" function is live | A string-built call reaches it | Search string calls and built names first |
| The layout scan shows many cycles | Matches in comments | Verify each hit in code |
| The warning check prints every kind | No filter | Filter to the kinds the plan names |
| A review cites a file that is not in the tree | The tree moved during the review | Review at a named commit |
| A citation points at the wrong line | No check pass | Check every citation before you report |
| Component tests pass, but the game is not playable | The main scene is a placeholder | Rank the integration gap as its own finding |
| A fix for 1 finding counts a case twice | The test did not pin the exact count | Report to the owner at once; assert the exact count |
| A copy change breaks an assertion in another unit's file | Scope | Report blocked; wait for the grant |
| A shader push does not show | A helper (for example a distance function) returns 0 | Test the helper alone through a visible output |
| A light lift is invisible in bright areas | Most pixels are already bright | Judge with a diff map |
| A palette snap maps a tint to an unexpected colour | Nearest-colour search | Compute where each colour lands |
| A hash gives negative angles | % keeps the sign | Use posmod |
| Steering drifts off the diagonal | A short key-release gap between ticks | Add a short release grace with a test |
| The first suspect is wrong | A guess, not a measure | Dump the internal state the suspicion depends on |
| A fix hint uses an API that does not exist | The hint was not tested | Test each hint in the probe first |
| A stencil pass draws nothing | Renderer limits | Try a variant, for example an inverted depth-test silhouette |
| A leak line at exit after a refactor | A static function casts to its own class and makes a script cycle | Use untyped access |
scripts/first_diff.py in this skill does this, with an optional float tolerance.git archive ... | tar -x -C <temp dir> line plus the import
step, written once in the project's dev notes.godot-testing: the test loop, proof that a regression test can fail, flaky tests and the full exit-leak hunt. This skill uses its tests as one half of the proof.headless-godot-runs: the flags and tool-script rules that a trace or probe run needs.bot-balance-loop: deterministic bot fights. Its determinism flags are the same ones this skill uses for a trace.godot-perf: timing A/B runs and frame-cost maps. This skill proves identity; that skill measures the gain.visual-verification: real window captures and the pixel-diff noise floor for draw-code proofs.balance-model-data: parity between a balance model and the game, when the reference is a model output.fleet-game-dev: scope grants, blocked reports and the land protocol around fix units.What SKILL.md sets; muted values are Claude Code's defaults
30 skills in this plugin
/art-directionUse when a game concept needs its visual direction set: a style sheet (palette, shape language, lighting, texture), a shot list tied to the target fun, and image-generation prompts for a key art, hero and gameplay-mock placeholder. Trigger on: "art direction", "style sheet", "what should this look like", "shot list", or when `game-brief` needs its art section. Every image prompt carries fixed content-boundary negatives and never names a living artist./balance-model-dataKeep a game's numbers in a scripted balance model (for example Python modules) that checks design targets and exports the JSON the Godot game loads, and change that data without drift. It covers the edit-export-diff loop, FAIL-key baselines, deterministic exports, parity fixtures between the model and GDScript, what-if and lever searches inside the model, and design docs whose tables must match the model. Use it whenever someone wants to change a price, a yield, a pacing curve, a content table or an upgrade row that a script exports; asks why the model and the game disagree, why a parity test fails, or why a chapter runs too long; wants to tune or fit levers before touching game data; or writes a design doc full of numbers, even if nobody says "balance model" or "source of truth".npx claudepluginhub mattmakes/skill-marketplace --plugin game