gdscript-cleanup

Cleans changed GDScript code and related Godot scenes using typed interfaces and scene-authoring rules.

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/bbenefield89/skills --skill gdscript-cleanup-bbenefield89
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdscript-cleanup
Source: https://github.com/bbenefield89/skills/tree/main/skills/gdscript-cleanup
Command: npx skills add https://github.com/bbenefield89/skills --skill gdscript-cleanup-bbenefield89

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? After implementing features in a Godot project, GDScript code often accumulates loose typing, broad engine types, undocumented methods, and runtime node assembly that should live in scenes. This Skill performs scoped, behavior-preserving hygiene on changed GDScript files and directly related scenes so code stays typed, documented, and maintainable. ## Core Features & Use Cases - Scoped cleanup: Resolves scope from explicit user input or the working diff, touching only changed .gd files, affected interfaces, and directly related .tscn scenes while leaving unrelated legacy debt alone. - Typed interface enforcement: Replaces broad types like Node or Object with concrete project script types, adds explicit local types, typed enums, typed exports, and native ## documentation with supported BBCode. - Scene-authoring checks: Flags runtime construction of stable game objects (via Node.new() or scripted child assembly) that belong in .tscn scenes, asking before any behavioral or architectural change. - Metadata recovery: Refreshes Godot class metadata via headless import when a project type is unresolved, instead of weakening types to evade stale caches. - Use Case: After finishing a Godot feature branch, run this Skill to tighten typing on the changed scripts, document non-obvious method contracts, validate with focused checks, and produce a structured completion report. ## Quick Start Use gdscript-cleanup to clean the GDScript changed by this task and validate the fixes.

Frequently Asked Questions about gdscript-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up GDScript code after implementing a Godot feature?

Run the cleanup on the changed .gd files and directly related scenes. It resolves scope from your explicit instructions or the working diff, fixes typing and documentation issues in groups, and runs focused validation after each group.

What GDScript typing issues does Godot cleanup fix?

It replaces broad types like Node or Object with concrete project script types, adds explicit local types over loose := inference, uses typed enums for closed state sets, and converts exported NodePath lookups into typed exported node references.

When should Godot objects be created in scenes instead of at runtime?

Stable, intentional game world objects like walls, characters, cameras, and persistent UI belong in .tscn scenes. Runtime creation with Node.new() is appropriate only for genuinely dynamic objects like projectiles, procedural enemies, or pooled effects.

Does GDScript cleanup require a linter or formatter dependency?

No. The cleanup requires no formatter, linter, Python, uv, or uvx dependency. Validation uses the Godot editor's own headless import and parser checks through the repository command interface.

What happens when a Godot class_name type is unresolved during cleanup?

The cleanup runs godot --headless --import to refresh metadata, inspects .godot/global_script_class_cache.cfg and the class_name declaration, then retains or restores the concrete type. It avoids weakening types just to evade stale metadata.