godot-composition-apps
Installation
SKILL.md
Godot Composition & Architecture (Apps & UI)
This skill enforces the Single Responsibility Principle within Godot's Node system. Whether building an RPG or a SaaS Dashboard, the rule remains: One Script = One Job.
The Core Philosophy
The Litmus Test
Before writing a script, ask: "If I attached this script to a literal rock, would it still function?"
- Pass: An
AuthComponenton a rock allows the rock to log in. (Context Agnostic) - Fail: A
LoginFormscript on a rock tries to grab text fields the rock doesn't have. (Coupled)
The Backpack Model (Has-A > Is-A)
Stop extending base classes to add functionality. Treat the Root Node as an empty Backpack.
- Wrong (Inheritance):
SubmitButtonextendsAnimatedButtonextendsBaseButton. - Right (Composition):
SubmitButton(Root) HAS-AAnimationComponentand HAS-ANetworkRequestComponent.
The Hierarchy of Power (Communication Rules)
Strictly enforce this communication flow to prevent "Spaghetti Code":