Godot Gdscript logo

Godot Gdscript

Community
fetasty
godot-gdscript

Godot 4 GDScript code quality: static typing, signal architecture, coroutines, design patterns, performance optimization, and GDScript-specific idioms. Use when writing or reviewing .gd files in Godot 4 projects for: (1) Enforcing static typing standards, (2) Designing signal and node communication patterns, (3) Implementing state machines/command/observer patterns in GDScript, (4) Optimizing GDScript performance, (5) Reviewing GDScript code for anti-patterns.

Overview

Publisherfetasty
Repositorygodot-skills
Skill namegodot-gdscript
Stars
35
Forks
0
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by fetasty on GitHub. Read the source before you install it.

Installation

Install the Godot Gdscript AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/fetasty/godot-skills/tree/main/godot-gdscript
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fetasty/godot-skills.git /tmp/godot-skills
mkdir -p .claude/skills
cp -r /tmp/godot-skills/godot-gdscript .claude/skills/godot-gdscript
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Godot Gdscript in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Godot Gdscript on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Godot Gdscript is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Godot GDScript Specialist

GDScript 2.0 code quality, patterns, and optimization for Godot 4.6 projects.

Static Typing (Mandatory)

ALL variables, parameters, and return types must have explicit type annotations:

gdscript
# YES — typed
var health: float = 100.0
var inventory: Array[Item] = []
func take_damage(amount: float, source: Node3D) -> void:
func get_items() -> Array[Item]:

# NO — untyped
var health = 100.0
func take_damage(amount, source):

Use @onready for typed node references:

gdscript
@onready var health_bar: ProgressBar = %HealthBar
@onready var sprite: Sprite2D = $Visuals/Sprite2D

Enable unsafe_* warnings in project settings to catch untyped code.

File Organization

  • One class_name per file — file name matches class in snake_case
    • player_character.gd → class_name PlayerCharacter
  • Scripts extend the node type they're attached to
  • Use @export_group and @export_subgroup for inspector organization

Signal Architecture

gdscript
signal health_changed(new_health: float, old_health: float)
signal died(source: Node)

# Modern emit syntax (Godot 4)
health_changed.emit(_current_health, _previous_health)
died.emit(killer)

# Typed connections
health_changed.connect(_on_health_changed)
# One-shot
health_changed.connect(_on_damaged_once, CONNECT_ONE_SHOT)
  • Prefer signals for decoupled communication between nodes
  • Never connect signals in _process() — connects every frame
  • Always disconnect in _exit_tree() if node may outlive the connection
  • Use EventBus autoload for global events, direct signals for parent-child

Coroutines and Async

gdscript
# Await a signal
await get_tree().create_timer(0.5).timeout

# Await a tween
var tween := create_tween()
tween.tween_property(sprite, "modulate:a", 0.0, 0.3)
await tween.finished

# Await parallel operations
var timer := get_tree().create_timer(1.0)
var tween := create_tween().tween_property(self, "position", target, 1.0)
await timer.timeout  # or await tween.finished

Never use yield() — that's Godot 3 syntax. Use await exclusively.

Design Patterns

State Machine

gdscript
enum State { IDLE, RUNNING, JUMPING, FALLING, ATTACKING }
var _current_state: State = State.IDLE

func _physics_process(delta: float) -> void:
    match _current_state:
        State.IDLE:
            _process_idle(delta)
        State.RUNNING:
            _process_running(delta)

For complex states, use node-based state machines (each state is a child Node).

Resource Pattern

gdscript
class_name WeaponData extends Resource
@export var damage: float = 10.0
@export var attack_speed: float = 1.0
@export var weapon_type: WeaponType

Resources are shared by default — use resource.duplicate() for per-instance data. Use duplicate_deep() for nested resources (Godot 4.5+).

Composition Over Inheritance

gdscript
@onready var health_component: HealthComponent = %HealthComponent
@onready var hitbox_component: HitboxComponent = %HitboxComponent

func _ready() -> void:
    health_component.died.connect(_on_died)
    hitbox_component.hit_received.connect(_on_hit_received)

Maximum inheritance depth: 3 levels after Node base.

Post-4.3 GDScript Features

From references/current-best-practices.md in the godot skill:

  • Variadic arguments (4.5+): func log(prefix: String, values: Variant...) -> void:
  • Abstract classes (4.5+): @abstract class_name BaseEnemy and @abstract func get_pattern()
  • Script backtracing: Call stacks available even in Release builds (4.5+)

Performance

  • Disable _process and _physics_process when not needed:
    gdscript
    set_process(false)
    set_physics_process(false)
  • Use _physics_process for movement/physics, _process for visuals/UI
  • Cache node references in @onready — never get_node() in _process
  • Use StringName for frequently compared strings: &"animation_name"
  • Avoid Array.find() in hot paths — use Dictionary lookups
  • Object pooling for frequently spawned objects (projectiles, particles)
  • Typed arrays (Array[Type]) are faster than untyped arrays
  • Threshold for GDScript → GDExtension: if a function runs >1000 times per frame

Common GDScript Anti-Patterns

  • Untyped variables and functions — disables compiler optimizations
  • Using $NodePath in _process instead of caching with @onready
  • Deep inheritance trees instead of composition
  • Signals for synchronous communication — use direct method calls
  • String comparisons instead of enums or StringName
  • Dictionaries for structured data instead of typed Resources
  • God-class Autoloads that manage everything
  • Editor signal connections — invisible in code, hard to track
  • Using yield() instead of await

Tooling

ripgrep for GDScript: No gdscript type exists. Always use --glob "*.gd" or glob: "*.gd". Using --type gdscript produces a hard error.

Frequently asked questions

What does the Godot Gdscript AI skill do?

Godot 4 GDScript code quality: static typing, signal architecture, coroutines, design patterns, performance optimization, and GDScript-specific idioms. Use when writing or reviewing .gd files in Godot 4 projects for: (1) Enforcing static typing standards, (2) Designing signal and node communication patterns, (3) Implementing state machines/command/observer patterns in GDScript, (4) Optimizing GDScript performance, (5) Reviewing GDScript code for anti-patterns.

Why use Godot Gdscript on TypingMind?

Because you install it once and use it with any model. Godot Gdscript is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Godot Gdscript in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/fetasty/godot-skills/tree/main/godot-gdscript. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Godot Gdscript?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Godot Gdscript?

As many as you like. As long as a model supports skills, you can use Godot Gdscript with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Godot Gdscript AI skill free?

Yes. It is published on GitHub by fetasty under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