Skip to content

RandallLiuXin/GodotMaker / skills/assets/ui-kit

ui-kit

Verified

Produce a complete reusable flat-first Godot UI Theme from a binding visual reference, with two provider-generated source sheets, fixed square nine-slice patches, stable AtlasTexture icons, and native Theme bindings.

---
name: ui-kit
description: Produce a complete reusable flat-first Godot UI Theme from a binding visual reference, with two provider-generated source sheets, fixed square nine-slice patches, stable AtlasTexture icons, and native Theme bindings.
---

# UI Kit Asset

Produce one reusable visual system, not a page layout. The result gives a
worker a complete Godot `Theme`, named `StyleBoxTexture` resources, and named
`AtlasTexture` icons. Its reusable art covers button states, panels, tabs, and
semantic icons. It does not create a composite screen, readable UI copy,
characters, logos, gameplay geometry, or final `Control`/`Container` layout.
Do not use it for card frames.
Do not use it for portrait frames.

Read [references/theme-baseline.md](references/theme-baseline.md) and
[references/source-sheet-scheme.json](references/source-sheet-scheme.json)
before planning. They own the baseline controls, stable runtime names, two
provider sheets, fixed patch geometry, and source-to-runtime reuse mappings.
The caller's brief supplies visual direction; do not make it repeat this
contract.

## Input gate

Accept the shared Asset Skill request schema at
`.godotmaker/asset-runtime/schema/asset-skill-request.schema.json`; require
`asset_type: ui-kit`, a pinned `provider` (`native`, `codex`, `gemini`,
`openai`, `grok`, or `wan`), and at least one readable image in `references`. Preserve every
reference `role`. Missing or unreadable references and pixel-art requests are
input-gate STOP conditions.

Validate the returned document with the shared result schema and checker at
`.godotmaker/asset-runtime/schema/asset-skill-result.schema.json` before family
binding checks.

Attach every reference as real image input to both provider calls. The Codex
route uses `referenced_image_paths`; other routes use their declared attachment
mechanism. Never reduce a reference to prompt text or silently switch provider.
Record provider, image model when exposed, coding model, reasoning, roles,
absolute attached paths, call identity, prompt, and attempt in provenance.
STOP before generation if the pinned route cannot attach every reference.

This skill can be invoked directly or by an orchestrator with the same
contract. Do not read or write `ASSETS.md`, tags, stage state, generated
manifests, stable entries, or worker dispatch state.

The caller owns pre-dispatch planning. Before invoking this skill it must write
`theme_plan.json`, `source_sheet_plan.json`, `stylebox_plan.json`, and
`theme_recipe.json` under
`.godotmaker/asset-generation/work/<asset_id>/`, use them to finish the
canonical request, and then freeze that request. Under `/gm-asset`, the manager
performs this work. The producer consumes all five inputs read-only.

## Produce

1. Read the visual rules stated in `brief` — for a UI kit they cover both the
   image style and the UI visual language — then read the caller-owned
   `.godotmaker/asset-generation/work/<asset_id>/theme_plan.json`. Do not inspect
   the references to derive a replacement plan. The plan records how those
   rules and pre-dispatch reference evidence resolve into this family's
   required tokens for this one request; it is a production artifact, never a reusable
   style source, and it never adds a rule the brief did not state.
   A pre-dispatch finding that a reference contradicts a stated rule is a STOP
   with a blocker naming the reference role, its path, and the rule.
   It contains:

   - a positive `rendering_medium` such as `bold comic-book game art`,
     `hand-painted fantasy illustration`, or `glossy mobile-game illustration`;
   - exactly the color tokens required by `asset_ui_theme_recipe.py`:
     `text`, `text_muted`, `text_outline`, `surface`, `surface_raised`, `input`,
     `primary`, `secondary`, `danger`, `success`, `border`, `focus`,
     `selection`, and `shadow`;
   - exactly the geometry tokens `corner_radius_small`,
     `corner_radius_medium`, `corner_radius_large`, `border_width`,
     `content_margin`, `shadow_size`, `shadow_offset`, and `font_size`;
   - concise observations for palette, contrast, shape, outline, shadow, and
     material language, plus the `brief` rules and the reference roles and
     paths each observation was derived from.

   Write `rendering_medium` and your own added prompt language positively;
   do not author a pixel-art negation of your own. This does not license
   editing the caller's rules: a rule the `brief` states is carried as written
   even when it names pixel art. The Theme plan is a deterministic
   visual-system specification, not generated art.

