Mockup builder

From raddue/crucible · View interactive version

Mockup builder is an AI agent skill from the GitHub repository raddue/crucible. Use when creating a visual mockup, UI prototype, or HTML reference for your project's UI. Triggers on "mockup", "prototype", "UI reference", "design a panel", "mock up", or any task producing a visual HTML file for later Unity UI Toolkit implementation.

How to use this skill

Skill file

Mockup Builder

Create HTML mockups for your project's UI that are constrained to Theme.uss variables and designed for direct translation to Unity UI Toolkit.

Skill type: Rigid — follow exactly.

Before Starting

  1. Read references/theme-variables.md for the Theme.uss variable catalog. Freshness check: verify the Last synced date is current. If the project's Theme.uss has been modified since that date, regenerate theme-variables.md from Theme.uss's :root block only (see the Freshness Check instructions in theme-variables.md).
  2. Read skills/shared/uss-approximation-patterns.md to understand what CSS effects are achievable in USS and how to approximate those that aren't.
  3. Read skills/mock-to-unity/references/css-to-uss-mapping.md, specifically the "CSS Properties Not Available in USS" section, for the hard-block list of features that MUST NOT be used in mockups.
  4. Read existing mockups in docs/mockups/ for visual language reference — but note that mockups created before this skill may use hardcoded hex values and lack CSS variables. Use them only to understand the project's visual language (colors, proportions, layout patterns), NOT as CSS architecture exemplars.

Constraints

These are non-negotiable. Every mockup must satisfy all of them.

Theming:

Layout:

USS Feasibility:

Naming:

Output:

Mockup Structure

Every mockup follows this structure:

1. :root block
   - All CSS variables from Theme.uss used by this mockup
   - Any new variables with explanatory comments

2. Component CSS
   - Uses only var() references, never raw values
   - Flexbox layout only
   - BEM class names

3. HTML structure
   - Class names match USS selector intent
   - Hierarchy maps to VisualElement tree
   - Data-attributes for state variants (data-state="maxed", etc.)

4. Translation Notes (visible footer section)
   - CSS features that need C# equivalents (hover → PointerEnterEvent)
   - Properties known to fail in USS (height in ScrollView)
   - Any new Theme.uss variables this mockup introduces

Translation Notes Section

At the bottom of every mockup, include a visible <section class="translation-notes"> covering:

What This Skill Does NOT Do

After Creating the Mockup

  1. If a browser is available, open the mockup to verify rendering. Otherwise, review the HTML/CSS source for structural correctness and consistency with the project's visual language.
  2. Review the Translation Notes section for completeness
  3. Commit the mockup file to git

Quality Gate

This skill produces mockups. When used standalone, invoke crucible:quality-gate after the mockup is created and committed. When used as a sub-skill of build, the parent orchestrator handles gating.

The quality gate reviewer MUST check:

  1. USS Feasibility — no hard-blocked CSS features used (reference css-to-uss-mapping.md "CSS Properties Not Available in USS")
  2. Translation Notes — every allowed-with-notes feature has a documented USS approximation pattern from skills/shared/uss-approximation-patterns.md
  3. :root Value Match — all :root variable values match references/theme-variables.md (after freshness check)
  4. Theming Compliance — all values use var() references, no hardcoded hex/rgb values
  5. Layout Compliance — flexbox only, BEM naming, HTML hierarchy maps 1:1 to VisualElement tree

Items 1-3 are blocking — they guarantee downstream translation failure if not fixed before proceeding to mock-to-unity.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.