Skills

Gdscript Advanced

Use when writing production-grade GDScript, performance idioms, metaprogramming, @tool...

Install

npx skills add jame581/GodotPrompter --skill gdscript-advanced -g -a claude-code -y
Category
Writing
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Use when writing production-grade GDScript, performance idioms, metaprogramming, @tool lifecycle, async pitfalls, signal/Callable trade-offs, profiler-driven idioms, and common pitfalls

GDScript Advanced

Production-grade GDScript depth, for shipping games, not for learning the language. Pair with gdscript-patterns for fundamentals.

Related skills: gdscript-patterns for language fundamentals, godot-optimization for engine-side perf work, godot-debugging for runtime diagnosis, csharp-godot for the C# alternative.

Intent: This skill is GDScript-only by design (allowlisted). C# users should read csharp-godot. Adding C# parity here would undermine the audience split.

1. When to reach for advanced GDScript

You're past gdscript-patterns when:

  • You're hitting a profiler bottleneck and need to know which idioms are fast
  • You're writing editor tools and need @tool lifecycle correctness
  • You're seeing coroutines that never resume or Callable lifetime bugs
  • You need metaprogramming (calling functions by name, dynamic dispatch) without footguns
  • You're shipping a real game and want to avoid the patterns that look fine but break under load

This skill assumes you already know typed parameters, @onready, await, match, and lambdas (covered in gdscript-patterns).

2. Performance idioms

Static vars and methods (static vars since Godot 4.1) avoid per-instance overhead:

class_name Tally extends Node

static var _global_score: int = 0

static func add_score(amount: int) -> void:
    _global_score += amount

static func get_score() -> int:
    return _global_score

Avoid singletons-as-autoloads when a static method on a class would do.

Vector2i vs Vector2 / Vector3i vs Vector3, integer vectors keep tile coords and grid math exact (no float drift, usable as Dictionary keys). Measure before assuming a speed gain. Convert to float only at the rendering boundary:

var grid_pos: Vector2i = Vector2i(8, 12)              # cheap
var world_pos: Vector2 = Vector2(grid_pos) * TILE_SIZE  # convert at boundary
Read the whole SKILL.md on GitHub

More in Writing