godot-gdscript-patterns

godot-gdscript-patterns is a skill for Claude Code from EngineerWithAI/engineerwith-agents. It costs 47 tokens per session (4,809 once invoked), scanned A, original, MIT.

A guide to common patterns for building games in Godot 4 with GDScript, Godot’s programming language. It covers reusable scenes, event signals, game states, and performance improvements.

In plain words
What is it for?
Use it to build game systems, organize scenes, manage game state, improve GDScript performance, or learn Godot development practices.
Why use it?
It helps you structure Godot game code consistently and avoid common design mistakes as a project grows.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the game-development plugin — 2 skills shipped together

Good fit Use it to build game systems, organize scenes, manage game state, improve GDScript performance, or learn Godot development practices.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add EngineerWithAI/engineerwith-agents --skill godot-gdscript-patterns
Clone the repo
git clone --depth 1 https://github.com/EngineerWithAI/engineerwith-agents

Made for: Claude Code.

Or install game-development, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for godot-gdscript-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns/github.svg)](https://agentmods.dev/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns)
Your own site
<a href="https://agentmods.dev/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns"><img src="https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for godot-gdscript-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns"><img src="https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/godot-gdscript-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,809 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.04809
Opus 5 $0.00023 $0.02405
Sonnet 5 $0.00009 $0.00962
Haiku 4.5 $0.00005 $0.00481

Measured 7d ago against content hash 0046830d8a80, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

godot-gdscript-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/game-development/skills/godot-gdscript-patterns/SKILL.md · 806 lines

How it starts

The opening of the file, as written. The whole thing — 806 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Godot GDScript Patterns

Production patterns for Godot 4.x game development with GDScript, covering architecture, signals, scenes, and optimization.

When to Use This Skill

  • Building games with Godot 4
  • Implementing game systems in GDScript
  • Designing scene architecture
  • Managing game state
  • Optimizing GDScript performance
  • Learning Godot best practices

Core Concepts

1. Godot Architecture

Node: Base building block
├── Scene: Reusable node tree (saved as .tscn)
├── Resource: Data container (saved as .tres)
├── Signal: Event communication
└── Group: Node categorization

2. GDScript Basics

class_name Player
extends CharacterBody2D

# Signals
signal health_changed(new_health: int)
signal died

# Exports (Inspector-editable)
@export var speed: float = 200.0
@export var max_health: int = 100
@export_range(0, 1) var damage_reduction: float = 0.0
@export_group("Combat")
@export var attack_damage: int = 10
@export var attack_cooldown: float = 0.5

# Onready (initialized when ready)
@onready var sprite: Sprite2D = $Sprite2D
@onready var animation: AnimationPlayer = $AnimationPlayer
@onready var hitbox: Area2D = $Hitbox

# Private variables (convention: underscore prefix)
var _health: int
var _can_attack: bool = true

func _ready() -> void:
    _health = max_health

func _physics_process(delta: float) -> void:
    var direction := Input.get_vector("left", "right", "up", "down")
    velocity = direction * speed
    move_and_slide()

func take_damage(amount: int) -> void:
    var actual_damage := int(amount * (1.0 - damage_reduction))
    _health = max(_health - actual_damage, 0)
    health_changed.emit(_health)

    if _health <= 0:
        died.emit()

Patterns

Pattern 1: State Machine

# state_machine.gd
class_name StateMachine
extends Node

signal state_changed(from_state: StringName, to_state: StringName)

@export var initial_state: State

var current_state: State
var states: Dictionary = {}

func _ready() -> void:
    # Register all State children
    for child in get_children():
        if child is State:
            states[child.name] = child
            child.state_machine = self
            child.process_mode = Node.PROCESS_MODE_DISABLED

    # Start initial state
    if initial_state:
        current_state = initial_state
        current_state.process_mode = Node.PROCESS_MODE_INHERIT
        current_state.enter()

func _process(delta: float) -> void:
    if current_state:
        current_state.update(delta)

func _physics_process(delta: float) -> void:
    if current_state:
        current_state.physics_update(delta)

func _unhandled_input(event: InputEvent) -> void:
    if current_state:
        current_state.handle_input(event)

func transition_to(state_name: StringName, msg: Dictionary = {}) -> void:
    if not states.has(state_name):
        push_error("State '%s' not found" % state_name)
        return

    var previous_state := current_state
    previous_state.exit()
    previous_state.process_mode = Node.PROCESS_MODE_DISABLED

    current_state = states[state_name]
    current_state.process_mode = Node.PROCESS_MODE_INHERIT
    current_state.enter(msg)

    state_changed.emit(previous_state.name, current_state.name)

Read the full file on GitHub · 806 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 806 lines · 47 tokens per session scan A 0046830d8a80

Subscribe to this mod's changes

godot-gdscript-patterns is a skill published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 8mo ago), licensed MIT. It adds 47 tokens to every session and 4,809 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories