godot-composition

Installation
SKILL.md

Godot Composition Architecture

Core Philosophy

This skill enforces Composition over Inheritance ("Has-a" vs "Is-a"). In Godot, Nodes are components. A complex entity (Player) is simply an Orchestrator managing specialized Worker Nodes (Components).

The Golden Rules

  1. Single Responsibility: One script = One job.
  2. Encapsulation: Components are "selfish." They handle their internal logic but don't know who owns them.
  3. The Orchestrator: The root script (e.g., player.gd) does no logic. It only manages state and passes data between components.
  4. Decoupling: Components communicate via Signals (up) and Methods (down).

Anti-Patterns (NEVER Do This)

  • NEVER use deep inheritance chains (e.g., Player > Entity > LivingThing > Node). This creates brittle "God Classes."
  • NEVER use get_node("Path/To/Thing") or $ syntax for components. This breaks if the scene tree changes.
  • NEVER let components reference the Parent directly (unless absolutely necessary via typed injection).
  • NEVER mix Input, Physics, and Game Logic in a single script.
Installs
3
GitHub Stars
3
First Seen
May 2, 2026