pokeswift-tuist-refactor-guard

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.

328 stars

Best use case

pokeswift-tuist-refactor-guard is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using pokeswift-tuist-refactor-guard should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pokeswift-tuist-refactor-guard/SKILL.md --create-dirs "https://raw.githubusercontent.com/Dimillian/PokeSwift/main/.agents/skills/pokeswift-tuist-refactor-guard/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pokeswift-tuist-refactor-guard/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pokeswift-tuist-refactor-guard Compares

Feature / Agentpokeswift-tuist-refactor-guardStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# PokeSwift Tuist Refactor Guard

Read [AGENTS.md](../../../AGENTS.md) and [SWIFT_PORT.md](../../../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.

## Workflow

1. 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.

2. 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.

3. 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.

4. 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.

5. 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.

## Refactor Patterns

- `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.

## File Checklist

- Read [Project.swift](../../../Project.swift), [Workspace.swift](../../../Workspace.swift), and [Tuist.swift](../../../Tuist.swift) before making graph-sensitive changes.
- Read [AGENTS.md](../../../AGENTS.md) for repo constraints.
- Read [SWIFT_PORT.md](../../../SWIFT_PORT.md) if the touched code affects milestones, parity boundaries, or shipped scope.
- Inspect the owning target under [Sources](../../../Sources) or [App](../../../App) before moving code.

## Validation Matrix

- 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.

## Failure Shields

- Do not hand-edit generated `Content/Red/**` files to compensate for refactor fallout.
- Do not trust `swift test`; this repo validates through the workspace.
- Do not leave file moves unverified; regenerate Tuist immediately.
- Do not widen a refactor into behavior changes unless the user asked for both.
- Do not move code across target boundaries casually; check dependencies in `Project.swift` first.
- Do not edit generated Xcode artifacts as a source of truth.

## Review Mode

When reviewing a proposed refactor:

- Check whether the write set crosses too many targets at once.
- Look for hidden contract changes in schemas, save models, telemetry, or generated content.
- Confirm the public API remains stable where the refactor claims behavior preservation.
- Ask whether `tuist generate --no-open` was run after moves.
- Treat stale project references, missing target membership, and broken workspace builds as first-class findings.

## Output Expectations

Report these points clearly:

- refactor boundary
- target ownership
- whether the Tuist graph stayed stable
- validation run
- residual risks, especially around moved files, generated content, and unverified runtime paths

Related Skills

pokeswift-parity-fix

328
from 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 `PokeExtractCLI`, `Content/Red`, and `PokeCore` or `PokeUI`, or wants a PokeSwift parity review or fix instead of generic Swift refactoring.

pokeswift-extractor-contract-change

328
from Dimillian/PokeSwift

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.

safety-guard

144923
from affaan-m/everything-claude-code

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

DevelopmentClaude

macos-menubar-tuist-app

31392
from sickn33/antigravity-awesome-skills

Build, refactor, or review SwiftUI macOS menubar apps that use Tuist.

Developer ToolsClaude

fp-refactor

31392
from sickn33/antigravity-awesome-skills

Comprehensive guide for refactoring imperative TypeScript code to fp-ts functional patterns

Software DevelopmentClaude

context-guardian

31392
from sickn33/antigravity-awesome-skills

Guardiao de contexto que preserva dados criticos antes da compactacao automatica. Snapshots, verificacao de integridade e zero perda de informacao.

Agent Utilities & MonitoringClaudeCursorGemini

codebase-cleanup-refactor-clean

31392
from sickn33/antigravity-awesome-skills

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Code Refactoring & QualityClaude

code-refactoring-tech-debt

31392
from sickn33/antigravity-awesome-skills

You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti

code-refactoring-refactor-clean

31392
from sickn33/antigravity-awesome-skills

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Developer ToolsClaude

code-refactoring-context-restore

31392
from sickn33/antigravity-awesome-skills

Use when working with code refactoring context restore

Code AnalysisClaude

security-guardian

3891
from openclaw/skills

Automated security auditing for OpenClaw projects. Scans for hardcoded secrets (API keys, tokens) and container vulnerabilities (CVEs) using Trivy. Provides structured reports to help maintain a clean and secure codebase.

Security

guardian-wall

3891
from openclaw/skills

Mitigate prompt injection attacks, especially indirect ones from external web content or files. Use this skill when processing untrusted text from the internet, user-uploaded files, or any external source to sanitize content and detect malicious instructions (e.g., "ignore previous instructions", "system override").

Security