Godot gdscript mastery

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot gdscript mastery is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert GDScript landmine guidance: static typing opcodes, signal-up/call-down, %UniqueName/@onready lifecycle, Callable bind/unbind, await sequences, typed collections, and safe Dictionary iteration. Use for code review, refactoring hot paths, or project standards. Trigger keywords: static_typing, s

How to use this skill

Skill file

GDScript Mastery

Expert guidance for writing performant, maintainable GDScript — Godot-landmine decision trees, not a style-guide reprint.

Do NOT Load

NEVER Do in GDScript


Core Directives (decision trees + MANDATORY scripts)

1. Strong Typing & Performance

| Landmine | Decision |

|---|---|

| Hot path still Variant? | Annotate vars/returns; prefer typed collections |

| Generic math in _process? | Use typed helpers (absf, ceili, clampf) |

| Green safe-lines missing? | Fix inference with := or explicit types |

MANDATORY: typed_collections_mastery.gd, array_preallocation_perf.gd, type_checker.gd (EditorScript audit).

2. Signal Architecture

| Landmine | Decision |

|---|---|

| Child needs parent reaction? | Emit signal up — never call parent methods |

| Cross-script payload unsafe? | Typed signal name(arg: Type) |

| Connect visibility? | Prefer _ready() connects over invisible editor-only wiring |

MANDATORY: typed_signal_definitions.gd, signal_architecture_validator.gd.

3. Node Access & Lifecycle Safety

| Landmine | Decision |

|---|---|

| Need child nodes? | @onready / %UniqueName — never in _init() |

| Scene-instanced node with ctor args? | Use @export injection — _init(args) breaks PackedScene.instantiate() |

| Path lookup every frame? | Cache once; never $ / get_node in _process |

MANDATORY: safe_type_casting.gd.

4. Callable & Signal (First-Class)

| Landmine | Decision |

|---|---|

| Extra context on callback? | Callable.bind(...) |

| Discard unused signal args? | Callable.unbind(n) |

| One-off timeout logic? | Inline lambda OK; keep refs if create_callback-style longevity matters |

MANDATORY: callable_binding_context.gd, unbind_signal_args.gd, advanced_lambdas.gd, functional_lambda_logic.gd.

5. Async, Statics & Safe Collections

| Landmine | Decision |

|---|---|

| Sequence timers without threads? | await chains — see await manager |

| Global state without Autoload bloat? | static var (+ nullify large statics when done) |

| Erase while iterating Dictionary? | Clone keys first |

MANDATORY: await_sequence_manager.gd, static_var_singleton_alt.gd, dictionary_safe_iteration.gd, performance_analyzer.gd (EditorScript).

Script Catalog (all files)

| Script | When to open |

|---|---|

| typed_collections_mastery.gd | Typed Array/Dictionary opcodes |

| functional_lambda_logic.gd | reduce / all / any |

| advanced_lambdas.gd | Higher-order Callables |

| safe_type_casting.gd | as + null checks |

| typed_signal_definitions.gd | Typed signal boundaries |

| callable_binding_context.gd | bind() context injection |

| unbind_signal_args.gd | unbind() arity trim |

| await_sequence_manager.gd | Non-blocking await flows |

| array_preallocation_perf.gd | resize() pre-alloc |

| static_var_singleton_alt.gd | Lightweight global state |

| dictionary_safe_iteration.gd | Safe erase-while-iterate |

| type_checker.gd | EditorScript typing audit |

| performance_analyzer.gd | EditorScript hot-path scan |

| signal_architecture_validator.gd | EditorScript signal-up checks |

Quick Landmines

Expert knowledge (on demand)

LLM-ignorance rule: If a general agent would not know it before reading, load the reference — never delete expert deltas.

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.