$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-genre-survivalExpert blueprint for survival games (Minecraft, Don't Starve, The Forest, Rust) covering needs systems, resource gathering, crafting recipes, base building, and progression balancing. Use when building open-world survival, crafting-focused, or resource management games. Keywords
| 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: Survival |
| 8 | |
| 9 | Resource scarcity, needs management, and progression through crafting define survival games. |
| 10 | |
| 11 | ## NEVER Do (Expert Anti-Patterns) |
| 12 | |
| 13 | ### Physiology & Needs |
| 14 | - NEVER use constant "Needs" decay; strictly scale with activity (e.g., **Sprinting** drains hunger 3x faster than idling). |
| 15 | - NEVER use Instant Death for starvation/dehydration; strictly trigger gradual HP drain and provide distinct visual/audio warnings. |
| 16 | - NEVER use float timers for exact life-critical checks; strictly use `is_equal_approx()` or `<=` to prevent 0.0 precision misses. |
| 17 | - NEVER represent world time/day cycles within UI scripts; strictly use an **AutoLoad (Singleton)** to decouple state from visuals. |
| 18 | |
| 19 | ### Gathering & Inventory |
| 20 | - NEVER make gathering tedious without progression; strictly implement **Tiered Tool Scaling** (e.g., Stone Axe = 1 wood/hit, Steel Axe = 5 wood/hit) to reward technical advancement. |
| 21 | - NEVER allow infinite inventory stacking; strictly use **Weight Capacity** or strict **Stack Limits** (e.g., 64 items) to force strategic resource management. |
| 22 | - NEVER force players to "Guess" crafting recipes; strictly use a **Discovery System** where recipes unlock upon acquiring materials. |
| 23 | - NEVER forget to **duplicate(true)** a shared Resource (like Item Durability); otherwise, all instances will break simultaneously. |
| 24 | - NEVER store heavy item/crafting definitions in Node properties; strictly use custom **Resource** containers for lightweight data. |
| 25 | |
| 26 | ### World & Performance |
| 27 | - NEVER spawn threats at Respawn Points; strictly enforce a **Safe Zone radius** (Beds/Spawn) where enemy spawning is prohibited. |
| 28 | - NEVER instance 10,000 individual `MeshInstance3D` nodes for foliage; strictly use **MultiMeshInstance3D** for batched draw calls. |
| 29 | - NEVER load massive world chunks synchronously; strictly use `ResourceLoader.load_threaded_request()` to prevent hitches. |
| 30 | - NEVER save complex dictionaries to standard text files; strictly use binary serialization for speed and size efficiency. |
| 31 | - NEVER run procedural terrain/noise algorithms on the main thread; strictly offload to the **WorkerThreadPool**. |
| 32 | - NEVER hardcode massive crafting tables in GDScript; strictly use `ConfigFile` or JSON for easy balancing and modding. |
| 33 | |
| 34 | --- |
| 35 | |
| 36 | ## 🛠 Expert Components (scripts/) |
| 37 | |
| 38 | ### Original Expert Patterns |
| 39 | - [inventory_slot_resource.gd](scripts/inventory_slot_resource.gd) - Data-driven inventory slot model using Resources for seamless serialization and durability tracking. |
| 40 | - [survival_patterns.gd](scripts/survival_patterns.gd) - 10 Essential Survival Expert Patterns (Decay scaling, Environment tweens, MultiMesh optimization). |
| 41 | |
| 42 | ### Modular Components |
| 43 | - [interactable.gd](scripts/interactable.gd) - Universal interface for harvesting, picking up items, and world triggers. |
| 44 | - [inventory_data.gd](scripts/inventory_data.gd) - Core business logic for grid-based inventories and stacking. |
| 45 | - [inventory_slot_data.gd](scripts/inventory_slot_data.gd) - Lightweight data container for UI-to-Logic inventory communication. |
| 46 | - [inventory_data.gd](scripts/inventory_data.gd) - High-performance Resource-based storage with stack limits and metadata support. |
| 47 | - [inventory_data.gd](scripts/inventory_data.gd) - Master item definition for weight, stack-size, and consumption effects (Resource-based). |
| 48 | |
| 49 | --- |
| 50 | |
| 51 | | Phase | Skills | Purpose | |
| 52 | |-------|--------|---------| |
| 53 | | 1. Data | `resources`, `custom-resources` | Item data (weight, stack size), Recipes | |
| 54 | | 2. UI | `grid-containers`, `drag-and-drop` | Inventory management, crafting menu | |
| 55 | | 3. World | `tilemaps`, `noise-generation` | Procedural terrain, resource spawning | |
| 56 | | 4. Logic | `state-machines`, `signals` | Player stats (Needs), Interaction system | |
| 57 | | 5. Save | `file-system`, `json-serialization` | Saving world state, inventory, player stats | |
| 58 | |
| 59 | ## Architecture Overview |
| 60 | |
| 61 | ### 1. Item Data (Resource-based) |
| 62 | Everything in the inventory is an Item. |
| 63 | |
| 64 | ```gdscript |
| 65 | # item_data.gd |
| 66 | extends Resource |
| 67 | class_name ItemData |
| 68 | |
| 69 | @export var id: String |
| 70 | @export var name: String |
| 71 | @export var icon: Texture2D |
| 72 | @export var max_stack: int = 64 |
| 73 | @export var weight: float = 1.0 |
| 74 | @export var consumables: Dictionary # { "hunger": 10, "health": 5 } |
| 75 | ``` |
| 76 | |
| 77 | ### 2. Inventory System |