gum-architecture-layers

Explains Gum's Forms, Runtime, and Renderable layering and which layer owns each responsibility.

614|78|Updated Mar 11, 2015
One-click install
npx skills add https://github.com/vchelaru/Gum --skill gum-architecture-layers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gum-architecture-layers
Source: https://github.com/vchelaru/Gum/tree/main/.claude/skills/gum-architecture-layers
Command: npx skills add https://github.com/vchelaru/Gum --skill gum-architecture-layers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers working in the Gum UI codebase often cannot tell whether a piece of logic belongs in the Forms, Runtime, or Renderable layer, leading to misplaced code and confusion between Runtime types and backend renderables.

Core Features & Use Cases

  • Layer Ownership Map: Defines what the Forms, Runtime (GueDeriving), and Renderable layers each own and how code is shared across backends like MonoGame, Skia, and raylib.
  • Property Dispatch Guidance: Explains why CustomSetPropertyOnRenderable exists, its two dispatch styles (renderable-type vs runtime-type), and why runtime-type dispatch is the preferred direction.
  • Use Case: When adding a new property to a control and wondering whether to dispatch on renderableIpso is LineCircle or graphicalUiElement is CircleRuntime, this Skill tells you to prefer Runtime-type dispatch and why.

Quick Start

Ask which layer a given Gum class or property belongs in, for example whether a texture property should be dispatched on the renderable or the Runtime type.

Frequently Asked Questions about gum-architecture-layers

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

FAQPage Schema
What is the difference between Forms, Runtime, and Renderable layers in Gum?

Forms hold lookless interaction and state logic shared across all backends, Runtime types like SpriteRuntime wrap Gum layout and forward properties to a renderable, and Renderables contain the actual per-backend drawing code such as MonoGame Sprite rendering.

How do I decide which layer new Gum code belongs in?

Place lookless control logic in Forms, layout and property-forwarding in a Runtime type, and backend-specific drawing in a Renderable. Forms only talk to Runtimes through Gum's property and layout API, never to backend drawing code directly.

Should I dispatch on renderable type or runtime type in CustomSetPropertyOnRenderable?

Prefer runtime-type dispatch for new branches. Runtimes are portable across backends while renderables are not, and runtime dispatch avoids ambiguity when a Runtime owns multiple renderable slots, such as CircleRuntime's fill and stroke.

Why do Runtime types like SpriteRuntime exist in Gum?

Runtime types were added as a convenience layer over the manual pattern of building a GraphicalUiElement and assigning it a renderable. They let code-only users write new SpriteRuntime() instead of wiring the GUE and renderable by hand.

Are Gum Runtime classes shared across backends like MonoGame and Skia?

Sharing is partial. Some Runtimes are linked across backends while others are forked per backend due to texture and blending differences gated by #if directives. Renderables are effectively never shared except among XNA-like backends.