Synthèse automatique
Explique comment le plugin Gum de Glue régénère les runtimes d'éléments standard et comment conditionner l'omission de propriétés Gum selon une valeur GluxVersions.
Points forts
- Identifie clairement les trois pipelines indépendants (propriétés, états, héritage) qui doivent rester cohérents et associe à chacun son erreur de compilation typique (CS0103, CS0535).
- Donne une astuce de recherche concrète : retrouver un nom de variable déjà ignorée pour localiser tous les points à modifier en parallèle.
- Signale un piège important : Glue ne réaligne jamais les éléments standard d'un projet chargé sur le schéma canonique de Gum.
Limites
- Contenu très spécifique au dépôt interne Glue/Gum, inutilisable hors de ce codebase.
- Le texte fourni est tronqué et renvoie à une autre compétence (gluj-versions) ainsi qu'à des fichiers non inclus.
- Suppose une connaissance préalable de l'architecture du générateur et des interfaces Gum.Wireframe.
À utiliser lorsqu'on ajoute, retire ou conditionne une propriété générée sur un runtime Gum standard dans Glue, ou pour diagnostiquer une variable Gum générée ou omise à tort.
À éviter pour du développement Gum côté runtime ou pour du code generation hors de Glue, où l'architecture décrite ne s'applique pas.
Analyse de sécurité
SûrThis 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.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
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.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
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. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
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 doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/gum-code-generation-in-glue-mw06rtxn'openskills read 'gum-code-generation-in-glue-mw06rtxn'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/gum-code-generation-in-glue-mw06rtxn/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.