Automated summary
Explains how Glue's Gum plugin regenerates standard element runtimes and how to version-gate the omission of Gum properties against a GluxVersions value.
Strengths
- Clearly separates the three independent pipelines (property, state, inheritance) that must agree, and names the compiler error each mismatch produces (CS0103, CS0535).
- Gives a concrete search heuristic: grep for an already-skipped variable name to find every location needing a parallel change.
- Flags a real landmine: Glue never back-fills a loaded project's standard elements from Gum's canonical schema.
Limitations
- Deeply tied to the internal Glue/Gum codebase; not reusable elsewhere.
- The supplied text is truncated and delegates version-numbering rules to a separate skill plus files not included here.
- Assumes prior familiarity with the generator architecture and the Gum.Wireframe interfaces.
Use it when adding, removing, or version-gating a generated property on a Gum standard runtime in Glue, or when debugging why a Gum variable is or isn't being generated.
Skip it for Gum runtime-side work or code generation outside Glue, where the described architecture does not apply.
Security analysis
SafeThis is a pure internal engineering reference document describing Glue/Gum code-generation pipelines, file paths, and C# snippets. It declares no tools and contains no executable instructions, network calls, credential handling, or destructive operations; the code fragments are illustrative examples of repository code, not actions to run.
No concerns found
How this analysis is madeExamples
Gum added a new 'CornerRadius' variable to NineSlice; update Glue's Gum codegen so it's only emitted for projects on GluxVersions 2.5+, covering property, state, and inheritance generation.My Glue-generated NineSliceRuntime is missing IsTilingMiddleSections and I get CS0103 in StateCodeGenerator output — trace which skip list is dropping it.A Gum standard type now implements Gum.Wireframe.IFooRuntime; walk me through updating AddAdditionalInheritance and InterfaceMemberNames so GumGeneratedCodeCompilesTests passes.name: gum-codegen description: Use when working on Glue's Gum code generation — adding/removing/version-gating generated properties on Gum standard runtime types (NineSlice, Text, Container, Sprite, etc.), or debugging "why is/isn't this Gum variable being generated." version: 1.0.0
Gum Code Generation in Glue
Glue does not rely on Gum's own runtime code generation for the standard element runtimes. Instead, the Gum plugin regenerates these classes itself from the Gum project data. The upside is tight control over what gets emitted; the downside is that whenever Gum adds, removes, or renames a variable on a standard type, Glue's generator has to be updated to match — otherwise the new variable is silently emitted (causing build/runtime errors on older projects) or silently omitted (causing missing properties on newer projects).
This skill is about the omission side: how Glue decides which Gum variables to skip when generating a standard runtime, and how to gate that decision on a GluxVersions value. For the version-numbering rules themselves, see the gluj-versions skill.
There are THREE independent decisions, not one
Generating a standard runtime like NineSliceRuntime.Generated.cs involves three independent code paths. All three must agree on whether a member exists in a given version, and each disagreement has its own compiler error:
- Property generation — emits the
public T Foo { get; set; }(or backing-field) property on the runtime class. Driven byStandardsCodeGeneratorand per-type generators (NineSliceCodeGenerator, etc.). - State generation — emits the
case VariableState.Default: Foo = …;assignments inside the state-switch. Driven byStateCodeGenerator. - Inheritance — emits the
: global::Gum.Wireframe.IFooRuntimeon the class declaration, via each per-type generator'sAddAdditionalInheritance(wired up inStandardsCodeGenerator.GenerateStandardElementSaveCodeFor).
Property vs. state disagreement is CS0103: The name 'IsTilingMiddleSections' does not exist in the current context — a state-init assignment for a property nobody generated. Inheritance vs. property disagreement is CS0535: does not implement interface member (issue #1979).
Pipelines 1 and 2 are driven by the project's variables; pipeline 3 is driven by GluxVersions alone, so it is the one that most easily drifts. The Gum.Wireframe.I*Runtime interfaces it names are hand-written in the sibling Gum repo under #if FRB (Gum/Wireframe/CustomSetPropertyOnRenderable.cs) and mirror what Glue generates; they grow as Gum routes more of its property dispatch through the runtime instead of the renderable. Glue holds no reference to GumCore, so nothing in Glue can read one — NineSliceCodeGenerator.InterfaceMemberNames restates the contract by hand, and GumGeneratedCodeCompilesTests is what detects drift. ContainerCodeGenerator/PolygonCodeGenerator avoid the problem differently, by emitting their interface members from GenerateAdditionalMethods rather than relying on the project's variables at all.
When you add a version gate, update every pipeline that touches the member. Searching for an existing skipped variable name (e.g. "IgnoredByParentSize", "StackSpacing") is the fastest way to spot every place that needs a parallel change — they typically appear in both StandardsCodeGenerator.RefreshVariableNamesToSkipForProperties and StateCodeGenerator.RefreshVariableNamesToSkipBasedOnGlueVersion.
Glue never back-fills a loaded project's standard elements (landmine)
Codegen emits from the variables in the project's own .gutx, and Glue never reconciles that against Gum's canonical schema. Gum's tool does (GumProjectSaveExtensionMethods.Initialize back-fills each standard element from StandardElementsManager, gated by VariableSave.MinimumGumxVersion); Glue calls GumProjectSave.Load and never that. What it does call — FileReferenceTracker.InitializeElements — passes each element its own default state, which resolves variable types but back-fills nothing.
Consequences worth knowing before debugging "why isn't this variable generated":
- A
.gutxwritten before Gum added a variable never gains it, at any Glue version. Every checked-in sample is in this state. - Bumping
GluxVersionsalone will not make a variable appear — if the project's.gutxlacks it, no gate change helps. - A fixture built from
StandardElementsManager.Self.GetDefaultStateFor(name)is a current editor's output, so it cannot reproduce this. Load a real sample's.gumxand callInitialize(element.DefaultState)per element to match production — seeGumGeneratedCodeCompilesTests.LegacyGutxStandardElementRuntimes_ShouldCompileAgainstTheRealEngine. - Nothing bumps an existing
.gluj'sFileVersionon load (only new projects getLatestVersion, inProjectLoader). The live combination is the project's ownFileVersion+ whatever its.gutxcontains, and a source-linked project can pair a very oldFileVersionwith the newest Gum runtime.
The compiler can never catch a runtime mismatch (landmine)
Glue has no compile-time knowledge of the runtime types it generates against. mStandardElementToQualifiedTypes holds fully-qualified type names as plain strings; RenderingLibrary.Graphics.Text is not a referenced assembly in any Glue project, and it is not among GumPlugin's embedded LibraryFiles resources either (LineRectangle.cs is embedded, Text.cs is not). So emitting ContainedText.DropshadowBlur for a member that doesn't exist compiles Glue perfectly and only fails in the user's game project, as CS1061.
A Gum variable whose Type is an enum name (GradientType, ColorOperation) is emitted verbatim as the property's type, so it needs an entry in GueDerivingClassCodeGenerator's mTypeToQualifiedTypes or the generated file fails with CS0246 in the user's game.
This is why the bug class recurs: Rectangle/Circle's fill/stroke family (#1907), the Arc/ColoredCircle gradient CS0266, and Text's dropshadow-channel + LocalizeText family were each found by a user's build breaking, not by CI.
GlueUnitTests/GumPlugin/GumRuntimeMemberContractTests.cs is the guard: it builds the engine's Forms solution, reflects over the real GumCore/SkiaInGum assemblies, and asserts every ContainedXxx.Member the generator emits exists on the mapped runtime type. It's driven off StandardsCodeGenerator.StandardElementToQualifiedTypes, so a standard element added to that map is covered automatically. When Gum extends a standard element's schema, that test — not the compiler — is what tells you whether FRB's runtime can back it.
Note the fix is per-member, not per-type: Text legitimately backs HasDropshadow/DropshadowOffsetX/DropshadowOffsetY (it has a single DropshadowColor) while having no per-channel color, no blur, and no LocalizeText. Skip only what's actually unbacked.
CI goes red after Gum adds a variable
Glue generates from whatever the sibling Gum repo's current schema holds, so a Gum commit can break Glue tests with no FRB change. The detectors are GumGeneratedCodeCompilesTests (CS1061 on the generated runtime), GumRuntimeMemberContractTests, and the NineSliceRuntimeInterfaceContractTests text checks. Decide per variable: if FRB's runtime can't back it, add a permanent per-type skip to both AddTypeSpecificVariableNamesToSkipForProperties and ...ForStates (see ContainerCodeGenerator's SourceShaderFile and ShaderParameters); if it can, version-gate it as below. Default to the skip for anything that only adds visual functionality to Gum objects (shaders, effects, new rendering options): FRB1 leaves those out unless a game explicitly needs one. Text assertions on generated code must match a whole member name, not a substring, because CustomBorderScaleBottom contains BorderScale.
Where it lives
Property pipeline:
- Central orchestrator:
FRBDK/Glue/GumPlugin/GumPlugin/CodeGeneration/StandardsCodeGenerator.cs - Per-type contributors:
NineSliceCodeGenerator.cs,TextCodeGenerator.cs,ContainerCodeGenerator.cs, etc. (same folder) - Wired up in
MainGumPlugin.cs(each per-type generator is instantiated and passed intoStandardsCodeGenerator).
State pipeline:
FRBDK/Glue/GumPlugin/GumPlugin/CodeGeneration/StateCodeGenerator.cs- Two relevant entry points:
RefreshVariablesToSkipForStates()(unconditional skips and per-type contributions) andRefreshVariableNamesToSkipBasedOnGlueVersion()(version-gated skips, the right place for aGluxVersions-keyed gate).
The two skip lists
StandardsCodeGenerator keeps two collections that drive omission, both cleared and rebuilt every time RefreshVariableNamesToSkipForProperties() runs:
mVariableNamesToSkipForProperties—List<string>. Applies to every standard element. Use for variables that should never be generated regardless of type (X,Y,Width,Visible, etc., already handled byGraphicalUiElement)._typedVariableNamesToSkipForProperties—Dictionary<string, List<string>>keyed by standard element name (e.g."NineSlice"). Use for variables that only exist on a specific type and should be skipped only there.
Both lists are consumed by GetIfShouldGenerateProperty(variable, standardElementSave), which is called for every variable on the default state during generation. Anything in either list short-circuits to false.
Version-gating an omission
There are two patterns depending on whether the variable is type-specific.
Global (any standard element): use the local ExcludeIfVersionLessThan helper inside RefreshVariableNamesToSkipForProperties:
ExcludeIfVersionLessThan("CustomFrameTextureCoordinateWidth", GluxVersions.GumUsesSystemTypes);
This adds the name to mVariableNamesToSkipForProperties only when the loaded project is below the gating version.
Type-specific: put the gate on the per-type generator as a bool property, then conditionally add to its contribution. NineSliceCodeGenerator is the canonical small example:
bool HasNineSliceAnimate =>
_glueState.CurrentGlueProject?.FileVersion >= (int)GluxVersions.GumNineSliceHasAnimate ||
_glueState.CurrentMainProject?.IsFrbSourceLinked() == true;
internal void AddTypeSpecificVariableNamesToSkipForProperties(
Dictionary<string, List<string>> typedVariableNamesToSkipForProperties)
{
var variablesToIgnore = new List<string>();
typedVariableNamesToSkipForProperties.Add("NineSlice", variablesToIgnore);
if (!HasNineSliceAnimate)
{
variablesToIgnore.Add("Animate");
}
}
Two things to note in that pattern:
IsFrbSourceLinked()plays the same role asREFERENCES_FRB_SOURCEin embedded code files: if the user references FRB as source, treat the feature as available regardless ofFileVersion. Always include this arm for type-specific gates.- The list is registered in the dictionary unconditionally (with the type name as key). Only the contents are conditional. This is so
GetIfShouldGeneratePropertycan do a single dictionary lookup per type.
Live GumxVersions gating — a different axis than the GluxVersions skip-lists above
Everything above gates on GluxVersions (Glue's own file format) at skip-list-refresh time. A standard element's variable family — and even which qualified runtime type it maps to — can instead need gating on Gum's own project version (GumxVersions, e.g. ShapeVariableExpansion), read live off Gum.Managers.ObjectFinder.Self.GumProjectSave.Version at generation time rather than cached in a skip-list refresh. This matters when one generator instance/process must serve whatever gumx version happens to be loaded (old and new projects both use the same Glue build), so the decision can't be baked in once. See StandardsCodeGenerator.IsRectangleFillStrokeSupported/GetQualifiedTypeFor for the pattern: a live bool checked both when choosing the contained type (mStandardElementToQualifiedTypes lookup vs. an override) and when deciding per-property generation, instead of a static skip list.
State-pipeline gate
StateCodeGenerator.RefreshVariableNamesToSkipBasedOnGlueVersion uses a paired Include / Skip helper pattern. To gate a new variable, add a block alongside the existing ones:
if (version >= (int)GluxVersions.NineSliceHasTilingMiddleSections)
{
Include("IsTilingMiddleSections");
}
else
{
Skip("IsTilingMiddleSections");
}
For a variable that only exists on a single standard type (like IsTilingMiddleSections on NineSlice), a global skip is fine — older projects don't have that type with that variable, so a global gate is harmless and matches existing precedent (StackSpacing, IgnoredByParentSize, IsBold, etc., are all gated globally here).
There's also a per-type variant analogous to the property pipeline (AddTypeSpecificVariableNamesToSkipForStates on per-type generators, dictionary-keyed by element name). Use it only when a variable name might collide across types and the gate must apply to one type.
When you're adding a new gate
- Decide if the variable is global or type-specific.
- Add a
GluxVersionsentry per thegluj-versionsskill (includingLatestVersion,SyntaxVersionAttribute, docs). - Update every pipeline that touches it:
- Property pipeline:
ExcludeIfVersionLessThan(...)inStandardsCodeGenerator.RefreshVariableNamesToSkipForProperties(global) or theNineSliceCodeGenerator-styleHasFeaturebool + conditionalAdd(type-specific). - State pipeline: an
if/elseInclude/Skipblock inStateCodeGenerator.RefreshVariableNamesToSkipBasedOnGlueVersion. - Inheritance: only if the member belongs to a
Gum.Wireframe.I*Runtimeinterface — gate the members on the same bool asAddAdditionalInheritance, never a separate one. That bool is also true for source-linked projects at anyFileVersion, so interface members must bypass the skip lists (NineSliceCodeGenerator.IsRequiredByDeclaredInterface, checked first inGetIfShouldGenerateProperty); aFileVersion-only skip otherwise drops a member the interface requires.
- Property pipeline:
- The gate's polarity is "skip when below version", i.e. older projects don't see the new variable. The new variable becomes visible at and above the gating version.
A pre-flight check that's saved time more than once: pick one already-gated variable (IgnoredByParentSize is a good one) and grep for it. Every place it appears is a place your new variable probably also needs to appear.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/gum-code-generation-in-glue-mw06rtxn' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/gum-code-generation-in-glue-mw06rtxn/download' --output '.skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md.part' && mv '.skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md.part' '.skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md' && test -s '.skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/gum-codegen' && cp -R '.skill-downloads/gum-code-generation-in-glue-mw06rtxn' '.claude/skills/gum-codegen'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/gum-code-generation-in-glue-mw06rtxn'openskills read 'gum-code-generation-in-glue-mw06rtxn'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.