Loading...
Loading...
Expert architectural standards for building scalable Godot applications (Apps, Tools, UI, or Games) using the Composition pattern. Use when designing node structures, refactoring monolithic scripts, or implementing complex behaviors. Enforces "Has-A" relationships over "Is-A" inheritance.
npx skill4agent add thedivergentai/gd-agentic-skills godot-composition-appsAuthComponentLoginFormSubmitButtonAnimatedButtonBaseButtonSubmitButtonAnimationComponentNetworkRequestComponent| Direction | Source → Target | Method | Reason |
|---|---|---|---|
| Downward | Orchestrator → Component | Function Call | Manager owns the workers; knows they exist. |
| Upward | Component → Orchestrator | Signals | Workers are blind; they just yell "I'm done!" |
| Sideways | Component A ↔ Component B | FORBIDDEN | Siblings must never talk directly. |
LoginScreen.gdUserProfile.gd| Concept | App/UI Example |
|---|---|
| Orchestrator | |
| Component 1 | |
| Component 2 | |
| Component 3 | |
# auth_component.gd
class_name AuthComponent extends Nodeget_node("Path/To/Child")# Orchestrator script
@export var auth: AuthComponent
@export var form_ui: Control%@onready var submit_btn = %SubmitButtonNetworkComponentNetworkComponentlogin(username, password)InputComponentget_parent().healthclipboard_copier.gdclass_name ClipboardCopier extends Node
signal copy_success
signal copy_failed(reason)
func copy_text(text: String) -> void:
if text.is_empty():
copy_failed.emit("Text empty")
return
DisplayServer.clipboard_set(text)
copy_success.emit()share_menu.gdextends Control
# Wired via Inspector
@export var copier: ClipboardCopier
@export var link_label: Label
func _ready():
# Downward communication
%CopyButton.pressed.connect(_on_copy_button_pressed)
# Upward communication listening
copier.copy_success.connect(_on_copy_success)
func _on_copy_button_pressed():
# Orchestrator delegation
copier.copy_text(link_label.text)
func _on_copy_success():
# Orchestrator managing UI state based on signal
%ToastNotification.show("Link Copied!")