$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-genre-puzzleExpert blueprint for puzzle games including undo systems (Command pattern for state reversal), grid-based logic (Sokoban-style mechanics), non-verbal tutorials (teach through level design), win condition checking, state management, and visual feedback (instant confirmation of val
| 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: Puzzle |
| 8 | |
| 9 | Expert blueprint for puzzle games emphasizing clarity, experimentation, and "Aha!" moments. |
| 10 | |
| 11 | ## NEVER Do (Expert Anti-Patterns) |
| 12 | |
| 13 | ### Design & Player Experience |
| 14 | - NEVER punish experimentation; strictly provide **Undo/Reset** functionality to allow risk-free hypothesis testing. |
| 15 | - NEVER require pixel-perfect input for logic puzzles; strictly use **Grid Snapping** or large, forgiving hitboxes. |
| 16 | - NEVER allow undetected **Soft-Locks** (unsolvable states); strictly notify the player or provide immediate backtracking. |
| 17 | - NEVER hide the rules of the world; strictly ensure visual feedback is instant and unambiguous (e.g., powered wires must glow). |
| 18 | - NEVER skip the **Non-Verbal Tutorial** phase; strictly introduce mechanics in isolation before combining them. |
| 19 | |
| 20 | ### Grid Logic & State |
| 21 | - NEVER use floating-point numbers (`Vector2`) for grid coordinates; strictly use **Vector2i** to prevent precision drift. |
| 22 | - NEVER use `_process()` for grid-state or win-condition validation; strictly trigger checks only when a piece moves. |
| 23 | - NEVER rely on the `SceneTree` structure as the source of truth; strictly maintain grid data in a separate script/dictionary. |
| 24 | - NEVER modify a Dictionary or Array size while iterating over it; strictly use a copy or a separate queue for modifications. |
| 25 | - NEVER calculate heavy recursive solvers in `_process()`; strictly cache results or use threaded workers for solve-checks. |
| 26 | - NEVER ignore diagonal rules in pathfinding; strictly configure `AStarGrid2D.diagonal_mode` correctly. |
| 27 | |
| 28 | ### Architecture & Performance |
| 29 | - NEVER program custom command history queues manually; strictly use Godot's built-in **UndoRedo** system for reliability. |
| 30 | - NEVER intermingle "do" and "undo" logic in the same function; strictly maintain separation for predictable rollbacks. |
| 31 | - NEVER use exact floating-point equality (==); strictly use `is_equal_approx()` for spatial constraints. |
| 32 | - NEVER use `load()` for resetting large rooms dynamically; strictly use `ResourceLoader.load_threaded_request()`. |
| 33 | - NEVER leave **Tween** objects unreferenced; strictly kill active tweens before starting new movement on the same object. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## 🛠 Expert Components (scripts/) |
| 38 | |
| 39 | ### Original Expert Patterns |
| 40 | - [command_undo_redo.gd](scripts/command_undo_redo.gd) - Professional-grade Command Pattern for non-destructive state reversal and experimentation. |
| 41 | - [grid_manager.gd](scripts/grid_manager.gd) - Decoupled grid logic data structure for raycast-free move validation (Sokoban/Match-3). |
| 42 | |
| 43 | ### Modular Components |
| 44 | - [puzzle_pathfinder.gd](scripts/puzzle_pathfinder.gd) - AStarGrid2D configuration for optimized pathfinding on 2D grids. |
| 45 | - [puzzle_history.gd](scripts/puzzle_history.gd) - UndoRedo system implementation using the Action Command pattern. |
| 46 | - [puzzle_saver.gd](scripts/puzzle_saver.gd) - JSON-based serialization for saving/restoring complex puzzle states. |
| 47 | - [shuffle_bag.gd](scripts/shuffle_bag.gd) - Non-repeating randomizer for fair distribution of puzzle elements. |
| 48 | - [perspective_overlay.gd](scripts/perspective_overlay.gd) - 3D-to-2D projection bridge for world-space puzzle mechanics. |
| 49 | - [tile_animator.gd](scripts/tile_animator.gd) - Safe tween-based movement system using Callables for logic sync. |
| 50 | - [match_three_logic.gd](scripts/match_three_logic.gd) - Recursive flood-fill and match detection logic. |
| 51 | - [grid_input_manager.gd](scripts/grid_input_manager.gd) - Device-agnostic input routing for grid interaction. |
| 52 | - [sleepy_block.gd](scripts/sleepy_block.gd) - Physics object stabilizer to prevent unintended solver jitter. |
| 53 | - [puzzle_validator.gd](scripts/puzzle_validator.gd) - Array reduction component for evaluating complex win conditions. |
| 54 | |
| 55 | --- |
| 56 | |
| 57 | ## Core Loop |
| 58 | 1. **Observation**: Player assesses the level layout and mechanics. |
| 59 | 2. **Experimentation**: Player interacts with elements (push, pull, toggle). |
| 60 | 3. **Feedback**: Game reacts (door opens, laser blocked). |
| 61 | 4. **Epiphany**: Player understands the logic ("Aha!" moment). |
| 62 | 5. **Execution**: Player executes the solution to advance. |
| 63 | |
| 64 | ## Skill Chain |
| 65 | |
| 66 | | Phase | Skills | Purpose | |
| 67 | |-------|--------|---------| |
| 68 | | 1. Int |