Agent SkillsDimillian/PokeSwift › pokeswift-extractor-contract-change

pokeswift-extractor-contract-change

GitHub

指导修复PokeSwift提取器及共享契约变更,确保不破坏源驱动管道。涵盖数据模型、内容加载及运行时契约漂移的排查与验证流程。

.agents/skills/pokeswift-extractor-contract-change/SKILL.md Dimillian/PokeSwift

Trigger Scenarios

PokeExtractCLI或PokeDataModel变更 生成的Content/Red制品异常 提取数据或Schema形状错误 提取器到运行时的契约漂移

Install

npx skills add Dimillian/PokeSwift --skill pokeswift-extractor-contract-change -g -y
More Options

Non-standard path

npx skills add https://github.com/Dimillian/PokeSwift/tree/main/.agents/skills/pokeswift-extractor-contract-change -g -y

Use without installing

npx skills use Dimillian/PokeSwift@pokeswift-extractor-contract-change

指定 Agent (Claude Code)

npx skills add Dimillian/PokeSwift --skill pokeswift-extractor-contract-change -a claude-code -g -y

安装 repo 全部 skill

npx skills add Dimillian/PokeSwift --all -g -y

预览 repo 内 skill

npx skills add Dimillian/PokeSwift --list

SKILL.md

Frontmatter
{
    "name": "pokeswift-extractor-contract-change",
    "description": "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."
}

PokeSwift Extractor Contract Change

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

Treat generated content as evidence, not authoring surface. Prefer fixing the first broken contract layer instead of compensating in runtime code.

Workflow

  1. Define the failing contract. Capture the exact value or shape that is wrong: missing dialogue ID, wrong warp/checkpoint, broken map script, bad trainer manifest, missing audio cue metadata, stale item/species/move field, or loader decode mismatch.

  2. Trace the first diverging layer. Use this order: pret/pokered asm/data -> PokeExtractCLI -> Content/Red -> PokeDataModel/PokeContent -> PokeCore/PokeUI. Fix the first layer that differs from the expected source-driven result.

  3. Pick the right ownership boundary. If the extracted value is wrong, change PokeExtractCLI. If the extracted value is right but the shared model cannot represent it, change PokeDataModel first. If the model is right but loading or validation is wrong, change PokeContent. Only change PokeCore or PokeUI after the upstream contract is correct.

  4. Regenerate instead of patching artifacts. After extractor changes, run ./scripts/extract_red.sh. Never hand-edit Content/Red/** as the fix.

  5. Validate upstream first, then downstream. Run focused PokeExtractCLITests and PokeContentTests. Then run the smallest runtime or UI tests that consume the changed contract. Update SWIFT_PORT.md if the shipped scope, milestone boundary, or system ledger changed.

Ownership Guide

  • PokeExtractCLI Own parsing, normalization, template assembly, and deterministic manifest generation. Search here for battle text templates, trainer dialogues, encounter tables, map objects/scripts, warps, marts, items, audio cues, and source-derived flags.

  • Content/Red Treat as generated output. Diff it to confirm what changed, but do not author fixes here.

  • PokeDataModel Own shared manifests and save/telemetry schemas. Put contract changes here before duplicating structure in loaders or runtime code.

  • PokeContent Own content loading, validation, and repo-contract tests. Fix this layer when manifests are correct but decoding, validation, or loader defaults are wrong.

  • PokeCore and PokeUI Consume contracts. Change these only after upstream data and shared types are proven correct.

Common Triggers

  • wrong Pokecenter blackout checkpoint or player start location
  • missing trainer lose dialogue or battle text token
  • battle text template drift against common_text.asm
  • encounter table, mart, item, species, move, or evolution manifest mismatch
  • audio metadata or dialogue-event extraction mismatch
  • schema bumps that require loader and save defaults
  • Content/Red diffs that look suspicious after extractor work

File Checklist

Validation Matrix

  • If extraction logic changed: Run ./scripts/extract_red.sh.

  • If manifests or schemas changed: Run focused PokeExtractCLITests and PokeContentTests.

  • If runtime consumers changed because of the contract: Run the smallest relevant PokeCoreTests or PokeUITests slice.

  • If file moves or target-sensitive edits happened during the change: Run tuist generate --no-open before broader validation.

Failure Shields

  • Do not hand-edit Content/Red/**.
  • Do not bury schema drift in runtime if statements.
  • Do not change runtime behavior first when the extractor output is already wrong.
  • Do not stop at compile success; prove regenerated artifacts and loaders both validate.
  • Do not forget save/schema coupling when shared models change.

Review Mode

When reviewing an extractor or contract patch:

  • Start from git diff --stat and the changed generated artifacts.
  • Check whether the extractor output matches the expected Red source or just "looks plausible."
  • Look for missing shared-model updates when new fields appear.
  • Look for loader defaults or decode paths that silently discard new data.
  • Treat unexplained Content/Red diffs as first-class findings.

Output Expectations

Report these points clearly:

  • expected source-driven contract
  • first diverging layer
  • files changed and why
  • regenerated artifacts touched
  • upstream and downstream validation run
  • whether SWIFT_PORT.md changed

Version History

  • 8fc87c2 Current 2026-07-25 10:53

Same Skill Collection

.agents/skills/pokeswift-parity-fix/SKILL.md
.agents/skills/pokeswift-tuist-refactor-guard/SKILL.md

Metadata

Files
0
Version
8fc87c2
Hash
d093daf1
Indexed
2026-07-25 10:53

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 13:33
浙ICP备14020137号-1 $방문자$