.agents/skills/pokeswift-tuist-refactor-guard/SKILL.md
Plan, review, and execute PokeSwift refactors without breaking the Tuist workspace, target graph, or module ownership boundaries. Use when moving or splitting Swift files, reorganizing `Sources/` or `App/`, decomposing large runtime or UI files, cleaning up feature slices, or checking whether a proposed refactor is safe for PokeSwift's Tuist-based workspace.
npx skillsauth add Dimillian/PokeSwift pokeswift-tuist-refactor-guardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read AGENTS.md and SWIFT_PORT.md before changing milestone-sensitive code.
Optimize for safe structure changes, not broad churn. Keep public behavior stable unless the user explicitly asked for behavior changes.
Map the refactor boundary first.
Start with git status --short.
Identify which layer owns the change: PokeExtractCLI, PokeContent, PokeDataModel, PokeCore, PokeUI, PokeTelemetry, or App/PokeMac.
Prefer one ownership slice at a time.
Preserve the target graph.
Do not invent new targets unless the user explicitly needs an architectural change.
Prefer moving logic inside existing targets and files that already compile under the current Project.swift.
Keep façade APIs stable when splitting oversized files so downstream call sites do not drift unnecessarily.
Refactor by feature slice. Split large files along existing seams: app shell into coordinator, router, path, scene, or input bridge pieces; runtime into state, title, field, dialogue, scripts, battle, telemetry, or save extensions; UI into scene, shared view, render, and props-builder files. Keep extracted helpers close to the current target-owned boundary.
Regenerate Tuist immediately after moves or deletions.
After renames, deletions, or new source files, run tuist generate --no-open before deeper validation.
In this repo, stale generated project references are a common failure mode after file moves.
Validate in layers. Run the smallest relevant focused tests first. Then run the broader workspace or app build that matches the refactor surface. If scripts mutate generated metadata, restore or regenerate it before final staging.
GameRuntime-scale changes
Keep the façade stable.
Extract extensions by domain such as +State, +Title, +Field, +Dialogue, +Scripts, +Battle, +Telemetry, or +Save.
PokeUI scene cleanup
Separate scene props, stage views, overlays, and shared primitives.
Do not move gameplay logic from PokeCore into SwiftUI views.
PokeMac shell changes
Split host concerns such as lifecycle, commands, launch orchestration, and activation behavior without changing gameplay ownership.
PokeExtractCLI and content-loading changes
Keep extraction deterministic and runtime consumption explicit.
Do not let a refactor hide a schema change.
After file moves, deletes, or additions:
Run tuist generate --no-open.
For runtime or shared logic refactors:
Prefer xcodebuild -workspace PokeSwift.xcworkspace -scheme PokeSwift-Workspace -derivedDataPath .build/DerivedData test.
For UI-only refactors:
Run the smallest relevant PokeUITests or PokeRenderTests, then build PokeMac.
For app-shell changes:
Build with ./scripts/build_app.sh.
Use ./scripts/launch_app.sh only when native run behavior is part of the refactor risk.
For extractor-adjacent refactors:
Run ./scripts/extract_red.sh and focused extractor/content tests if the change could affect generated artifacts or content loading.
Content/Red/** files to compensate for refactor fallout.swift test; this repo validates through the workspace.Project.swift first.When reviewing a proposed refactor:
tuist generate --no-open was run after moves.Report these points clearly:
tools
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 `PokeExtractCLI`, `Content/Red`, and `PokeCore` or `PokeUI`, or wants a PokeSwift parity review or fix instead of generic Swift refactoring.
tools
Investigate, implement, and validate PokeSwift extraction or shared-contract changes without breaking the source-driven pipeline. Use when work touches `PokeExtractCLI`, `PokeDataModel`, `PokeContent`, generated `Content/Red` artifacts, or any bug where the issue may be in extracted data, schema shape, content loading, or extractor-to-runtime contract drift.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.