t1k:unity:ui:describe-image
| Field | Value |
|---|---|
| Module | ui |
| Version | 3.43.4 |
| Effort | low |
| Tools | — |
Keywords: anchor pivot, anchored position, describe ui, detail table, FullScreenLayout, image to ui, isolate elements, layout breakdown, mockup, popup layout, rect transform, screen layout, ui plan, ui screenshot, vertical layout group
How to invoke
Section titled “How to invoke”/t1k:unity:ui:describe-image[image-path] (or paste/attach the screenshot)Describe UI Image → Hierarchy + Detail Table
Section titled “Describe UI Image → Hierarchy + Detail Table”Convert a UI mockup/screenshot into a structured, Unity-authorable spec. Produces two artifacts: an isolated GameObject hierarchy and a RectTransform detail table. This is a planning step — no prefab is created here. The output is the input to t1k:unity:ui:create-prefab (generic) or t1k:unity:tof:ui-create-prefab (TheOneFeature-scoped).
Execution — run through t1k-unity-base-ui-developer
Section titled “Execution — run through t1k-unity-base-ui-developer”Do not analyse the image or draft the spec in the calling session. Spawn t1k-unity-base-ui-developer natively (never routed: routable: false) with a brief carrying: the image path (a path, never pasted content), the reference resolution if the user stated one, and the target scope (generic vs TOF). It owns the hierarchy and anchoring decisions and fans out as its own delegation table says: t1k-unity-base-visual-director reads the image, t1k-investigator / t1k-corpus-scout / t1k-asset-scout find existing widgets and sprites to reuse. It holds no write tool and returns both artifacts as text; it creates nothing.
Present its Hierarchy, Detail Table and notes verbatim. If Agent is unavailable (leaf sub-agent, MR_SPAWNED=1), follow Steps 0 and Outputs 1–2 below inline and say so.
When This Skill Triggers
Section titled “When This Skill Triggers”User provides a UI screenshot/mockup and asks to “describe the popup/screen”, break it into a hierarchy, or plan its layout (anchors, pivots, positions, sizes) before building the prefab.
Step 0 — Analyze the Image
Section titled “Step 0 — Analyze the Image”Image analysis uses the router’s vision role command (bun <claudeDir>/scripts/mr-role.cjs call --role vision --file <path> --prompt "...") when the agent has Bash, else the native Read tool. See rules/image-analysis-routing.md. Read carefully: every distinct icon, label, button, background, badge, and the overlap relationships between them.
Output 1 — Hierarchy
Section titled “Output 1 — Hierarchy”A tree of every GameObject. The root is always FullScreenLayout. Annotate each node with a one-line role.
Isolation rule (the core discipline)
Section titled “Isolation rule (the core discipline)”Isolate aggressively — one responsibility per GameObject:
- A background is its own element, separate from the content it sits behind. A reward pill =
RewardBackground(the gray rounded sprite) + the text/icons as siblings inside the group. A button =XxxButtonBackground+XxxButtonLabel. An arrow button =ArrowButtonBackground+ArrowIcon. - Every labelled row is its own group (e.g.
DifficultyGroup,RewardGroup,KeyGroup,ButtonGroup) so it can be driven by a layout group independently. - Icon + its value are separate elements (
HammerIcon+HammerValueText), never one combined sprite-text — when the icon and value are laid out as discrete, independently-positioned siblings (e.g. an icon swatch with a number beside it in a row/group). - Icon inline within a text flow → use a TMP
<sprite>tag, not separate elements. When an icon sits inline with running text (e.g.Collect 50 [gem-icon] to continue, or[coin-icon] x100reading as one phrase), do NOT split it intoText+Image+Text. Author it as a single TextMeshProUGUI using rich-text<sprite name="IconName">(TMP sprite asset). Represent it in the hierarchy as one node (e.g.RewardTextwith note:inline <sprite name="Gem">), not three. This keeps the text reflowing correctly around the icon and avoids manual re-spacing of a floating image between two TMPs. - Title overlaid on artwork lives inside the artwork group (it is positioned relative to the banner).
Overlap / parenting rule
Section titled “Overlap / parenting rule”An element that visually straddles the edge of a panel (e.g. a close button half-outside the card) must be a sibling of the panel, not a child — a child would be clipped by the panel’s rect/mask. State this in a “grouping rationale” note.
After the tree
Section titled “After the tree”Add a short Grouping rationale list explaining the non-obvious parenting choices (siblings vs children, why each group exists, which backgrounds were isolated).
Output 2 — Detail Table
Section titled “Output 2 — Detail Table”One row per element including every parent group (not just leaves). Columns:
| Column | Meaning |
|---|---|
| Element | Name matching the hierarchy |
| Anchor (min→max) | Stretch (0,0→1,1), or a point like Top-center (0.5,1). Stretch the things that should track parent width/height. |
| Pivot | (x,y) — use compass shorthand (T,B,L,R,C, e.g. ML (0,0.5)) |
| Anchored Pos (x, y) | Position relative to its own parent |
| Size (W × H) | width × height (omit for stretched dimensions) |
| Notes | sprite color, text style, raycast, behavior |
Reference resolution: default to 1080 × 1920 (portrait mobile) unless the user states otherwise; say which you used. All numbers are approximate — label them as estimates.
After the table
Section titled “After the table”Add Anchoring strategy notes: which elements stretch to track parent, which are anchored to top/bottom so stacked groups never overlap, and which groups are candidates for a VerticalLayoutGroup / HorizontalLayoutGroup.
Worked shape (abbreviated)
Section titled “Worked shape (abbreviated)”FullScreenLayout└── PopupPanel (white rounded card, center) ├── BannerGroup (rounded-top header) │ ├── BannerImage │ └── TitleText └── ContentGroup (vertical stack) ├── RewardGroup │ ├── RewardBackground ← isolated bg │ ├── RewardLabel │ ├── HammerIcon │ └── HammerValueText └── ButtonGroup (HorizontalLayoutGroup) ├── EnterButton/EnterButtonBackground + EnterButtonLabel└── CloseButton (SIBLING of PopupPanel — overlaps its bottom edge) ├── CloseButtonBackground └── CloseIconHandoff
Section titled “Handoff”When the user is ready to build, point them at:
t1k:unity:ui:create-prefab— generic UI prefab (variant ofUIBaseScreen/UIBasePopup).t1k:unity:tof:ui-create-prefab— if the target lives underPackages/TheOneFeature*orAssets/Prefabs/UIs/.
Hard rules
Section titled “Hard rules”- Don’t merge a background into its content — the isolation rule is what makes the spec authorable as separate sprites/text.
- Inline icon ≠ sibling icon. If an icon flows inside a sentence/phrase with text wrapping around it, collapse it into a single TMP via
<sprite name="IconName">— don’t emitText+Image+Text. Only isolate icon and value as separate elements when they’re discrete, independently-anchored siblings in a row/group. When unsure, ask whether the text reflows around the icon (→ inline<sprite>) or the icon is a fixed standalone swatch (→ separateImage). - Don’t parent an overlapping element to the panel it spills out of — it gets clipped.
- Always include parent groups as table rows; their RectTransform sizing drives the children.
- State the reference resolution and that the numbers are estimates, so the builder treats them as a starting point, not gospel.
Visual change notice
Section titled “Visual change notice”A visible change made with this skill (UI, sprites, 3D, shaders, VFX, animation, lighting, scene layout; audio excluded) follows core rule visual-change-discord-notice:
- Capture OLD before the first edit and NEW after the last (screen:
ScreenCapturein Play mode pert1k-unity-editor-cli, windowed or Xvfb only because rendering is needed; 3D, shader, VFX: same-scene frame grab; 2D asset: the file). - Return the paths and a draft Discord post to the orchestrator, which posts; the PR links the post or carries
visual-notice-waiver: <reason>. Logic only: “no visible change”. No capture: “screenshots pending:”, never a fake image.