thedivergentai/gd-agentic-skills

godot-gdscript-mastery

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.

First seen Feb 10, 2026

Installation

$ npx skills add thedivergentai/gd-agentic-skills --skill godot-gdscript-mastery

Summary

  • 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, signal_architecture, unique_nodes, @onready, class_name, signal_up_call_down, Callable.bind, typed_collections, await_sequence.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedivergentai/gd-agentic-skills · top by installs.

npx skills add thedivergentai/gd-agentic-skills

Browse all from thedivergentai/gd-agentic-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 678
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 13,416 B
  • docs SUMMARY.md 456 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 417 installs

SKILL.md

GDScript Mastery

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

Do NOT Load

  • Do not load this skill for general prose style or Godot engine version upgrades (3→4 / 4.x hops) — those live in godot-version-migration (plus official upgrading guides via that hub).
  • Do not preload every script below; open only the MANDATORY pointer for the Core Directive you are implementing.
  • Do not treat EditorScript utilities (typechecker, performanceanalyzer, signalarchitecturevalidator) as runtime gameplay code.

NEVER Do in GDScript

  • NEVER use @onready and @export on the same variable — Initialization order will cause @onready to overwrite the Inspector value.
  • NEVER modify a Dictionary's size while iterating it — Use dict.keys().duplicate() or iterate a clone to safely erase elements.
  • NEVER use string-based connect("signal", ...) — Always use the Signal object syntax (button.pressed.connect(...)) for compile-time safety.
  • NEVER attempt to override non-virtual native engine methods — Overriding queuefree() or getclass() is unsupported and will be ignored by engine callbacks.
  • NEVER use dynamic getnode() or $ inside process() — Fetching paths every frame stalls the CPU. Cache and use @onready.
  • NEVER use Parent.method() calls — Violates "Signal Up, Call Down". Use signals to communicate with parents.
  • NEVER use is followed by a hard cast — If the type check passes but the object changes, it crashes. Use as and check for null.
  • NEVER use print() for production debugging — Use pusherror(), pushwarning(), or breakpoints.
  • NEVER pre-load huge resources in ready() — Use ResourceLoader.loadthreaded_request() for async loading.
  • NEVER use global variables in Autoloads when static var is sufficient — Static variables offer better encapsulation.

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: [typedcollectionsmastery.gd](scripts/typedcollectionsmastery.gd), [arraypreallocationperf.gd](scripts/arraypreallocationperf.gd), [typechecker.gd](scripts/typechecker.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: [typedsignaldefinitions.gd](scripts/typedsignaldefinitions.gd), [signalarchitecturevalidator.gd](scripts/signalarchitecturevalidator.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 $ / getnode in process

MANDATORY: [safetypecasting.gd](scripts/safetypecasting.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: [callablebindingcontext.gd](scripts/callablebindingcontext.gd), [unbindsignalargs.gd](scripts/unbindsignalargs.gd), [advancedlambdas.gd](scripts/advancedlambdas.gd), [functionallambdalogic.gd](scripts/functionallambdalogic.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: [awaitsequencemanager.gd](scripts/awaitsequencemanager.gd), [staticvarsingletonalt.gd](scripts/staticvarsingletonalt.gd), [dictionarysafeiteration.gd](scripts/dictionarysafeiteration.gd), [performanceanalyzer.gd](scripts/performanceanalyzer.gd) (EditorScript).

Script Catalog (all files)

Script When to open
[typedcollectionsmastery.gd](scripts/typedcollectionsmastery.gd) Typed Array/Dictionary opcodes
[functionallambdalogic.gd](scripts/functionallambdalogic.gd) reduce / all / any
[advancedlambdas.gd](scripts/advancedlambdas.gd) Higher-order Callables
[safetypecasting.gd](scripts/safetypecasting.gd) as + null checks
[typedsignaldefinitions.gd](scripts/typedsignaldefinitions.gd) Typed signal boundaries
[callablebindingcontext.gd](scripts/callablebindingcontext.gd) bind() context injection
[unbindsignalargs.gd](scripts/unbindsignalargs.gd) unbind() arity trim
[awaitsequencemanager.gd](scripts/awaitsequencemanager.gd) Non-blocking await flows
[arraypreallocationperf.gd](scripts/arraypreallocationperf.gd) resize() pre-alloc
[staticvarsingletonalt.gd](scripts/staticvarsingletonalt.gd) Lightweight global state
[dictionarysafeiteration.gd](scripts/dictionarysafeiteration.gd) Safe erase-while-iterate
[typechecker.gd](scripts/typechecker.gd) EditorScript typing audit
[performanceanalyzer.gd](scripts/performanceanalyzer.gd) EditorScript hot-path scan
[signalarchitecturevalidator.gd](scripts/signalarchitecturevalidator.gd) EditorScript signal-up checks

Quick Landmines

  • Prefer dict.get("key", default) over dict["key"] when presence is uncertain.
  • Toggle Access as Scene Unique Name and read via %Name for critical UI/nodes.
  • Script layout order: extendsclassname → signals/enums/consts → exports/onready → lifecycle → public → private.

Expert knowledge (on demand)

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

  • [gdscript-core-directives.md](references/gdscript-core-directives.md) — restored baseline pedagogy (architecture, WHY, implementation depth)

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

  • GDScript basics — Language core for typed vars/funcs, signal declarations, await, and first-class Callables this skill standardizes.
  • GDScript style guide — Canonical script order (extendsclassname → signals → exports → lifecycle → methods) used in reviews and refactoring.
  • Static typing in GDScript — Why typed Arrays/Dictionaries and return types unlock optimized opcodes and editor safe-lines.
  • GDScript: An introduction to dynamic languages — Lambdas, higher-order Callables, and advanced patterns behind filter/map/reduce helpers.
  • GDScript warning system — Turn unsafe casts, unused signals, and untyped hot paths into CI-visible warnings.
  • Logic preferences — When to prefer declarative signals vs imperative calls so scripts stay decoupled.
  • Scene organization — Official “signal up, call down” ownership rules this skill enforces.
  • Using signals — Connect/emit model and why string-based connect-by-name is avoided.
  • Callablebind() / unbind() APIs for injecting or discarding callback arguments without wrapper nodes.
  • Array — Typed arrays, resize(), and functional methods (filter/map/reduce/all/any) used in the scripts.
  • Dictionary — Safe .get() defaults and why size must not change while iterating keys.
  • CPU optimization — Cache @onready / %UniqueName instead of getnode/$ inside _process loops.

Related Skills

Prerequisites

  • godot-project-foundations — Project layout, Autoload registration, and scene ownership conventions that typed GDScript scripts plug into.
  • godot-composition — Component boundaries clarify which scripts own signals vs call-down APIs before style enforcement.

Complements

Downstream / consumers

  • godot-performance-optimization — Escalate when typed GDScript alone is not enough; servers, pooling, and broader CPU/GPU tactics live there.
  • godot-auditor — Project-wide audits consume the typing, signal-up, and hot-path rules codified in this skill.
  • godot-ability-system — Abilities need typed signal payloads and await-safe cooldowns grounded in these language patterns.
  • godot-combat-system — Damage/death fan-out depends on typed emits and safe casts taught here.

Master

  • godot-master — Library router and mirrored module entry; open when discovering which Domain Skill owns a cross-cutting scripting concern.