/translate-retro-game:translate-retro-gamefrom translate-retro-game
Provides a complete playbook for fan-translating Japanese retro games (SNES, GBA, NDS, PS1, PSP) into English. Covers tool setup, ROM analysis, text extraction/insertion, font/VWF handling, batch translation with parallel agents, headless emulator QA, and patch packaging.
Ships in translate-retro-game. 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.
The goal is an English patch that the user can playtest without acting as your QA loop. Past translation projects lost most of their time in four ways:
This skill closes all four gaps. $SKILL below means the directory containing this SKILL.md; it is not a real variable. In files you write into a repo (AGENTS.md/CLAUDE.md, settings, scripts, subagent briefs), write a path that survives updates:
~/.claude/plugins/marketplaces/retro-translation/skills/translate-retro-game (the marketplace clone, kept current by auto-update). Never the plugins/cache/<hash>/ path this file may have loaded from: each update adds a new hash and old ones get deleted.Repo scripts read it from one place, tools/skill.py (copied from $SKILL/assets/skill.py: from skill import SKILL; python tools/skill.py prints it; env TRANSLATE_SKILL overrides it), never a literal path per script. Copy what the build and check import (tbl.py, bps.py, romdiff.py) into tools/, so a clone builds and its pre-commit check runs without the skill; call the QA tools (emu.py, play.py, qa_gate.py, jp_left.py) through SKILL.
sed -i or a Python .replace() script turns \n, \x00, \xff and \uXXXX into real newlines, NUL bytes and raw characters, and sed -i strips CRLF. This broke code in most past sessions. For a throwaway analysis script, write it to a temp file with the same tool and run it.python -X utf8 for anything that prints Japanese (Windows consoles default to cp1252). -I ignores PYTHONUTF8, so pass -X utf8 explicitly. On Windows, python3 may resolve to the Microsoft Store alias; use whichever interpreter --version confirms.pytest | tail && git commit commits even when tests fail, because the pipe returns tail's exit code.emu.py --smoke. Black-screen boots reached users repeatedly when nobody booted the build first.emu.py prints: other agents' emulators may share the machine.docs/status.md, commit, and tell the user to run /clear (Claude Code; a new session elsewhere), since you can't clear your own context; the next turn resumes from the instructions file and status.md. A dispatched worker has no user to clear it (345 of those 402 sessions): at ~150k do the same, then hand back with what's left (Orca: worker_done --outcome failed, body starting context limit, resume from docs/status.md) so the coordinator dispatches a fresh worker rather than re-engaging that terminal. Images stay in context too (one worker read 510 in its main thread): read only the shot for the bug in hand, and send any set of sheets to read-only subagents in chunks (references/emulator-qa.md §Visual QA). For a pre-approved run in one session, don't stop: keep status.md current at every phase end so any reset resumes cleanly; a SessionStart hook on compact|clear tells the next turn to re-read the instructions file and status.md. No hook can run /clear or /compact itself, and a smaller auto-compact window doesn't help: the extra compactions cost about what the smaller context saves, and each summary drops detail.tools/ and commit it. Temp and scratch dirs die with the session; whole emulator harnesses were lost this way.C:/..., cygpath -m), never /c/...: Python and the emulators can't open those.sheet.py, not inline PIL: it takes single PNGs, --crop, --zoom, --rotate and --compare with any two files. Sessions wrote 40-70 PIL snippets each for what one sheet.py call does.references/pipeline.md §Checks).references/pipeline.md §Publish.assets/settings.json: its pages reached agents carrying injected instructions (payment demands, file writes, fake keys).glossary.md, with the options and reasons in docs/decisions.md)These are what earlier users settled on. Offer them as defaults instead of guessing, and ask once per project:
glossary.md exactly. Near-miss spellings ("Bran" for "Plan") are the most common thing users catch.references/translation.md §Second language first (copy the style rules and reviewer brief, wrap paragraphs by tool).agent[:model[:effort]], agent one of claude, codex, opencode) that runs independent reviews when there are no subagents (references/translation.md §Review). Default: the agent and model running this setup, e.g. claude:claude-opus-5-5:high. Record it in docs/decisions.md; a harness that names one in its prompt wins.https://github.com/mtlgames/fan-translation-template into a scratch dir and copy its files into the new repo (no .git): AGENTS.md/CLAUDE.md, .claude/settings.json (enables this plugin), .codex/agents/, .opencode/agents/ (translator, reviewer, visual-qa, playtester, graphics types for Codex and opencode; Claude Code gets them from the plugin as translate-retro-game:<type>), .gitignore/.gitattributes, rom.sha1 + tools/check_rom.py, docs/{status,decisions,fonts,re/README}.md, glossary.md, README, LICENSE, .github/FUNDING.yml. Then copy $SKILL/assets/skill.py to tools/skill.py. The steps below fill in and check what it gives you.references/setup.md lists what to get and where. Run scripts/fetch_emu.py <emu> (picks the release for this OS/CPU and unpacks it into this repo's tools/<emu>/, gitignored, no compiler needed): every project has its own copy, never one shared with another repo. Confirm its default settings work for input (scripted and keyboard) and Lua before going on.translate-retro-game@retro-translation plugin, the guard hook ships with it: merge only env and permissions from $SKILL/assets/settings.json (plus the extraKnownMarketplaces/enabledPlugins block from the README, so clones get the plugin). Then prove the hook runs: sed -i s/a/a/ hook-canary.py must come back blocked by the guard. Many plugin-mode sessions ran with no guard at all (the plugin enabled, its hook never loaded) and sed -i/heredoc edits corrupted source again. If the canary isn't blocked, ask the user to run /reload-plugins and retry; if it still isn't, add the hooks block from $SKILL/assets/settings.json to .claude/settings.json with the command pointing at the stable path from the top of this file (python "<path>/scripts/hooks/guard_bash.py"). Editing .claude/ can be refused by an auto-mode permission check; then give the user the exact change to make. Otherwise copy $SKILL/scripts/hooks/guard_bash.py to .claude/hooks/guard_bash.py, and merge $SKILL/assets/settings.json into .claude/settings.json. It sets PYTHONUTF8, denies tcrf.net and runs a hook that blocks the shell habits above. Batch mode (one session driving several game repos): Claude Code loads hooks only from the session root, so a per-repo hook never runs; put the same block in the session root's .claude/settings.json, with the command pointing at $SKILL/scripts/hooks/guard_bash.py. Other agents: set PYTHONUTF8=1 in the environment and follow the ground rules; the pre-commit hook in the next step works for every agent.cp $SKILL/scripts/hooks/pre-commit tools/hooks/pre-commit, commit it (add !tools/hooks/ to .gitignore, step 5), run git config core.hooksPath tools/hooks and put that line in the instructions file: a hook only in .git/hooks never reaches a clone. Set its CHECK= line to the repo's one-command check. If the repo has none, create one: a check target, or a tools/check.py that runs every test plus the text lint.git config user.name. If it is unset, ask the user which identity to commit as; don't invent one..gitattributes with * text=auto eol=lf, then one <pattern> binary line per ROM/image type (*.sfc binary, *.gba binary, *.png binary...). Git takes one pattern per line. Skip this when the index already holds CRLF files (git ls-files --eol | grep i/crlf); renormalizing churns every file, so ask the user first. Add .gitignore for rom/ build/ work/ dist/ release/, tools/ binaries and savestates (*.mss *.sstate *.ppst *.ds[0-9] *.state). The template ignores tools/*/ (emulator folders) except routes/, debug/, lua/ and hooks/: add a !tools/<dir>/ line for any other helper folder you create (an ignored tools/lua/ once silently left a repo's probes out of git).rom.sha1 (<sha1> rom/<file>, sha1sum format) and make the build check it before anything else (the template's tools/check_rom.py, ~20 lines). A wrong revision, a copier header or an already-patched copy otherwise builds fine and breaks at random offsets.$SKILL/assets/AGENTS.md.template: AGENTS.md (read by Codex, Cursor, Copilot, Gemini CLI and others) and/or CLAUDE.md (Claude Code). If you need both, keep the content in AGENTS.md and make CLAUDE.md the one line @AGENTS.md (Claude Code imports it). 40 lines or fewer, covering: commands, paths, emulator location, project rulings, and a pointer index into notes/ or docs/. Keep changing state out of it: progress goes in docs/status.md, the user's rulings with their options and reasons in docs/decisions.md (read before asking the user anything), font sources and licences in docs/fonts.md (fonts ship inside the patch). Its job is to make orientation in a fresh or compacted session cost one file read instead of six.Done when the smoke command boots the original ROM on the repo's own emulator build, scripted and keyboard input both work, a commit with a failing test is rejected, the guard blocks the canary (Claude Code), python tools/skill.py prints the skill path, and the instructions file names the build, check, smoke and release commands.
Each phase ends on a checkable condition. Do the phases in order. Skipping the identity build or the marker build is how the hard bugs got in.
| # | Phase | Done when | Read |
|---|---|---|---|
| 1 | Research and recon: earlier patches, docs, header, compression, text encoding, pointer tables, control codes, graphics text | docs/re/ or notes/ records encoding, pointer format, text ranges and free space; the graphics-text survey lists every tile-drawn Japanese element | references/pipeline.md §Recon, references/graphics.md §Survey, platform file |
| 2 | Debug tool: a per-game way to reach any scene, menu or ending from a cold boot (warp by scene id, story flags, god mode, leftover debug menu, save editor for stage/items/money/names) | tools/debug/ reaches every entry in its scene list from a cold boot, each with a shot proving it, with no user save and no playthrough; save.py edits load in game with no corruption message | references/emulator-qa.md §Debug tool |
| 3 | Identity build: unpack then repack with no edits | the rebuilt ROM or disc is byte-identical to the original, as a test | references/pipeline.md §Identity |
| 4 | Extract to the repo's text format | roundtrip test: re-encoding every extracted string gives the original bytes, and text ranges are fully covered | references/pipeline.md §Extract, scripts/tbl.py |
| 5 | Engine spike and marker build: font/VWF decision, every line replaced by [id] marker text | the marker ROM boots, every text box shows its id, non-text "strings" are found and excluded, and every text group (table column, window type, menu field, detail view opened from a list) has a box measured in-game with a shot: boxes.py exits 0 (the width gate) | references/pipeline.md §Marker, platform file |
| 6 | Translate in batches with parallel agents, only after the width gate | the batch check reports 0 errors, the glossary is updated, and the reviewer pass finds no Critical/Important issues; every chapter has a current story-pass ok or fixed (qa_gate.py check work/qa/story/manifest.tsv ..., references/translation.md §Review) | references/translation.md |
| 7 | Insert, fit, check | build green: width/overflow lint clean, control codes matched, romdiff.py shows no writes outside allowed ranges | references/pipeline.md §Checks |
| 8 | QA in the emulator | smoke passes; routes through changed scenes, reached with the debug tool, give contact sheets, and every sheet has an ok verdict from a read-only visual-QA subagent (qa_gate.py check exits 0); every graphics-text row is English in a zoomed cold-boot shot, including every chapter card, game over and the credits, each reached by warping (redraw them with parallel graphics agents after one pilot group: references/graphics.md §Parallel redraws); every choice and centred menu box passes inkbox.py; every stress save (longest names, full lists, max numbers, long names: references/emulator-qa.md §Stress saves) has its menu sheets passed; textcover.py exits 0 | references/emulator-qa.md, references/graphics.md |
| 9 | Release | every chapter's story-pass verdict is still current (lines changed after phase 6 cost their chapter its verdict) and docs/polish.md has no unticked line; the release script runs qa_gate.py check on every manifest, textcover.py and boxes.py, and all exit 0; jp_left.py on the release build reports no unintended Japanese; the debug tool is off in the release build; the patch is built, re-applied and verified; the repo README has no template placeholders, and it and the zip README have the base ROM hashes; zip holds patch + README | references/pipeline.md §Release |
Platform notes are loaded only for the platform at hand: references/platform-snes.md, platform-gba.md, platform-nds.md, platform-ps1.md, platform-psp.md.
When the user reports an in-game bug, reproduce it with emu.py first, from their savestate if they gave one (a Snes9x/RetroArch one too: s9x_state.py), else by warping there with the debug tool, and save the shot. If the debug tool can't reach the scene, add it to the scene list rather than asking the user to play there. Before fixing a playtester's report, replay its step on the original ROM (play.py SESSION --route N, then emu.py on rom/ with that route and sheet.py --compare): many reports were the game's own behaviour. Then fix it, re-run the same route, and compare. Then grep for every other copy of the same text or code, because games often store a string two or three times. When the cause is a blind spot of the extractor (a pointer form, a code-built string, a table it skipped), sweep the whole ROM for that form and fix every hit before reporting, rather than reporting "others may exist". End the turn with the rebuilt build/ output, its smoke result, and its time and sha1, so the user knows which build to test. When the first fix doesn't hold, or you are about to add a second special case for the same thing, scan references/cases.md by symptom before guessing again.
$SKILL/scripts/, tested; each has --help)| Script | Use |
|---|---|
fetch_emu.py mesen|desmume|pcsx|ppsspp|gba-bios|psx-bios | Download the emulator release matching this OS/CPU into tools/<name>/, or a console BIOS from retrobios |
emu.py ROM --out DIR --route r.txt --shot-every 300 --smoke --sheet [--sav F] [--script x.lua].. | Headless boot, scripted input, screenshots, contact sheet, saves, Lua hooks. Mesen .sfc and .gba, DeSmuME .nds, PCSX-Redux .cue, PPSSPP PSP .iso (window hidden, states, no Lua). Exit 0 ok / 2 Lua error / 3 smoke fail / 124 timeout |
record.py ROM.cue --out D [--card F] [--watch n=0xADDR:N] / replay.py D --out O [ROM.cue] | PS1: record a human playthrough as a route + states + RAM checkpoints, replay it headless on any build; exit 4 = left the recorded path (references/emulator-qa.md §Record) |
play.py SESSION --rom ROM [--script cheat.lua --var GOD=1] / play.py SESSION a down "right*40" [--every N] / --back N / --route [N] | Turn-by-turn play from the last savestate, one shot per call: the playtester subagent's controller (assets/playtester-brief.md, references/emulator-qa.md §Agent playtest). --script runs a cheat on every step of the session; --route gives the session's presses as one route, to replay on a fixed or original ROM |
lua/probes/: watch.lua, ramdump.lua, ppudump.lua, snes_romreads.lua, snes_dmalog.lua, textcover.lua | --script probes: who reads/writes an address, RAM dumps, PPU/VRAM dumps, SNES ROM-read and DMA logs, text reads for textcover.py |
s9x_state.py STATE PREFIX + lua/probes/s9x_load.lua | Run a player's Snes9x/RetroArch state in Mesen over a same-mode base state (references/emulator-qa.md §emu.py, Savestates) |
sheet.py DIR|PNG.. [--changed 0.02] [--from N --to M] [--crop x,y,w,h] [--zoom N] [--compare DIR2|PNG] | Contact sheets (paged, no frame dropped), or zoom into / pair single frames: sheet.py shot.png --crop 8,150,240,40 --zoom 3 |
boxes.py TEXT.tsv docs/boxes.tsv | Width gate by text group: fails on a group with no measured box or shot, English over its box, or a box that wraps by itself (JP lines past the budget) not marked self (references/pipeline.md §Width gate) |
inkbox.py SHOT.png x,y,w,h.. [--tol 2] [--vert] | Ink margins inside a box; exit 1 if off-centre (references/emulator-qa.md §Visual QA) |
rectcover.py ORIG.png x,y,w,h.. [--pad 4] [--diff 0] | Original text running past a clear rect (a dakuten or tail left as stray pixels); exit 1 if any rect must grow (references/graphics.md §Lettering) |
textcover.py LOGDIR STRINGS.tsv [--waive F] [--mask M] [--runs-for IDS] | Strings a warp or tour run never reached; exit 1 if any isn't waived. --runs-for: which runs showed these ids, to re-run only them (references/emulator-qa.md §Text coverage) |
qa_gate.py init|todo|check|waive MANIFEST ... | Visual-QA gate: manifest of tour sheets with hashes, chunk files for reviewer subagents (assets/visual-qa-brief.md), exit 1 while any sheet lacks a verdict newer than its last change, or the build differs from the one the tour ran on (references/emulator-qa.md §Visual QA). The Claude Code guard blocks gh release create while it fails |
review_agent.py SPEC --out F [--image PNG..] < prompt | One read-only review by the review agent (claude, codex or opencode, any model) when there are no subagents (references/translation.md §Review) |
jp_left.py BUILT --sjis|--tbl jp.tbl [--slots F] [--known F] [--gba-ptrs] [--orig ORIG] | Japanese runs still in the build; exit 1 if any. --slots/--gba-ptrs keep only text a pointer still reaches |
relsearch.py, dis65816.py, disasm.py (capstone), ramsearch.py | Recon: relative search, SNES / ARM / MIPS disassembly + xref, cheat-style RAM search |
tiles.py render|import|map, vramfind.py | Graphics text: render tiles and BG maps from dumps, re-import edited PNGs, find VRAM tiles in the ROM (references/graphics.md) |
iso9660.py, cpk.py, gim.py, sfo.py, showgim.py, typeset.py, jpscan.py | PSP / 3D-era image work: ISO list/extract/patch, CRI CPK read/rebuild, GIM texture decode/encode, PARAM.SFO, side-by-side image sheets, English text rendering (Pillow), Japanese run scan in binaries (references/platform-psp.md) |
bps.py make ORIG BUILT OUT.bps / apply / snes-checksum | Patch with built-in re-apply check; SNES header checksum |
romdiff.py ORIG NEW RANGES.. [--writes LOG] | Fails on any byte changed outside allowed ranges; with the build's write log, also on wrong original bytes, overwritten or overlapping writes (references/pipeline.md §Checks) |
tbl.py | Table codec with control codes, roundtrip-exact; copy it into tools/ and import it in extract/insert code |
hooks/pre-commit (any agent), hooks/guard_bash.py (Claude Code) | The guardrails from Step 0 |
Update docs/status.md (or the instructions file's status line in an older repo): what's done, what's next, open bugs with savestate names. Add any ruling the user made this session to docs/decisions.md. Commit any helper you used twice. Agent memory is per-folder and invisible to other repos, so put durable project knowledge in the repo.
If you fixed or extended anything under $SKILL (a script, a Lua library, a reference), tell the user in your final report, with the file and a one-line summary of the change. The copy you edited is usually per-project; unreported fixes stay stranded there and the next game hits the same bug.
Record gotchas as you hit them, even ones you only worked around: an assembler or emulator quirk, a tbl.py or Lua-probe surprise. Append one line per gotcha to docs/skill-gotchas.md and commit it: the reference file it belongs in (usually references/platform-<x>.md or emulator-qa.md), then the fact. Skill fixes from the paragraph above get a line too. A final report or a worker's short hand-back gets read once and lost; this file survives, and a retro can grep it across repos. An asar mis-encoding and a bank-$7E probe fix were worked around, never written down, and lost to the next game.
assets/AGENTS.md.template (opens in a new tab)assets/batches.py (opens in a new tab)assets/glossary.md (opens in a new tab)assets/graphics-brief.md (opens in a new tab)assets/playtester-brief.md (opens in a new tab)assets/reviewer-brief.md (opens in a new tab)assets/settings.json (opens in a new tab)assets/skill.py (opens in a new tab)assets/story-reviewer-brief.md (opens in a new tab)assets/translator-brief.md (opens in a new tab)assets/visual-qa-brief.md (opens in a new tab)references/cases.md (opens in a new tab)references/emulator-qa.md (opens in a new tab)references/graphics.md (opens in a new tab)references/pipeline.md (opens in a new tab)references/platform-gba.md (opens in a new tab)references/platform-nds.md (opens in a new tab)references/platform-ps1.md (opens in a new tab)references/platform-psp.md (opens in a new tab)references/platform-snes.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mtlgames/translate-retro-game --plugin translate-retro-gameOther plugins' skills for the same job