Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

implement-cards

БесплатноБез исполняемых скриптовНе проверен

Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.

bcollazoот bcollazo★ 81 звезда на GitHub21 установка в других каталогах

Об этом скилле

Implementing Cards

To implement cards, first read the models module and the state module. Cards are not implemented if they are a Pokemon that is missing an Ability or Attack implementation, or a Trainer card (be it a tool or a normal one) missig implementation.

Use TDD for every new card implementation:

  • Before changing the production implementation, add 1 or 2 focused tests for the new card behavior.
  • Write those tests at the same abstraction level as test_raikou_rocky_helmet_promotion_order in tests/tools/raikou_rocky_helmet_order_test.rs.
  • Keep the tests at the public Game API level, driving behavior through calls like game.apply_action(...), generate_possible_actions(), get_state_clone(), and observable game state changes.
  • Do not start implementation until those tests exist.

If the user hasn't specified what card to implement, you can use the tool:

cargo run --bin card_status

to see what cards are missing, and choose one. You can also that tool to see what is missing from the specified card.

Abilities

  • Get the details of all the cards that have the ability you want to implement by using the following script:

    • For a single card or name lookup:
    cargo run --bin search "Venusaur"
    
  • Copy the ids of cards to implement (including full art versions) in the given JSON. Only choose the ones with the ability you want to implement.

  • All abilities should use the AbilityMechanic pathway.

    • Find the ability effect text in the JSON and search for it in effect_ability_mechanic_map.rs.
    • Re-use an existing AbilityMechanic when possible. If not, add a new variant in src/actions/abilities/mechanic.rs.
    • Add or uncomment all matching map.insert(...) lines in effect_ability_mechanic_map.rs and map them to the correct AbilityMechanic with parameters.
    • Implement the mechanic logic in forecast_ability_by_mechanic in src/actions/apply_abilities_action.rs.
      • Return an Outcomes struct (see src/actions/outcomes.rs).
      • For deterministic effects: Outcomes::single_fn(|rng, state, action| { ... })
      • For coin-flip effects, use the appropriate Outcomes constructor:
        • Outcomes::binary_coin(heads_mutation, tails_mutation) for a single coin flip
        • Outcomes::binomial_by_heads(n, |heads| mutation) for N flips grouped by heads count
        • Outcomes::geometric_until_tails(max, |heads| mutation) for flip-until-tails effects
      • Keep match arms as one-liners by moving logic into helpers.
    • Implement move generation logic in can_use_ability_by_mechanic in src/move_generation/move_generation_abilities.rs.
      • Keep match arms as one-liners by moving logic into helpers.
  • If the ability is passive or hook-driven:

    • Prefer a mechanic + hook combination.
    • Put the mechanic-to-hook wiring in the relevant hook file, usually under src/hooks/.
    • forecast_ability_by_mechanic should panic! for passive mechanics, and can_use_ability_by_mechanic should return false.
  • Add 1 or 2 logic tests before implementation at the Game public API level.

    • Prefer the folder-matched integration test layout under tests/, for example tests/pokemon/..., tests/tools/..., tests/stadiums/..., or tests/mechanics/....
    • Follow test_raikou_rocky_helmet_promotion_order in tests/tools/raikou_rocky_helmet_order_test.rs in style and abstraction level.
    • Drive behavior through public APIs like game.apply_action(...) instead of internal helpers or private implementation details.
    • Do not assert on .move_generation_stack; drive behavior through public actions and resulting game state.

Attack

  • Get the details of the card with the attack you want to implement by using the following script:

    cargo run --bin search "Venusaur" --attack "Giant Bloom"
    
  • Search for the effect text in the above JSON in the effect_mechanic_map.rs file.

  • Decide if we should introduce a new Mechanic or re-use or generalize an existing one. Try to re-use existing ones first.

  • Identify all the cards that have the same effect text template, and just differ by parameters.

  • Uncomment all the // map.insert(" lines that pertain to the mechanic, and add the correct value (an Mechanic enum variant with the corresponding parameters).

  • Implement the mechanic logic in forecast_effect_attack_by_mechanic in src/actions/apply_attack_action.rs.

    • Return an Outcomes struct (see src/actions/outcomes.rs).
    • For deterministic effects: Outcomes::single_fn(|rng, state, action| { ... })
    • For coin-flip effects, use the appropriate Outcomes constructor:
      • Outcomes::binary_coin(heads_mutation, tails_mutation) - single coin flip
      • Outcomes::binomial_by_heads(n, |heads| mutation) - flip N coins, group by heads count
      • Outcomes::geometric_until_tails(max, |heads| mutation) - flip until tails
    • Keep the code as a simple one-liner in the match statement by using helper functions
Полный SKILL.md на GitHub

Установить implement-cards в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл implement-cards?

Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.

Как установить скилл implement-cards?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл implement-cards запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить implement-cards с