원클릭으로
golden-test
Write or update low-noise golden prompt tests in tests/, including minimal decks, replay scripts, and golden regeneration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write or update low-noise golden prompt tests in tests/, including minimal decks, replay scripts, and golden regeneration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Debug a failing golden test from GitHub Actions logs and fix the root cause without papering over nondeterminism.
Investigate a game from raw logs, trace bugs to source code, and file detailed issues. Use for deeper debugging than export-only analysis.
Repo-specific validation and PR instructions for mage-bench.
Find Magic cards for compact golden-test scenarios using existing repo goldens, curated references, and Scryfall search recipes.
Analyze exported game files to assess gameplay, model decisions, and likely bugs without raw logs. Use for quick game triage.
Create a new game export schema version, migration module, and related tests.
SOC 직업 분류 기준
| name | golden-test |
| description | Write or update low-noise golden prompt tests in tests/, including minimal decks, replay scripts, and golden regeneration. |
Use this when adding a new gameplay golden or tightening an existing one.
Read only what you need:
doc/golden-prompts.md for the full modeltests/golden_helpers.py for deck constants and run_golden_scenariotest_golden_bolt_on_stack.py, test_golden_clone_copies_memnite.py, or test_golden_dark_depths_combo.pyCapture the smallest realistic game history that still exercises the mechanic under test.
Golden tests get noisy fast. Prefer:
Black Lotus, Lotus Petal, cheap rocks) over waiting extra turns for landspass_priority(until=...) yields to jump over irrelevant phasesAvoid:
If the mechanic fundamentally requires time to pass, keep the script short anyway and make each turn do real work.
Golden decks are deterministic. The first 7 cards are the opening hand because shuffling is disabled.
Rules:
Mage.SetsIf you know the mechanic but not the exact cards, use card-finder before
inventing a deck from memory. Start with
.claude/skills/card-finder/references/golden-test-cards.md, then use
uv run python -m magebench.cli.find_test_cards --list-recipes or a targeted
--query search. Prefer reusable utility cards from that reference first, then
use the helper to find narrower one-off cards when the scenario really needs
them.
Predict short IDs in comments and replay scripts. IDs are assigned alphabetically by card name starting at p3 (p1/p2 are players).
Prompt and export goldens now keep literal MCP short IDs and literal stripped bridge output. Embedded JSON key order is normalized, but raw XMage HTML handle noise (object_id='UUID', </font> [abc]) should be removed at the source boundary instead of redacted in goldens.
Use the standard mulligan preamble:
{"name": "pass_priority", "arguments": {}},
{"name": "choose_action", "arguments": {"choice": "0"}},
{"name": "pass_priority", "arguments": {}},
{"name": "choose_action", "arguments": {"choice": "no"}},
Prefer choice="pN" for stable card/permanent selection when you know the ID.
Use pass_priority for phase advancement and choose_action for the decision itself.
Important patterns:
pass_priority auto-passes once before stopping againchoose_action can chain through pending follow-up actions without running the auto-pass loopchoose_action calls when you need the stack to stay intactpass_priority(until="declare_attackers"), until="postcombat_main", until="my_turn", etc. to skip irrelevant prompts cleanlyLow-noise heuristics:
Fact or Fiction, put the split cards at positions 8-12 instead of drawing for several turnsTouch the minimum set of files:
tests/decks/<name>.dcktests/test_golden_<name>.pytests/golden/Mark gameplay goldens with @pytest.mark.golden.
If you are adding a helper/unit test around golden infrastructure rather than a
real golden integration, do not name it test_golden_*.py unless it is
actually marked @pytest.mark.golden; the golden naming convention tests
enforce that contract.
Use the make targets only. Direct pytest -m golden is blocked.
For focused iteration:
make regen-golden K=<name>
Then inspect the generated prompt/export and confirm:
invalid_choice or similar tool errorsAfter the targeted goldens are right, run:
make test
make check also covers golden tests in CI, but for Python changes in src/magebench/ or tests/, at minimum run make test locally.
If regeneration fails:
until= yields or remove cards causing irrelevant actionsDo not paper over nondeterminism. If a golden is flaky, use the investigate-golden-flake skill and fix the root cause.