2. Generate the deterministic source plan before dispatch. The caller owns
   this step with `asset_ui_source_sheet_plan.py`, using its planning request
   rather than the not-yet-created canonical request. During production, read
   its result at
   `.godotmaker/asset-generation/work/<asset_id>/source_sheet_plan.json`; do not
   regenerate or modify it after dispatch.

   Both plan prompts carry the `brief` word for word — every selected design
   rule, `Do` / `Don't` entry, and UI visual-language rule reaches both provider
   calls as written. There is no exception: the plan never drops, rewrites, or
   reweights a carried rule, because a rule the caller selected and the provider
   never sees is a rule that was not applied. Its line structure is kept too,
   so a heading and each bullet stay separate rules instead of reflowing into
   one running sentence.

   Naming pixel art in an image prompt can bias a provider toward it, so every
   carried rule that does so — whatever its phrasing — is recorded under
   `visual_direction.pixel_art_rule_notes` with `disposition: carried_verbatim`.
   Report those notes as a residual risk; do not treat them as permission to
   edit the rule. `rendering_medium` still states the medium positively in the
   same prompt.

   Use the plan prompts unchanged. Make exactly two provider calls, attaching
   every reference to each call:

   - `surface_patches_source.png`: eight 96x96 square runtime patches for button
     normal/hover/pressed/disabled, base/raised panel, and selected/unselected
     tab treatment. Decoration stays inside the declared border band; the
     declared safe center remains continuous and undecorated.
   - `icons_source.png`: 24 unique semantic icons. The plan normalizes Theme
     arrows to 32x32, checks and toggles to 40x40, slider grabbers to 48x48,
     and reusable action/status icons to 128x128. Its mappings expand to all
     stable runtime icon names.

   Both images use only solid `#FF00FF` as background, with separated artwork
   that never touches canvas edges. Save each raw provider image and full
   provenance. Do not accept a screen mockup as either sheet.

   Write
   `.godotmaker/asset-generation/reports/<asset_id>_source_sheet_provenance.json`
   as an array with exactly one final record per sheet, in plan order. Each
   record contains `sheet_id`, final `attempt`, exact `prompt`, `provider`,
   `image_model`, `coding_model`, `reasoning`, `tool_call_id`,
   `attached_references`, and `raw_source_path`.
   Every attached reference entry preserves its request `role` and readable
   request-relative `path`. Keep earlier failed generation attempts under a
   `retries` array on that sheet's final record; never replace or conceal them.

3. Process each real provider image only with controlled tools already owned by
   the project:

   - `asset_image_finalize.py --background magenta --no-origin` creates the
     transparent processing source and report.
   - `asset_sheet_process.py --snap-mode autoslice` receives the plan's ordered
     source component names. Do not pass `--grid`.
   - The detected region count must equal the plan count. On count, separation,
     edge, or transparency failure, preserve evidence and regenerate only that
     provider sheet with the same provider and attachments.
   - Normalize each accepted component with `asset_image_finalize.py --resize`
     to its fixed plan size.
   - Assemble each plan atlas with `asset_atlas_assemble.py`, preserving the
     final physical atlas, metadata, and processing reports.

   Do not programmatically draw, replace, or repair art with Pillow, SVG,
   canvas, ImageMagick, Godot drawing, inline scripts, placeholders, or a new
   pixel tool. Do not pass raw provider rectangles directly to a compiler.

4. Compile the flat-first runtime resources from the caller-owned
   `.godotmaker/asset-generation/work/<asset_id>/stylebox_plan.json`, which the
   caller generated with `asset_ui_stylebox_plan.py`. Do not regenerate or
   modify the plan after dispatch.

   The fixed profiles, not freehand agent guesses, own borders, content
   margins, safe centers, stretch modes, and preview sizes. The plan expands
   eight source patches into 23 stable `StyleBoxTexture` outputs. Base,
   Primary, Secondary, and Danger button families reuse the same state patches
   through deterministic `modulate_color`; popup and tooltip reuse panel
   patches. Compare `stylebox_plan.styleboxes` with `spec.styleboxes` in the
   immutable manager-owned request at
   `.godotmaker/asset-generation/<asset_id>-request.json`; they must match
   exactly. A mismatch is a planning-contract failure, not permission for the
   producer to rewrite the request. Compile every declared entry.

   Compile 31 stable runtime `AtlasTexture` outputs from the icon metadata.
   Multiple names may intentionally share one of the 24 source rectangles.
   Bind only Godot-defined semantic icon slots in `Theme`; keep other utility
   icons as independently reusable named runtime resources.

