
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. Use for code review, refactoring hot paths, or project standards. Trigger keywords: statictyping, signalarchitecture, uniquenodes, @onready, classname, signalupcalldown, Callable.bind, typedcollections, awaitsequence.
- Installs
- 621
- Last 24h
- +8
- Trending rank
- #9953
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/thedivergentai/game-dev-agentic-skills --skill godot-gdscript-mastery- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads godot-gdscript-mastery automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 (
type_checker,performance_analyzer,signal_architecture_validator) as runtime gameplay code.
NEVER Do in GDScript
- NEVER use
@onreadyand@exporton the same variable — Initialization order will cause@onreadyto 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
queue_free()orget_class()is unsupported and will be ignored by engine callbacks. - NEVER use dynamic
get_node()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
isfollowed by a hard cast — If the type check passes but the object changes, it crashes. Useasand check for null. - NEVER use
print()for production debugging — Usepush_error(),push_warning(), or breakpoints. - NEVER pre-load huge resources in
_ready()— UseResourceLoader.load_threaded_request()for async loading. - NEVER use global variables in Autoloads when
static varis 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: 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
- Prefer
dict.get("key", default)overdict["key"]when presence is uncertain. - Toggle Access as Scene Unique Name and read via
%Namefor critical UI/nodes. - Script layout order:
extends→class_name→ 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 — 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,
signaldeclarations,await, and first-class Callables this skill standardizes. - GDScript style guide — Canonical script order (
extends→class_name→ 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.
- Callable —
bind()/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/%UniqueNameinstead ofget_node/$inside_processloops.
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
- godot-version-migration — Engine version upgrades (3→4 language breaks, 4.x hops); this skill stays on current GDScript 2.0 idioms.
- godot-signal-architecture — Deepens connect flags, buses, and sequencers after this skill’s typed signal/Callable basics.
- godot-autoload-architecture — Contrasts heavy Autoloads with the
static varsingleton alternatives shown here. - godot-resource-data-patterns — Prefer Resources for shared config; keep GDScript modules thin and typed around Resource payloads.
- godot-scene-management —
@onready, unique names, and await sequences must stay valid across scene swaps and loaders. - godot-testing-patterns — Typed signals and Callables make
watch_signals/ spies reliable in unit tests. - godot-debugging-profiling — Pair style/perf smells from this skill with profiler and custom monitors when hot paths remain slow.
- godot-state-machine-advanced — FSM enter/exit handlers should follow the same typed-signal and await sequencing conventions.
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.
FAQ
What does the godot-gdscript-mastery skill do?
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: statictyping, signalarchitecture, uniquenodes, @onready, classname, signalupcalldown, Callable.bind, typedcollections, awaitsequence.
How do I install godot-gdscript-mastery?
Run npx skills add https://github.com/thedivergentai/game-dev-agentic-skills --skill godot-gdscript-mastery in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/godot-gdscript-mastery/ (personal) or .claude/skills/godot-gdscript-mastery/ (project).
Which AI agents can use godot-gdscript-mastery?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is godot-gdscript-mastery safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains godot-gdscript-mastery?
It is published by thedivergentai in thedivergentai/game-dev-agentic-skills. It has 621 recorded installs.
More from thedivergentai/game-dev-agentic-skills
godot-master
thedivergentai/game-dev-agentic-skills
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.
godot-shaders-basics
thedivergentai/game-dev-agentic-skills
Expert Godot shader patterns for batch-safe hitflash, alpha-scissor foliage/dissolve, screenspace postFX, depth reconstruction, triplanar, and instance uniforms — not first-shader tutorials. Trigger on draw-call batching breaks, discard vs depth-prepass, foliage shadows, post-process quads, or world-position FX. Keywords: instance uniform, ALPHASCISSOR, hintscreentexture, hintdepthtexture, global uniform, sampler2DArray, canvasitem, spatial, post-processing.
godot-2d-animation
thedivergentai/game-dev-agentic-skills
Expert patterns for 2D animation in Godot using AnimatedSprite2D and skeletal cutout rigs. Use when implementing sprite frame animations, procedural animation (squash/stretch), cutout bone hierarchies, or frame-perfect timing systems. Trigger keywords: AnimatedSprite2D, SpriteFrames, animationfinished, animationlooped, framechanged, frameprogress, setframeandprogress, cutout animation, skeletal 2D, Bone2D, procedural animation, animation state machine, advance(0).
godot-ui-theming
thedivergentai/game-dev-agentic-skills
Expert blueprint for UI themes using Theme resources, StyleBoxes, custom fonts, and theme overrides for consistent visual styling. Covers StyleBoxFlat/Texture, theme inheritance, dynamic theme switching, and font variations. Use when implementing consistent UI styling OR supporting multiple themes. Keywords Theme, StyleBox, StyleBoxFlat, addthemeoverride, font, theme inheritance, dark mode.
godot-particles
thedivergentai/game-dev-agentic-skills
Expert blueprint for GPU particle systems (explosions, magic effects, weather, trails) using GPUParticles2D/3D, ParticleProcessMaterial, gradients, sub-emitters, and custom shaders. Use when creating VFX, environmental effects, or visual feedback. Keywords GPUParticles2D, ParticleProcessMaterial, emissionshape, colorramp, subemitter, oneshot.
godot-save-load-systems
thedivergentai/game-dev-agentic-skills
Expert blueprint for save/load systems using JSON/binary serialization, PERSIST group pattern, versioning, and migration. Covers player progress, settings, game state persistence, and error recovery. Use when implementing save systems OR data persistence. Keywords save, load, JSON, FileAccess, user://, serialization, version migration, PERSIST group.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.