All skills
thedivergentai avatar

/godot-master

@4c4d0ff

Consolidated expert library for professional Godot 4.7+ game and application development. Orchestrates 92 Domain Skills through architectural workflows, anti-pattern catalogs, performance budgets, and Server API patterns. Use when: (1) starting a new Godot project, (2) designing game or app architecture, (3) building entity/component systems, (4) debugging performance or physics issues, (5) choosing between 2D/3D approaches, (6) implementing multiplayer, (7) optimizing draw calls or script time, (8) porting between platforms, (9) migrating from 4.6 to 4.7. Primary entry point for ALL Godot development tasks. Keywords: Godot 4.7, AreaLight3D, HDR, Asset Store, godot-master.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-master

This session only. Nothing lands on disk.

referencesinventory-system-elite-technical-patterns.md

≈668 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Elite Godot 4.x Patterns

1. Refined Partial Stacking & Overflow Logic

Decouple data from UI using Resource arrays. Use a two-pass approach: fill existing partial stacks first, then seek empty slots for overflow.

# inventory_data.gd
func add_item(item: Item, amount: int) -> int:
    var remaining := amount
    # Pass 1: Fill partial stacks
    for slot in slots:
        if slot.item == item and slot.amount < item.max_stack:
            var space := item.max_stack - slot.amount
            var to_add := mini(remaining, space)
            slot.amount += to_add
            remaining -= to_add
            if remaining == 0: break
            
    # Pass 2: Fill empty slots
    if remaining > 0:
        for slot in slots:
            if slot.is_empty():
                var to_add := mini(remaining, item.max_stack)
                slot.item = item
                slot.amount = to_add
                remaining -= to_add
                if remaining == 0: break
    
    inventory_changed.emit()
    return remaining # Returns overflow

2. Spatial Grid Inventory (Tetris-Style)

Use a Dictionary keyed by Vector2i for O(1) coordinate lookups. Items occupy multiple cells defined by a footprint.

# grid_inventory.gd
class_name GridInventory extends Resource

var _grid: Dictionary[Vector2i, Item] = {}

func can_place(item: Item, pos: Vector2i) -> bool:
    for offset in item.grid_footprint:
        var check_pos := pos + offset
        if _grid.has(check_pos) or is_out_of_bounds(check_pos):
            return false
    return true

func place_item(item: Item, pos: Vector2i) -> void:
    if can_place(item, pos):
        for offset in item.grid_footprint:
            _grid[pos + offset] = item
        emit_changed()

3. Safe Resource Serialization (JSON Mapping)

Avoid bloating save files with recursive Resource data. Save only the resource_path and use ResourceLoader.load() at runtime to restore references to static item blueprints.

# inventory_serializer.gd
func save_inventory(slots: Array[InventorySlot]) -> void:
    var data := []
    for slot in slots:
        if not slot.is_empty():
            data.append({
                "path": slot.item.resource_path,
                "amount": slot.amount
            })
    var file := FileAccess.open("user://inv.json", FileAccess.WRITE)
    file.store_string(JSON.stringify(data))

func load_inventory() -> void:
    # ... read JSON string ...
    for entry in data:
        var slot := InventorySlot.new()
        slot.item = ResourceLoader.load(entry.path) # Efficiently loads cached reference
        slot.amount = entry.amount

Source: SKILL.md on GitHub

1 alert16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The godot-master skill is a comprehensive expert library for Godot 4.7+ development. it provides architectural frameworks, anti-pattern catalogs, and automation scripts for build orchestration, project auditing, and visual QA. The skill demonstrates high security awareness by instructing agents on the safe use of risky engine APIs and recommending the use of boundary markers when processing untrusted scene data. No malicious patterns or unauthorized exfiltration vectors were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM · 1 issue

  • Runlayer6mo

    35/277 files flagged

Signed by skilld at 4c4d0ff. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 3 weeks ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-master