Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

godot-devkit 5.0.0: retire scene text surgery and style checks; four principles - #186

Merged
cdowin merged 3 commits into
mainfrom
185-diet
Nov 13, 2026
Merged

cdowin merged 3 commits into
mainfrom
185-diet

Conversation

@cdowin

@cdowin cdowin commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #185
Closes #184

The devkit becomes a library of base primitives any Godot project wants, plus a few agent skills. Godot writes its own scene files: the editor, or a headless GDScript that loads a scene, edits it and saves it with ResourceSaver. One narrow writer stays, scene set and scene add, because a headless save of an inherited scene loses shader parameters and tile overrides; each changes only its own lines. The studio games have dropped every removed command.

Done here

  1. Four principles, first in godot-ui, godot-101/reference/ui.md (plus a "Data-driven UI" row in godot-101's pattern table and the fourth in testing-and-debugging.md) and the install-runners context block: Godot native first; a .tscn is the layout with authored sample content, code only binds live data; "data-driven" means data the editor writes, never UI trees built in code; run the scene, not the game. The ActionBar example is now an authored scene.
  2. The godot-devkit skill shows the headless GDScript pattern (_initialize(), so autoloads exist), says edit scripts must be idempotent and the wrapper must fail on SCRIPT ERROR (Godot exits 0 on a compile error), warns that the first save normalizes unique_id on a hand-written scene, and says when to use scene set/add instead.
  3. Cuts (table below). A removed verb, or a removed gate named in [roster] checks, exits 2 and names its replacement.
  4. README and CLAUDE.md state the module test and the one narrow writer.

Keep or cut

The test: would any Godot project want this primitive, and does the editor or the model not already do it? Lines are Python source on main.

Module Lines Verdict Why
core/ 1,008 keep the floor every reader and gate stands on
format/tscn.py, format/tscn_document.py 1,190 keep (document trimmed to 432) the reader, and the line-exact document scene set/add and check uid --fix edit through
format/classdb.py 117 keep (trimmed) engine property table for check props
format/tilemap.py 267 keep (decoder only) tiles read
format/gdscript_syntax.py, index/gd_constants.py, index/gd_translations.py, write/pot.py 2,972 keep pot: the editor's POT generator has no headless path
index/gdscript.py 233 keep (trimmed) export index for check props
index/uid_codec.py, index/uid_index.py 220 keep uid codec and lookup
read/ (scene, scene-diff, refs, orphans, autoloads, stats, tiles, fit plans) 2,301 keep the read side
write/scene_edit.py 647 keep set and add (now 385) an inherited scene with overrides or local materials, which a headless save damages
checks/uid, props, tres_comment, unit_disk, patterns, addon, roster 1,683 keep outcomes: broken loads, dead properties, comments the saver drops, tests touching live saves, a project's own patterns, add-on rules
install.py, skill_install.py, cli.py 1,294 keep installers and the router
installables: runners, Makefile.gates/tiers, sandbox hook, the four skills — keep engine runners, gate framework, skills
write/refs_rename.py, write/autoloads_edit.py 826 cut the editor; refs <symbol> proves no caller is left
scene rename|rm|reparent|connect|disconnect|new (in scene_edit) ~260 cut the editor or a headless GDScript
write/scene_canonicalize.py, write/editor_layout.py, format/value_spelling.py, format/value_order.py, index/resource_canonical.py, resource_defaults.py, engine_defaults.py, gd_declarations.py, shader_uniforms.py 2,597 cut Godot writes its own form
write/refs_retarget.py 235 cut the FileSystem dock; uid-in-refs finds a moved file
write/tiles_paint.py, format/atlas_map.py 402 cut TileMapLayer.set_cell, set_cells_terrain_connect
checks/canonical, defaults, tres 334 cut style policing of what the saver writes
checks/test_shape, ui_layout, rng, warnings 946 cut house rules, not Godot primitives

Lines

main this PR
Python source 17,557 11,269
Python tests 9,324 6,943

classdb.json drops the engine method and signal names only the rename read: 416 KB to 129 KB.

Release notes

godot-devkit 5.0.0 retires scene text surgery and the style checks: Godot writes its own files, and the devkit keeps the read side, scene set/add for inherited scenes, outcome checks, runners and skills. major.

Upgrade: drop each removed command and each removed gate from [roster] checks, then bump the pin.

Removed Replacement
scene rename|rm|reparent|connect|disconnect|new the editor, or a headless GDScript: load → edit with the node API (owner = root on new nodes, CONNECT_PERSIST on signals) → PackedScene.pack → ResourceSaver.save
scene canonicalize nothing: a file Godot saved is already in its form
tiles paint|erase TileMapLayer.set_cell, erase_cell, set_cells_terrain_connect in a headless GDScript
refs --retarget move in the editor's FileSystem dock; headless, uid-in-refs finds the moved file and the next save writes the new path
refs --rename rename in the editor, or edit by hand and prove no caller is left with refs <symbol>
autoloads add|rm Project Settings > Autoload, or ProjectSettings.set_setting/clear + save() in a headless script
check canonical|defaults|tres drop from [roster] checks; the engine writes the form
check test-shape|ui-layout|rng|warnings drop from [roster] checks; keep a game scan if the rule matters to that game

Stock check all is now props tres-comment unit-disk; opt-in uid patterns addon.

Wiki rows (draft, for a local session)

  • Verb reference: remove every verb in the table; keep scene set and scene add with the "inherited scenes" reason; add a "Changing scenes" section pointing at the skill's headless GDScript pattern.
  • Check reference: remove the seven gates.
  • New page "Migrating from 4.x to 5.0" with the table above.

Gates

make check: shell PASS (16 scripts), godot-check PASS (3 checks). make test: 228 passed, 1 failed: test_fit_sweep::test_the_runner_fails_an_empty_scope… stops at "drawing needs a display" with no DISPLAY on a Mac; it fails the same way on main.

🤖 Generated with Claude Code

…#184)

Godot native first; a .tscn is the layout with sample content; data-driven
means data the editor writes. The ActionBar example is now an authored scene.
The godot-devkit skill shows how to change a scene headless with Godot itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No game calls either verb. Godot writes its own files: the editor, or a
headless GDScript that saves with ResourceSaver. A removed verb exits 2 and
names its replacement. The engine method and signal names in the classdb
snapshot only served the rename and go with it (416 KB to 129 KB).
The godot-devkit skill, README and CLAUDE.md now describe a read-side
library with no scene-text write verbs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cdowin cdowin changed the title Devkit diet: retire scene text surgery; the three UI principles godot-devkit 5.0.0: retire scene text surgery; the three UI principles Nov 13, 2026
@cdowin

cdowin commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

Lead check of the headless scene-edit pattern in the godot-devkit skill (Godot 4.7.2, a throwaway project): it works.

  • Adding a node: clean. The first save also writes unique_id on every node. That happens only once, on scenes hand-written without ids; editor-saved scenes already carry them.
  • Changing one property gives a one-line diff (text = "30" to "45"): the stable form the text tools existed for, produced by Godot itself.
  • Rerunning the add script adds the node again. Add to the skill: edit scripts must be idempotent (get_node_or_null before add_child), and note the one-time unique_id normalization so a reviewer is not surprised by it.

@cdowin

cdowin commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

Two corrections from Trail's diet (cdowin/trail#816), which put the skill's pattern behind a make edit SCRIPT=<path.gd> wrapper:

  1. Put the work in _initialize(), not _init(): in a --script SceneTree, autoloads do not exist yet in _init(). The skill example uses _init(). My earlier check passed only because it touched no autoload.
  2. Godot exits 0 when the edit script fails to compile, so the wrapper must fail on a SCRIPT ERROR line itself. That belongs in the runner the devkit ships (a gdk_edit beside gdk_runners.sh), so each game does not reinvent it.

#185)

Godot writes its own files. The devkit keeps one narrow writer, scene set
and scene add, for inherited scenes a headless save damages (shader
parameters, tile overrides). Removed: scene rename|rm|reparent|connect|
disconnect|new, scene canonicalize and its editor-form modules, tiles
paint|erase, refs --retarget, and check canonical|defaults|tres|test-shape|
ui-layout|rng|warnings. A removed verb or rostered gate exits 2 and names
its replacement. Dead document helpers go with them.

The godot-devkit skill now uses _initialize(), says edit scripts must be
idempotent and fail on SCRIPT ERROR, notes the first-save unique_id diff,
and says when to use scene set/add. A fourth principle, run the scene not
the game, joins godot-ui, godot-101 and the context block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cdowin cdowin changed the title godot-devkit 5.0.0: retire scene text surgery; the three UI principles godot-devkit 5.0.0: retire scene text surgery and style checks; four principles Nov 13, 2026
@cdowin
cdowin marked this pull request as ready for review November 13, 2026 19:17
@cdowin
cdowin enabled auto-merge November 13, 2026 19:17
@cdowin
cdowin merged commit fc2fca7 into main Nov 13, 2026
4 checks passed
@cdowin
cdowin deleted the 185-diet branch November 13, 2026 19:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

1 participant