Master Godot 4 GDScript patterns including signals, scenes

Godot gdscript patterns

by wshobson · MIT license · ★ 39,857 on GitHub · updated Sep 21

Godot gdscript patterns cover

Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization. Use when building Godot games, implementing game systems, or learning GDScript best practices.

---
name: godot-gdscript-patterns
description: Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization. Use when building Godot games, implementing game systems, or learning GDScript best practices.
---

# 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

Overview

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

Manual install (npx, ZIP)
Claude Codenpx skills add wshobson/agents --skill godot-gdscript-patterns -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \ | tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/game-development/skills/godot-gdscript-patterns
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/5d8e949e4aab9ebeaf3d/godot-gdscript-patterns.zip" -OutFile "$env:TEMP\godot-gdscript-patterns.zip"; Expand-Archive "$env:TEMP\godot-gdscript-patterns.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md2.1 KB
  • references/2 files · 18.4 KB
Read the files here
wshobson/4236bb93 files
SKILL.md
Show the full text79 lines

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()

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

1---
2name: godot-gdscript-patterns
3description: Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization. Use when building Godot games, implementing game systems, or learning GDScript best practices.
4---
5 
6# Godot GDScript Patterns
7 
8Production patterns for Godot 4.x game development with GDScript, covering architecture, signals, scenes, and optimization.
9 
10## When to Use This Skill
11 
12- Building games with Godot 4
13- Implementing game systems in GDScript
14- Designing scene architecture
15- Managing game state
16- Optimizing GDScript performance
17- Learning Godot best practices
18 
19## Core Concepts
20 
21### 1. Godot Architecture
22 
23```
24Node: Base building block
25├── Scene: Reusable node tree (saved as .tscn)
26├── Resource: Data container (saved as .tres)
27├── Signal: Event communication
28└── Group: Node categorization
29```
30 
31### 2. GDScript Basics
32 
33```gdscript
34class_name Player
35extends CharacterBody2D
36 
37# Signals
38signal health_changed(new_health: int)
39signal died
40 
41# Exports (Inspector-editable)
42@export var speed: float = 200.0
43@export var max_health: int = 100
44@export_range(0, 1) var damage_reduction: float = 0.0
45@export_group("Combat")
46@export var attack_damage: int = 10
47@export var attack_cooldown: float = 0.5
48 
49# Onready (initialized when ready)
50@onready var sprite: Sprite2D = $Sprite2D
51@onready var animation: AnimationPlayer = $AnimationPlayer
52@onready var hitbox: Area2D = $Hitbox
53 
54# Private variables (convention: underscore prefix)
55var _health: int
56var _can_attack: bool = true
57 
58func _ready() -> void:
59 _health = max_health
60 
61func _physics_process(delta: float) -> void:
62 var direction := Input.get_vector("left", "right", "up", "down")
63 velocity = direction * speed
64 move_and_slide()
65 
66func take_damage(amount: int) -> void:
67 var actual_damage := int(amount * (1.0 - damage_reduction))
68 _health = max(_health - actual_damage, 0)
69 health_changed.emit(_health)
70 
71 if _health <= 0:
72 died.emit()
73```
74 
75## Detailed patterns and worked examples
76 
77Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
78 
79 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 39,857
Checked
Source
wshobson/agents ↗
Creator
wshobson · 179 listings
View creator

Similar skills

See all →

More from wshobson

SkillMaster C/.NET backend development patterns for buildingwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliancewshobson/agents · by wshobsonImplement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.★ 39.9k GitHub starsSkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Designwshobson/agents · by wshobsonMaster Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.★ 39.9k GitHub starsSkillMigrate from AngularJS to Angular using hybrid modeAngular migrationwshobson/agents · by wshobsonMigrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.★ 39.9k GitHub starsSkillUnderstand anti-reversing, obfuscationAnti reversing techniqueswshobson/agents · by wshobsonUnderstand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.★ 39.9k GitHub starsSkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patternswshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub stars