5. Read the caller-owned complete Theme recipe at
   `.godotmaker/asset-generation/work/<asset_id>/theme_recipe.json`, which the
   caller generated with `asset_ui_theme_recipe.py`, and compile it without
   modifying the recipe.

   The recipe uses native `StyleBoxFlat`/`StyleBoxEmpty` resources for input,
   text, progress, slider, scrollbar, option-button, focus, separator, and
   undrawn control backgrounds. It uses the compiled texture resources only
   for button, panel, tab, popup-panel, and tooltip surfaces. Compile the final
   Theme to
   `res://assets/generated/ui-kit/<asset_id>/<asset_id>_theme.tres`.

6. Before validation, publish byte-identical copies of the four caller-owned
   plans to `assets/generated/ui-kit/<asset_id>/`. Return the generic result
   with separate `source_layout` sources and
   `godot_artifact` runtime outputs, all under
   `res://assets/generated/ui-kit/<asset_id>/`. Sources include theme/source
   plans, recipe, raw provenance, physical atlases, atlas metadata, and
   processing reports. Declare each raw provider sheet as `grid_sheet`, each
   physical final atlas as `region_atlas`, and plans/provenance/reports without
   an invented layout. Use stable report names
   `surface_patches_finalize_report.json`, `icons_finalize_report.json`,
   `surface_patches_process_report.json`, and `icons_process_report.json`.
   Runtime outputs include the Theme, 23
   `StyleBoxTexture` resources, and 31 `AtlasTexture` resources.

   Every runtime output has one required filename, derived from the name it
   serves: the Theme at `<asset_id>_theme.tres`, and every `StyleBoxTexture`
   and `AtlasTexture` at `<output_name>.tres`. One kit fills one directory, so
   this is what keeps each output separately bindable — two resources sharing a
   file would hand a worker the wrong Godot type. `check_ui_card_handoff`
   enforces it at L0, so a drifting filename is a repair, not a late failure.
   The family validator checks each output's declared path. Cross-output path
   uniqueness is enforced when the manager registers the completed result.

7. Read the complete manager-owned request from
   `.godotmaker/asset-generation/<asset_id>-request.json` without changing it,
   and write the candidate result to
   `.godotmaker/asset-generation/<asset_id>-result.json`. Run the public
   validator after resources exist:

   ```powershell
   python tools/asset_ui_card_validate.py --request .godotmaker/asset-generation/<asset_id>-request.json --result .godotmaker/asset-generation/<asset_id>-result.json --project-root . --godot-path <configured-godot-path> --allow-failure
   ```

   It owns L0-L5 facts. L0-L4 check the closed contract, sources and trace,
   native compilation, Godot load, and structural bindings. L5 instantiates
   common controls at compact and expanded sizes. L6 is a separate private
   visual Eval.

Treat a
failed level as repair input:

   - L1: preserve evidence and regenerate only the invalid source sheet.
   - L2: report any plan/request mismatch to the caller; the producer may repair
     compiler support or generated outputs, but it must not repair the immutable
     request or caller-owned plans. Do not regenerate valid art for a Godot
     schema error.
   - L3-L5: repair paths, regions, bindings, or consumer setup and rerun.

Record retries. STOP only for an input-gate failure or a pinned provider that
cannot attach references. Never hand-write L-level values; do not STOP merely because a production validation attempt failed.

Resolve Godot from `.claude/godotmaker.yaml`'s `godot_path`; when it is absent,
use `godot` on `PATH`. Do not substitute another installation.
If required validation cannot run, return a failed result rather than claiming
readiness.

## Return format

Finish with exactly one generic Asset Skill result JSON object. A successful
result is validator-owned. A genuine input-gate STOP has the same generic keys,
no outputs, and `validation.passed: false` with a concrete note. Do not replace
the object with prose or Markdown.

The worker owns final page layout. The returned Theme, StyleBoxes, and
AtlasTextures are reusable visual-system resources; a reference establishes
visual language, not pixel-perfect screen layout.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall