Pokeswift parity fix

From Dimillian/PokeSwift · View interactive version

Pokeswift parity fix is an AI agent skill from the GitHub repository Dimillian/PokeSwift. Investigate and fix PokeSwift gameplay parity regressions against `pret/pokered` using the repo's source-driven pipeline. Use when a user reports behavior drift from Pokemon Red, asks for parity work in battle/progression/maps/save/load/audio/UI, needs tracing from pokered assembly and data through

How to use this skill

Skill file

Pokeswift Parity Fix

Read AGENTS.md and SWIFT_PORT.md before changing milestone-sensitive behavior.

Prefer source-driven fixes. Do not patch runtime behavior if the real defect lives in extraction, generated content, or a broken contract between modules.

Workflow

  1. Define the exact parity target.

Capture the user-visible behavior that should match Red.

If the report is vague, anchor it to a concrete flow: map transition, trainer battle, move effect, blackout, evolution, audio cue, save/load path, or UI presentation beat.

  1. Reproduce before editing.

Start with git status --short.

Read the owning implementation instead of guessing.

Use the smallest reproduction that proves the bug: focused tests, telemetry traces, or a native app run.

  1. Trace the ownership chain.

Use this order whenever behavior originates from Red:

pret/pokered asm/data -> PokeExtractCLI -> Content/Red -> PokeContent/PokeDataModel -> PokeCore -> PokeUI/PokeMac.

Stop at the first layer that diverges from expected behavior and fix that layer.

  1. Patch the narrowest correct boundary.

Change extractor code if generated content is wrong.

Regenerate Content/Red/** instead of hand-editing generated artifacts.

Change PokeDataModel first if a shared schema contract is wrong.

Keep PokeCore headless; keep host/UI concerns out of simulation code.

  1. Validate at the correct level.

Use focused extraction/content tests for extractor changes.

Use focused runtime or UI tests for consumer changes.

Run the native app when milestone-sensitive behavior is involved.

Update SWIFT_PORT.md in the same change set when scope, milestone status, or a meaningful parity boundary changes.

Ownership Guide

Own parser, normalization, and generated manifest bugs.

Search here first for missing trainer text, wrong warps, map scripts, item data, encounter tables, audio metadata, and battle templates.

Treat as generated evidence, not authoring surface.

Diff it to confirm extraction output, but fix the extractor and regenerate.

Own schema and loading contracts.

Use this layer when extraction is correct but runtime sees missing or mis-modeled fields.

Own gameplay simulation, battle rules, progression flags, persistence, and telemetry production.

Fix here when the manifest is correct but runtime semantics drift from Red.

Own native presentation, rendering, app shell, and input/host behavior.

Fix here only when the underlying runtime state is correct and the visible behavior is wrong.

File Checklist

Validation Matrix

Run tuist generate --no-open.

Run ./scripts/extract_red.sh.

Then run focused PokeExtractCLITests and PokeContentTests.

Prefer workspace xcodebuild over swift test.

Use the smallest relevant test slice first, then broaden as needed.

Run focused PokeUITests or PokeRenderTests, then build PokeMac.

Use POKESWIFT_WATCH_MODE=0 ./scripts/launch_app.sh.

Probe telemetry endpoints such as /health and /quit when relevant.

Failure Shields

Review Mode

When asked to review a parity patch instead of fixing it:

Output Expectations

Report these points clearly:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.