build-game-ui-kits
Game UI kits: raster UI from imported art, Imagegen, or explicit Grok stills; neutral-background controls, icons, HUD parts, interaction states, density variants, nine-slice assets, provenance, state/
SKILL.mdSKILLS/build-game-ui-kits/SKILL.md
GitHubBuild Game UI Kits
Create a portable raster family with explicit components, tokens, densities, states and nine-slice geometry. This folder contains the complete raster UI workflow. Animation and cross-family coordination are separate scopes.
Workflow
Define components, intended sizes/densities, required states, stretch regions, color tokens and style fingerprint. Use the state keys supported by the schema. A missing state contract needs a decision; do not silently rename it to a different behavior. Done when the requested controls and state coverage are explicit.
Import approved art or use the available image tool, with Imagegen as the default and Grok stills only when explicitly selected. Keep the exact request, provider result and selected bytes, then fill the bundled schema's provenance fields. No separate skill is required.
$imagegenand the Grok Imagine CLI are optional client tools; a paid Grok run requires a reviewed dry run and current-task consent. Without generation access, use approved imports or record the missing provider. Keep real provenance on every state/density variant. A fixture tests geometry, not production media. Deterministic tools may prepare and validate assets; they must not draw replacement production UI. Done when current source paths and hashes identify the actual art.Preserve accepted identity, text/icon geometry and valid native alpha. For a necessary matte, use flat gray, black, or white. Do not request new green, blue, cyan, or magenta chroma. Use a reviewed cutout when neutral subject colors make removal ambiguous. BiRefNet/BEN2 comparison requires that scope; it does not justify replacing good native alpha. Regenerate a failed semantic state from the accepted provider base instead of procedurally repainting production UI. Done when every required state is actually distinct where its behavior requires it and all art is below the kit root.
Write
ui-kit.jsonand run the installed skill's CLI from any working directory:python "<skill-root>/scripts/validate_ui_kit.py" --kit "<kit-root>/ui-kit.json" --root "<kit-root>"Use the existing runtime and requirements; installation needs the task's authority. Done when schema, source hashes, states/densities and geometry checks pass or failures are recorded.
Inspect state and stretch evidence, plus the source variants at their intended render sizes. The state board proves state/density comparison only at thumbnail scale. Check identity, legibility, alignment, focus cues, alpha edges and required density/state parity. A thumbnail comparison cannot establish one-to-one readability or an interactive control's behavior. Done when each requested visual/state/stretch claim has relevant proof, with gaps kept visible.
Rules that fail a kit
Plan sizes and states against these before generating; the validator rejects each one.
densitiesare unique integers 1–4. Every state of every component has exactly one variant per declared density, and each variant is exactlybase_size × densitypixels (base 48×16 at density 3 is 144×48). Make the largest density first and derive smaller ones with a filter that matches the style: nearest-neighbour at integer ratios for pixel art, Lanczos for painted art. Then inspect each one, because derived variants still need real provenance.- State keys:
default,hover,pressed,disabled,selected,focused,active. Everyrequired_statesentry must exist instates. Componenttypeisbutton,panel,bar,icon,cursor,badge,frameortoggle. nine_slicemargins are density-1 pixels, each at least 1, withleft + right < widthandtop + bottom < height.content_safemust sit inside the center cell (x ≥ left,y ≥ top,x + width ≤ base width − right,y + height ≤ base height − bottom). Keep every non-stretchable detail (bevels, rivets, corner ornaments) in the corners. Make edges uniform along their stretch axis, because the stretch board scales edge and center cells with nearest-neighbour to 2× base size; it does not tile them.- Token contrast is the WCAG 2 ratio of
tokens.foregroundagainsttokens.background(#RRGGBB). Setminimum_contrastto at least 4.5 for body text, or 3 for large text and non-text UI. The check reads only the two tokens, never the rendered art. - Paths are relative POSIX paths inside the kit root: no
\,:, leading/,.., trailing dot or space, or Windows reserved names.grok-imagine-imagevariants requireprovider_record(path,sha256) inside the kit root;verification_statusis alwaysverified.
Validator and proof scope
The CLI writes qa/ui-kit-report.json, qa/ui-state-board.png and qa/ui-nine-slice.png. Each replacement is atomic individually. Path-preflight errors emit stdout JSON without writing a report; other contract failures may replace the diagnostic report while retaining old proof images. This is not a transaction, and operational failures can leave a mixed set. Verify the final hashes and current result.
The state board fits variants into thumbnail cells. Contrast is calculated from declared foreground/background tokens, not measured from rasterized text or every state image. The helper's stretch board uses density 1 and the first required state where applicable. An empty placeholder or an unrendered required variant is not stretch proof. Mark truly inapplicable checks as such; supply the missing applicable stretch/state evidence before claiming completion.
representative reflects non-fixture provenance declarations. Hash checks bind bytes and supplied records; they do not independently prove authorship, art rights, acceptable cutout quality or complete accessibility. Keep actual visual inspection and relevant runtime/input proof when the requested delivery includes it.
Completion
Require a current successful report, matching source/proof hashes, portable paths, valid provenance, all required states/densities and inspected applicable boards. A fixture pass or token contrast value is not production-art or whole-control approval. Preserve accepted sources and useful proof; cleanup needs the project's authority.
validation module owns the validator/rendering. The bundled MIT LICENSE is for the skill code, not a substitute for the source-art rights record.