Skip to content
Back to skills

Godot Version Guard

ASecurity

Old Godot code in a newer project: KinematicBody2D, yield, onready, export var, renamed classes and methods; scan, convert, check API names.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythonrustgoc#bashnodeapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add tipoLi5890/game-studio --skill godot-version-guard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Godot Version Guard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Godot Version Guard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-godot-version-guard/badge)](https://www.skillsdirectory.com/skills/tipoli5890-godot-version-guard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: godot-version-guard
description: >-
  Old Godot code in a newer project: KinematicBody2D, yield, onready, export var, renamed classes
  and methods; scan, convert, check API names.
---

# godot-version-guard — old API in new code

Most Godot answers on the web predate the engine in the project; a scan before the first run
catches the renamed classes and the old syntax.

## Load what the situation needs

| The situation | Read |
|---|---|
| Code pasted from an answer, a tutorial or an old project; "is this Godot 3?" | *Scan* below |
| Porting a Godot 3 project; what `--convert-3to4` fixes, misses and breaks | `reference/renames-3-to-4.md` |
| "Does the engine we use have X"; upgrading the 4.x minor; `.uid` files and `unique_id=` in a diff; `TileMap` or `TileMapLayer` | `reference/minor-versions.md` |
| Checking a class or member name before using it; trusting a suggestion | `reference/api-check.md` |
| Searching the class reference by hand, reading a class's description | `godot-cli` |
| The converted project: does it import, load and run | `godot-verify` |
| GDScript style, typing and warnings once the names are right | `godot-gdscript` |
| Scene and resource text after a port | `godot-scene-files` |
| A C# project | `godot-csharp` |

## Scan

```bash
python3 scripts/version_scan.py scan path/to/project            # .gd .tscn .tres .godot .shader .gdshader
python3 scripts/version_scan.py scan player.gd --hints          # also the names that may be old
```

```
HIT  player.gd:1:9 class KinematicBody2D -> CharacterBody2D (converter)
HIT  player.gd:9:2 syntax yield(obj, "signal") -> await obj.signal (converter)
HIT  player.gd:12:10 class File -> FileAccess (suggested) FileAccess.open(path, mode) replaces File.new() then open()
HINT player.gd:13:2 member update() -> queue_redraw() (suggested) CanvasItem only; update() on other classes, or a method of your own, is fine
version_scan: FAIL 15 hits, 2 hints in 4 files
```

| Word | Means |
|---|---|
| `HIT` | cannot be right in Godot 4: the old name is absent from the class reference, or the syntax was removed. Exit 2 |
| `HINT` | a name Godot 4 still has in some class (`update`, `instance`, `empty`, `filename`, `get_data`): read the line. Never fails |
| `(converter)` | `--convert-3to4` rewrites it; the engine states the mapping |
| `(compiler)` | the shader compiler's error names the replacement |
| `(suggested)` | the converter leaves it; the old name is gone and the new one exists, but the engine does not state the mapping. Read the note, then check with the parser |

GDScript strings, comments and node paths (`$Sprite`, `%Label`) are not scanned, so a node
named Sprite is not a hit. A line ending in a `version-scan: ignore` comment is skipped. Exit 0
no hit, 2 a hit, 3 a path that does not exist, 1 usage.

`version_scan.py table` prints the whole table as Markdown; `table --left` prints the rows the
converter does not fix, which are the ones a port still has to do by hand.

## Check a name against the binary

```bash
python3 scripts/version_scan.py api CharacterBody2D CanvasItem.queue_redraw deg_to_rad @export --godot "$GODOT_BIN"
python3 scripts/version_scan.py api --table --godot "$GODOT_BIN"      # every current name in the table
```

It dumps the class reference of that binary (`--doctool`, in a temp folder) and looks each name
up, parents included; exit 2 names what is missing (`reference/api-check.md`).

## Port a Godot 3 project

1. Copy it; the converter rewrites in place with no backup.
2. `scan` the original, then `--validate-conversion-3to4` (lists, writes only `.godot/`).
3. `--convert-3to4` on the copy, headless with `-l en`.
4. `scan` the copy: what is left is what the converter does not fix.
5. Fix what it gets wrong: node names renamed to class names, `idle_frame`, a line of prose in an
   `@rpc` script, DirAccess.new() (`reference/renames-3-to-4.md`).
6. `godot-verify` until it passes: the parser and the shader compiler are the final check.

## The names that bite most

| Godot 3 (do not write) | Godot 4 |
|---|---|
| KinematicBody2D, move_and_slide(velocity, up) | `CharacterBody2D`, with `CharacterBody2D.velocity` and `CharacterBody2D.up_direction` set, then `CharacterBody2D.move_and_slide` |
| Spatial, and 3D nodes with no suffix (Camera, Area, RayCast) | `Node3D`, `Camera3D`, `Area3D`, `RayCast3D` |
| Sprite, Position2D | `Sprite2D`, `Marker2D` |
| export var, onready var, tool | `@export var`, `@onready var`, `@tool` |
| yield(get_tree(), "idle_frame") | `await get_tree().process_frame` (`SceneTree.process_frame`) |
| connect("pressed", self, "on_pressed") | `pressed.connect(on_pressed)` |
| setget | a property with `set(value):` and `get:` blocks |
| File.new() then open() | `FileAccess.open` |
| instance() | `PackedScene.instantiate` |
| update() on a CanvasItem | `CanvasItem.queue_redraw` |
| deg2rad, rand_range, stepify | `deg_to_rad()`, `randf_range()`, `snapped()` |
| Tween node, interpolate_property | `Node.create_tween` then `Tween.tween_property` |
| TileMap (still loads; deprecated) | `TileMapLayer`, one node per layer |

## Discipline

- **Scan before the first run** of any code that came from outside the project. A parse error
  stops at the first bad name; a scan lists them all.
- **Check a suggestion, do not paste it.** `(suggested)` rows are mappings the engine does not
  state; read the note and let the parser confirm.
- **Never trust a converted file you have not loaded.** The converter writes code that parses
  and is wrong (`reference/renames-3-to-4.md`).
- **Probe, do not assume, between 4.x minors.** `api` answers in a second on the binary the
  project uses (`reference/minor-versions.md`).
- **Keep version numbers out of code comments and docs.** Say "the engine in use"; the pin lives
  in one place.

## Scope — what this skill does NOT do

| Not here | Go to |
|---|---|
| Whether the code, once renamed, imports, loads and runs | `godot-verify` |
| GDScript style and typing | `godot-gdscript` |
| Scene and resource text, uids | `godot-scene-files` |
| C# projects | `godot-csharp` |
| Pinning the engine for a team, a new project | `godot-new-project` |

Files in this skill

  • SKILL.md6 KB
  • reference/api-check.md3.5 KB
  • reference/minor-versions.md3.8 KB
  • reference/renames-3-to-4.md8 KB
  • scripts/version_scan.py50.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.