$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-genre-card-gameExpert blueprint for digital card games (CCG/Deckbuilders) including card data structures (Resource-based), deck management (draw/discard/reshuffle), turn logic, hand layout (arcing), drag-and-drop UI, effect resolution (Command pattern), and visual polish (godot-tweening, shader
| 1 | ## Godot 4.7 Baseline |
| 2 | |
| 3 | - Expert patterns in this skill target **Godot 4.7+** (stable, 2026-06-18). |
| 4 | - Consult the [Godot 4.7 migration guide](https://docs.godotengine.org/en/4.7/tutorials/migrating/upgrading_to_godot_4.7.html) when upgrading projects from 4.6. |
| 5 | - **NEVER** assume 4.6 defaults (stretch mode, audio area_mask, RichTextLabel percent flags) without checking 4.7 migration notes. |
| 6 | |
| 7 | # Genre: Card Game |
| 8 | |
| 9 | Expert blueprint for digital card games with data-driven design and juicy UI. |
| 10 | |
| 11 | ## NEVER Do (Expert Anti-Patterns) |
| 12 | |
| 13 | ### Logic & Architecture |
| 14 | - NEVER hardcode card logic inside UI scripts; strictly encapsulate gameplay effects in **`Callable` objects** or **Command resources** pushed to a LIFO stack. |
| 15 | - NEVER perform board-state calculations (Power/Toughness) in `_process()`; strictly use **Signal-driven triggers** or a centralized `EffectStack` resolver. |
| 16 | - NEVER forget **LIFO Stack Resolution**; strictly use **`Array.push_back()`** and **`Array.pop_back()`** to resolve reactions from top-to-bottom. |
| 17 | |
| 18 | ### UX & Animation |
| 19 | - NEVER skip **Z-Index management** during drag-and-drop; strictly raise the card to the front on click to prevent it sliding under other cards. |
| 20 | - NEVER allow instant card "teleportation" between piles; strictly use **Tween animations** (0.2s+) to give cards a tactile, physical feel. |
| 21 | - NEVER use `global_position` for cards in hand; strictly position them using a **`Curve2D`** (Bezier) layout with **`sample_baked()`** for smooth, non-circular arcs. |
| 22 | - NEVER allow instant card "teleportation" between piles; strictly use **`create_tween()`** and **`tween_property`** chainings (0.2s+) for juicy card-feel. |
| 23 | |
| 24 | ### Deck & State Management |
| 25 | - NEVER forget to handle **Empty Deck** scenarios; strictly implement auto-reshuffle of the discard pile to prevent soft-locks. |
| 26 | - NEVER use floating point numbers for discrete card stats; strictly use `int` for Costs, Attack, and Health to avoid precision drift. |
| 27 | - NEVER use standard Control nodes for mass tokens/battlefields; strictly use **`_draw()` custom drawing** to bypass SceneTree overhead when rendering 100+ cards or map icons. |
| 28 | - NEVER rely on SceneTree order for hand logic; strictly manage logical order in an **Array** and update visuals via **`queue_redraw()`**. |
| 29 | - NEVER erase array elements during a standard `for` loop; strictly iterate in reverse or use `filter()` to avoid indexing errors. |
| 30 | - NEVER forget to provide parameterless constructors in `_init()`; otherwise, Resources will fail to load in the Inspector. |
| 31 | --- |
| 32 | |
| 33 | ## 🛠 Expert Components (scripts/) |
| 34 | |
| 35 | ### Original Expert Patterns |
| 36 | - [card_effect_resolution.gd](scripts/card_effect_resolution.gd) - Stack-based effect resolver (LIFO/FIFO) handling nested triggers and counter-play. |
| 37 | |
| 38 | ### Modular Components |
| 39 | - [card_data_resource.gd](scripts/card_data_resource.gd) - Data-driven card definitions allowing Inspector-based design. |
| 40 | - [deck_shuffle_bag.gd](scripts/deck_shuffle_bag.gd) - Secure randomization patterns for uniform card distribution. |
| 41 | - [turn_state_machine.gd](scripts/turn_state_machine.gd) - Managing rigid phases (Draw, Play, Combat) via state matching. |
| 42 | - [card_drag_drop.gd](scripts/card_drag_drop.gd) - Implementation of native `_get_drag_data()` for Control nodes. |
| 43 | - [board_query_filter.gd](scripts/board_query_filter.gd) - Functional `filter()` patterns for querying board metadata. |
| 44 | - [card_tween_manager.gd](scripts/card_tween_manager.gd) - Managing interruptible card juice and board transitions. |
| 45 | - [reactive_card_ui.gd](scripts/reactive_card_ui.gd) - Resource-signal driven UI for automatic visual state updates. |
| 46 | - [board_state_dictionary.gd](scripts/board_state_dictionary.gd) - Grid-based tracking (Vector2i) decoupled from Node order. |
| 47 | - [match_state_resetter.gd](scripts/match_state_resetter.gd) - Clean-up pattern for in-match temporary Resource modifications. |
| 48 | - [deck_builder_validator.gd](scripts/deck_builder_validator.gd) - Backend logic for deck-building constraints and mana curves. |
| 49 | |
| 50 | --- |
| 51 | |
| 52 | ## Core Loop |
| 53 | 1. **Draw**: Player draws cards from a deck into their hand. |
| 54 | 2. **Evaluate**: Player assesses board state, mana/energy, and card options. |
| 55 | 3. **Play**: Player plays cards to trigger effects (damage, buff, summon). |
| 56 | 4. **Resolve**: Effects occur immediately or go onto a stack. |
| 57 | 5. **Discard/End**: Unused cards are discarded (roguelike) or kept (TCG), turn ends. |
| 58 | |
| 59 | ## Skill Chain |
| 60 | |
| 61 | | Phase | Skills | Purpose | |
| 62 | |-------|--------|---------| |
| 63 | | 1. Data | `resources`, `custom-resources` | Defining |