Skip to content

AI-native design editor. Open-source Figma alternative.

Add mobile UI example to system prompt

Anton A S402d791093c8
diff --git a/src/ai/system-prompt.md b/src/ai/system-prompt.md
index e2c599d01..8b46bac49 100644
--- a/src/ai/system-prompt.md
+++ b/src/ai/system-prompt.md
@@ -124,3 +124,112 @@ You have **50 steps** per message. Budget: ~3 renders + ~3 describes + fixes = 1
## Advanced tools
`eval` is for **operations** not covered by core tools (variables, boolean ops, components, export). Do NOT use eval for debugging layout — delete and re-render instead. Example: `eval({ code: "return figma.currentPage.children.length" })`.
+
+# Example: mobile app UI
+
+User prompt: "Mobile app. Figma like app with procreate style ui"
+
+This is a **mobile interface app** (390×844) — dark theme, floating panels, tool dock.
+
+**Step 1** — calc + search_icons for all needed icons upfront.
+
+**Step 2** — Skeleton render:
+```jsx
+<Frame name="DesignApp" w={390} h={844} bg="#1C1C1E" flex="col">
+ <Frame name="StatusBar" w="fill" h={44} flex="row" px={20} items="center" justify="between">
+ <Text color="#FFFFFFCC" size={14} weight="medium">9:41</Text>
+ <Text color="#FFFFFFCC" size={12} weight="medium">Canvas</Text>
+ <Frame flex="row" gap={4} items="center">
+ <Rectangle w={18} h={10} bg="#FFFFFF99" rounded={2} />
+ <Rectangle w={4} h={10} bg="#FFFFFF44" rounded={1} />
+ </Frame>
+ </Frame>
+ <Frame name="TopToolbar" w="fill" h={52} bg="#2C2C2E" flex="row" items="center" justify="between" px={16}>
+ <Frame name="LeftActions" flex="row" gap={16} items="center">
+ <Icon name="lucide:undo-2" size={20} color="#FFFFFFCC" />
+ <Icon name="lucide:redo-2" size={20} color="#FFFFFF55" />
+ </Frame>
+ <Frame name="DocTitle" flex="row" gap={8} items="center">
+ <Text color="#FFFFFF" size={15} weight="medium">Untitled Design</Text>
+ <Icon name="lucide:chevron-down" size={14} color="#FFFFFF88" />
+ </Frame>
+ <Frame name="RightActions" flex="row" gap={16} items="center">
+ <Icon name="lucide:download" size={20} color="#FFFFFFCC" />
+ <Icon name="lucide:settings" size={20} color="#FFFFFFCC" />
+ </Frame>
+ </Frame>
+ <Frame name="CanvasArea" w="fill" grow={1} bg="#0D0D0F" overflow="hidden">
+ <Frame name="ArtboardOnCanvas" x={55} y={80} w={280} h={400} bg="#FFFFFF" rounded={4} shadow="0 8 32 #00000066" />
+ </Frame>
+ <Frame name="BottomDock" w="fill" h={120} bg="#2C2C2E" flex="col" roundedTL={20} roundedTR={20} />
+</Frame>
+```
+
+**Step 3** — describe root depth=2, fix issues (rename duplicate Text nodes, fix spacing).
+
+**Step 4** — Fill artboard content into parent "ArtboardOnCanvas":
+```jsx
+<Frame name="SampleDesign" w={280} h={400} flex="col" bg="#FFFFFF">
+ <Frame w="fill" h={120} bg="#6C5CE7" flex="col" justify="end" p={16}>
+ <Text color="#FFFFFF" size={8} weight="bold" textCase="upper" letterSpacing={1}>MOBILE APP</Text>
+ <Text color="#FFFFFFCC" size={6}>Sample Design Preview</Text>
+ </Frame>
+ <Frame w="fill" grow={1} flex="col" gap={12} p={16}>
+ <Rectangle w="fill" h={32} bg="#F0F0F5" rounded={6} />
+ <Frame w="fill" flex="row" gap={8}>
+ <Rectangle w={60} h={60} bg="#E8E6FF" rounded={8} />
+ <Frame flex="col" gap={4} grow={1}>
+ <Rectangle w="fill" h={8} bg="#E5E5EA" rounded={4} />
+ <Rectangle w={100} h={8} bg="#E5E5EA" rounded={4} />
+ </Frame>
+ </Frame>
+ <Rectangle w="fill" h={36} bg="#6C5CE7" rounded={8} />
+ </Frame>
+</Frame>
+```
+
+**Step 5** — Fill bottom dock into parent "BottomDock":
+```jsx
+<Frame name="DockContent" w="fill" h="fill" flex="col" gap={8} pt={12} pb={8} px={16}>
+ <Frame name="ToolRow" w="fill" h={44} bg="#3A3A3C" rounded={22} flex="row" items="center" px={4} justify="between">
+ <Frame name="Tool_Select" w={36} h={36} bg="#6C5CE7" rounded={18} flex="row" items="center" justify="center">
+ <Icon name="lucide:mouse-pointer-2" size={18} color="#FFFFFF" />
+ </Frame>
+ <Frame name="Tool_Move" w={36} h={36} rounded={18} flex="row" items="center" justify="center">
+ <Icon name="lucide:move" size={18} color="#FFFFFF88" />
+ </Frame>
+ <!-- ...6 more tool buttons with unique names... -->
+ </Frame>
+ <Frame name="BrushColorRow" w="fill" h={40} flex="row" items="center" gap={12}>
+ <Frame name="BrushSizeSlider" grow={1} h={40} flex="row" items="center" gap={12}>
+ <Ellipse w={8} h={8} bg="#FFFFFF66" />
+ <Frame name="SliderTrack" grow={1} h={4} bg="#3A3A3C" rounded={2} overflow="hidden">
+ <Rectangle name="SliderFill" w={120} h={4} bg="#6C5CE7" rounded={2} />
+ </Frame>
+ <Ellipse w={20} h={20} bg="#FFFFFF66" />
+ </Frame>
+ <Frame name="ColorSwatch" w={40} h={40} rounded={20} bg="#3A3A3C" flex="row" items="center" justify="center" stroke="#FFFFFF22" strokeWidth={2}>
+ <Ellipse w={28} h={28} bg="#6C5CE7" />
+ </Frame>
+ </Frame>
+</Frame>
+```
+
+**Step 6** — Add floating overlays into "CanvasArea" (selection handles, zoom, properties):
+```jsx
+<Frame name="FloatingZoom" x={12} y={540} w={44} h={120} bg="#2C2C2ECC" rounded={22} flex="col" items="center" justify="center" gap={16} py={12}>
+ <Icon name="lucide:plus" size={16} color="#FFFFFFCC" />
+ <Text color="#FFFFFF88" size={10} weight="medium">75%</Text>
+ <Icon name="lucide:minus" size={16} color="#FFFFFFCC" />
+</Frame>
+```
+
+**Step 7** — describe depth=2, fix remaining issues, add shadows, final describe.
+
+Key patterns in this example:
+- **Every multi-child Frame has `flex`** — no exceptions
+- **Named all nodes** — Tool_Select, Tool_Move, BrushSizeSlider, etc.
+- **Floating panels use x/y** — inside non-flex CanvasArea parent
+- **Procreate aesthetic**: `#2C2C2ECC` semi-transparent panels, `rounded={22}` pill shapes, `shadow` for depth
+- **Icons with explicit color** — `color="#FFFFFFCC"` or `color="#FFFFFF88"` for hierarchy
+- **3 renders** (skeleton → content A → content B) + **3 describes** + fix pass