agentleFS
vchelaruvchelaru/Gum/.claude/skills/gum-layout/SKILL.md

gum-layout

Skill659 starsChanged 2 months agoMITView on GitHub

Gum's layout system — dimension units, position units, children layout modes, layout calculation flow, suspension. Triggers: Width/HeightUnits, XUnits/YUnits, stacking, wrapping, auto-sizing, Anchor/Dock, GraphicalUiElement layout logic. For engine internals see gum-layout-engine.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All layout lives in GraphicalUiElement (the GumRuntime/GraphicalUiElement.*.cs partials.

    line 11

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gum Layout System

Gum's layout is driven by unit enums that tell the engine how to interpret numeric Width/Height/X/Y values, plus a children layout mode on containers. All layout lives in GraphicalUiElement (the GumRuntime/GraphicalUiElement.*.cs partials; file map in gum-layout-engine).

Key Concepts

Dimension Units (Width & Height)

DimensionUnitType enum (GumDataTypes/DimensionUnitType.cs) controls how a Width or Height value is interpreted. Units fall into dependency categories:

DependencyUnits
No dependencyAbsolute, PercentageOfSourceFile, PercentageOfOtherDimension, MaintainFileAspectRatio, AbsoluteMultipliedByFontScale, ScreenPixel
Depends on parentPercentageOfParent, RelativeToParent, RelativeToMaxParentOrChildren*
Depends on childrenRelativeToChildren
Depends on siblingsRatio

* RelativeToMaxParentOrChildren is classified as DependsOnParent but also depends on children — special-cased throughout the layout engine. See dimension-units.md for circular dependency handling.

See dimension-units.md for detailed descriptions.

Position Units (X & Y)

GeneralUnitType enum (GumDataTypes/UnitConverter.cs) controls how X/Y values are measured: from edges, center, baseline, or as percentages. Combined with XOrigin/YOrigin (HorizontalAlignment/VerticalAlignment) to set which point on the element is being positioned.

See dimension-units.md for detailed descriptions.

Children Layout

ChildrenLayout enum (Gum/Managers/StandardElementsManager.cs):

  • Regular — children positioned independently
  • TopToBottomStack / LeftToRightStack — stack children along an axis
  • AutoGridHorizontal / AutoGridVertical — arrange in wrapping grid

Related properties: StackSpacing, WrapsChildren, AutoGridHorizontalCells, AutoGridVerticalCells, StackedRowOrColumnDimensions.

Anchor & Dock

Convenience APIs on GraphicalUiElement that set multiple layout properties at once (X, Y, XUnits, YUnits, XOrigin, YOrigin, Width, WidthUnits, etc.).

  • Anchor — 9 positions (TopLeft..BottomRight) + CenterHorizontally/Vertically
  • Dock — Top, Left, Right, Bottom, Fill, FillHorizontally, FillVertically, SizeToChildren

Layout Engine

See layout-engine.md for the calculation flow, suspension system, dirty tracking, and performance considerations.

Quick Reference

MethodPurpose
UpdateLayout()Full layout recalculation
UpdateLayout(updateParent, childrenUpdateDepth, xOrY)Granular control
SuspendLayout(recursive)Pause layout, queue as dirty
ResumeLayout(recursive)Resume and apply queued updates
AbsoluteWidth / AbsoluteHeightFinal computed dimensions
MakeDirty(...)Queue deferred update when suspended

Key Properties

  • IsLayoutSuspended — instance-level pause
  • IsAllLayoutSuspended — thread-static global pause (background loading)
  • GlobalFontScale — multiplier for AbsoluteMultipliedByFontScale
  • CanvasWidth / CanvasHeight — root canvas size

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.