gdscript-patterns

gdscript-patterns is a skill for Claude Code from jame581/GodotPrompter. It costs 36 tokens per session (3,649 once invoked), scanned A, original, MIT.

A set of coding patterns for GDScript, the programming language used by the Godot game engine, especially Godot 4.3 and newer. It covers type hints, asynchronous code, functions, pattern matching, and other common language features.

In plain words
What is it for?
Use it when writing or reviewing GDScript for Godot games, including typed variables, delayed operations, callbacks, exported settings, and inner classes.
Why use it?
GDScript has language rules and Godot-specific conventions that can be easy to misuse. These examples help keep code clear, compatible, and easier to check.

Skill for Claude Code

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

Part of the godot-prompter plugin — 61 skills, 9 agents, 2 hooks shipped together

Good fit Use it when writing or reviewing GDScript for Godot games, including typed variables, delayed operations, callbacks, exported settings, and inner classes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jame581/godotprompter/gdscript-patterns
About the project

GodotPrompter is a skills framework for Godot 4.x game development that gives AI coding agents structured guidance for GDScript and C# projects. It helps agents follow Godot-specific workflows for tasks such as project setup, gameplay systems, multiplayer, rendering, and shipping. The catalogue entries are GodotPrompter’s skills, agents, instructions, hooks, settings, and plugin components.

jame581/GodotPrompter · 1,024 stars · on GitHub

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 jame581/GodotPrompter --skill gdscript-patterns
Clone the repo
git clone --depth 1 https://github.com/jame581/GodotPrompter

Made for: Claude Code.

Or install godot-prompter, the plugin that ships this one along with the rest of its 61 skills, 9 agents, 2 hooks.

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 gdscript-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/jame581/godotprompter/gdscript-patterns/github.svg)](https://agentmods.dev/skills/jame581/godotprompter/gdscript-patterns)
Your own site
<a href="https://agentmods.dev/skills/jame581/godotprompter/gdscript-patterns"><img src="https://agentmods.dev/badge/skills/jame581/godotprompter/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 gdscript-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/jame581/godotprompter/gdscript-patterns"><img src="https://agentmods.dev/badge/skills/jame581/godotprompter/gdscript-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,649 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00036 $0.03649
Opus 5.5 $0.00014 $0.01460
Sonnet 5.5 $0.00007 $0.00730
Haiku 4.5 $0.00004 $0.00365

Measured 23d ago against content hash 9ad7aaaa7b02, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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 23d 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.

skills/gdscript-patterns/SKILL.md · 394 lines

How it starts

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

GDScript Patterns in Godot 4.3+

All examples target Godot 4.3+ with no deprecated APIs.

Related skills: gdscript-advanced for production-grade depth (performance idioms, metaprogramming, @tool lifecycle, profiler-driven idioms), godot-code-review for style rules and anti-patterns, csharp-godot for GDScript-to-C# translation, state-machine for state patterns, event-bus for signal architecture.

Note: This skill is GDScript-specific by design. For C# patterns, see csharp-godot and csharp-signals.


1. Static Typing

Type Hints

Always add type hints — they catch bugs at parse time, improve autocomplete, and boost performance.

# Variables
var health: int = 100
var speed: float = 200.0
var player_name: String = "Hero"
var direction: Vector2 = Vector2.ZERO

# Constants
const MAX_HEALTH: int = 100
const GRAVITY: float = 980.0

# Functions — parameters and return type
func take_damage(amount: int) -> void:
    health -= amount

func get_direction() -> Vector2:
    return Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")

# Inferred typing with :=
var pos := Vector2(100, 200)     # inferred as Vector2
var items := []                  # inferred as Array (untyped)
var count := 0                   # inferred as int

Typed Collections

# Typed arrays — only accepts the specified type
var enemies: Array[Enemy] = []
var scores: Array[int] = [10, 20, 30]
var names: Array[String] = ["Alice", "Bob"]

# Typed dictionaries (Godot 4.4+)
var inventory: Dictionary[String, int] = {"sword": 1, "potion": 5}

# Typed loop variable
for enemy: Enemy in enemies:
    enemy.take_damage(10)

# Typed array methods work with type safety
var filtered: Array[Enemy] = enemies.filter(func(e: Enemy) -> bool: return e.health > 0)

Casting with as and is

# 'is' — type check (returns bool)
func _on_body_entered(body: Node2D) -> void:
    if body is Player:
        var player: Player = body as Player
        player.take_damage(10)

# 'as' — cast (returns null on failure, no error)
var sprite := get_node("Sprite") as Sprite2D
if sprite:
    sprite.modulate = Color.RED

# Prefer 'is' check + cast over bare 'as' to avoid null surprises

Read the full file on GitHub · 394 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 23d ago Changed · +1 lines 9ad7aaaa7b02
  2. 1mo ago Changed 3f9a0d7e2853
  3. 2mo ago Changed · -73 lines 83387c93d7be
  4. 2mo ago Changed · +4 lines c4e33b54da1e
  5. 3mo ago First seen · 462 lines · 36 tokens per session scan A bf398f7863f5

Subscribe to this mod's changes

gdscript-patterns is a skill published in the GitHub repository jame581/GodotPrompter (1,024 stars, last pushed 5d ago), licensed MIT. It adds 36 tokens to every session and 3,649 once invoked, about $0.0001 per session on Opus 5.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-08-30.

Related

gdscript-patterns compared with skills from other repositories

gdscript-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gdscript-patternsjame581/GodotPrompterSkill1.0k5d agoMITA36Claude Code
godot-csharpgamedev-skills/awesome-gamedev-agent-skillsSkill14kyesterdayApache-2.0A111Claude Code
unity-csharp-scriptinggamedev-skills/awesome-gamedev-agent-skillsSkill14kyesterdayApache-2.0A91Claude Code
unity-cliAlex-Rachel/TEngineSkill2.4k18d agoMITA68Codex
roblox-cameraTabooHarmony/roblox-brainSkill2444d agoMITA38Claude Code
luban-devAlex-Rachel/TEngineSkill2.4k18d agoMITA63Codex
tengine-devAlex-Rachel/TEngineSkill2.4k18d agoMITA71Codex