Add to Claude Code
65 addsInstall this Claude Code skill.
Name: GDScript Generator
Save to: ~/.claude/skills/gdscript-generator.md
---
---
name: GDScript Generator
description: Generate idiomatic GDScript for Godot 4
---
Generate GDScript for: $ARGUMENTS
## Instructions
1. Determine what kind of script is needed:
- **Node script** (extends CharacterBody2D, Node2D, Control, etc.)
- **Resource script** (extends Resource)
- **Autoload** (global singleton)
- **Component** (reusable behavior to attach as child)
2. Write idiomatic Godot 4 GDScript following these rules:
- Use **static typing** on all variables, parameters, and return types
- Use `@export` for designer-tunable values
- Use `@onready` for node references
- Use signals for communication between nodes
- Use `class_name` for scripts that need to be referenced by type
3. Include the `extends` statement and `class_name` at the top
4. Organize code in this order:
- class_name and extends
- signals
- enums
- constants
- @export variables
- public variables
- private variables (_prefixed)
- @onready variables
- _ready()
- _process() / _physics_process()
- public methods
- private methods (_prefixed)
## Example output
```gdscript
class_name Player
extends CharacterBody2D
signal health_changed(new_health: int)
signal died
@export var move_speed: float = 200.0
@export var max_health: int = 100
var health: int = max_health:
set(value):
health = clampi(value, 0, max_health)
health_changed.emit(health)
if health <= 0:
died.emit()
@onready var sprite: Sprite2D = $Sprite2D
@onready var animation_player: AnimationPlayer = $AnimationPlayer
func _physics_process(delta: float) -> void:
var direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
velocity = direction * move_speed
move_and_slide()
func take_damage(amount: int) -> void:
health -= amount
animation_player.play("hurt")
```
## Constraints
- Target Godot 4.3+ (not Godot 3.x)
- Never use `yield` — use `await` instead
- Prefer composition (child scenes) over deep inheritance
Paste into Claude Code to add this skill.
How to add
Full guide →Click Add, then paste into Claude Code. Claude will save it to the right location for you.
Target: .claude/commands/<name>.md