liuyanghejerry/open-pokered/save-construction
Claude Code and agent skill by liuyanghejerry/open-pokered
- community
Checking that the SKILL.md file is still in the repository.
Construct, inspect, and manipulate Pokémon Red/Blue save states — the editor's Save tab, the full JSON snapshot schema (party, bag, badges, event-flag bitset), headless save construction via pokered-app export/import-snapshot, and live save surgery through the TCP debug server. Use when the user wants a save at a specific story point, a test save for new content, party/item/flag edits, or save debugging.
Install
npx vskill@latest install liuyanghejerry/open-pokered/save-constructionSKILL.md
save-construction — Building Save States
Three layers, pick per goal:
| Goal | Tool | |
|---|---|---|
| Quick edits + playtest inside the editor | Save tab (Info / Party / Flags / Items editors, JSON import/export) | |
| A full-fidelity save file for the real game | JSON snapshot via pokered-app export-snapshot / import-snapshot | |
| Tweak a running game | TCP debug server (set_flag, give_item, give_pokemon, warp, save) |
The assistant has no save-file propose tool — produce JSON in chat for the user to import, or walk them through the CLI below.
Layer 1: the editor Save tab
The Save activity edits a simplified snapshot (SaveDataSnapshot): player (name, rival, mapName, x/y, facing, money, coins, play time), badges (8 booleans, Boulder→Earth order), party (up to 6 × {species, level, currentHp, maxHp, moves[4], nickname}), items ({name, quantity}), and flags (name → bool). Import JSON accepts that shape; Export downloads it. Pair it with the Playtest activity to spawn the game at that state.
Layer 2: the full JSON snapshot
The game binary's own format (mirrors SaveData in crates/pokered-core/src/save/):
Key fields:
- `game_data.position` —
{map_id, x, y, x_block, y_block}; `player_direction` 4=Down 8=Up 2=Left 1=Right (original PLAYER_DIR bitmask, not sprite facing). - `game_data.obtained_badges` — u8 bitfield, bit0=Boulder … bit7=Earth. (Badges are NOT event flags.)
- `game_data.player_money` (≤999999), `player_coins`, `game_data.bag.items` as
[[itemId, qty], …]whereitemIdis the ItemId name string ("MasterBall","RareCandy", … — the same ids ascrates/pokered-data/data/items/*.json; the numeric byte order indata/items/item_list.jsonis 1=MasterBall, 2=UltraBall, 6=Bicycle, 40=RareCandy, with TMs at 0xC9+ and HMs at 0xC4+). - `party` — up to 6 full Pokémon records:
species(PascalCase),level,hp/max_hp/attack/defense/speed/special,type1/type2,moves(4 MoveId names — empty slots are"None"),pp[4],dv_bytes[2](Atk/Spd high nybbles, Def/Spc low),stat_exp[5],total_exp,status,ot_id(0 = own), plus charmap-encodednickname/ot_namebyte arrays (0x50= padding; seepokered_data::charmap). - `game_data.event_flags` — the story flags: a 320-byte bitset (507 named flags in
crates/pokered-data/src/event_flags.rs; the enum value IS the bit index). Flip bits, don't append:
Common progression flags: EVENT_GOT_STARTER, EVENT_GOT_POKEDEX, EVENT_BEAT_BROCK/MISTY/LT_SURGE/…, EVENT_GOT_SS_TICKET, EVENT_BEAT_*_GYM_TRAINER_*. The enum in event_flags.rs is the source of truth.
Layer 3: live surgery via the debug server
JSON-lines over TCP (scripts/debug_drive.py is a minimal client):
Recipe: a save that exercises NEW content
To test-drive a new map / species / trainer (the other skills):
- Export a template snapshot (or take one from a playthrough near the target).
- Set
positionto a map adjacent to the new one (or warp in-game with--warp <NewMap>,x,y— the new map needs its Rust registration done, see the new-map skill; in the editor Playtest the runtime override covers it without a rebuild). - Put the new species in
party(or plan togive_pokemonit live) with coherent stats: recomputemax_hp/stats for its level from itsbaseStats, settotal_expon itsgrowthRatecurve,ppfrom the moves' base PP. - Set only the event flags your test needs — prefer the debug server's
set_flagfor iteration speed.
Gotchas
script_flagswas removed fromSaveData— old snapshots carrying it still load, but those edits are silently dropped. Named flags =event_flagsbitset only; runtime-only__OBJ_HIDDEN_*/__OBJ_SHOWN_*keys live outside the save (pokered.script_flags.jsonnext to the native app).event_flagsmust stay a 320-byte array — the loader sizes it exactly (EVENT_FLAGS_SIZE).- A party mon's
hpmay not exceedmax_hp; keepmoves/pplengths at 4. - charmap name fields are byte arrays, not strings — decode with
pokered_data::charmapif you need to read them.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtools/pokered-editor/skills/save-construction/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/liuyanghejerry/open-pokered/save-construction)