Hi everyone,
I’ve been working on a skill for Claude Code / Antigravity or Cursor etc which can generate entire SquareLine Studio project files (.spj) — from the AI console where you just describe the UI you want to sketch out.
I’ve tried to keep it simple, instead of manually configuring every widget’s properties, layout, and event bindings, you describe the interface you need and the tool constructs the correct LVGL widget hierarchy with all the right property values, style nodes, and event templates to open in SLS and then refine. The output is a standard SLS project folder that you open in the desktop IDE to refine and export C or MicroPython code.
What it generates
The tool understands the LVGL widget model and generates correct SLS property trees for 20+ widget types:
- Container widgets: Panel/Container, Screen, TabView, TabPage, Tile, TileView
- Display widgets: Label, Arc, Bar, Spinner, Image, LED, Line, Chart
- Input widgets: Slider, Dropdown, Roller, Switch, Checkbox, Spinbox, Colorwheel (v8)
- Interactive widgets: Button, Textarea, Keyboard, Calendar, List
Each widget includes its required Style_* part nodes (Main, Scrollbar, Indicator, Knob, etc.), correct nid tracking, and unique GUIDs. Missing style nodes cause NullReferenceException in SLS — the builder handles this automatically.
Layout support
Flex and Grid layouts are fully supported:
LayoutType: 1(FLEX) with flow direction, wrap, main/cross/track alignmentLayoutType: 2(GRID) with column/row definitions- Per-widget sizing flags (
flags: 17for fixed,flags: 51for content-fit)
One of the non-obvious format details: the OBJECT/Layout_type strval is always "No_layout" even when FLEX is active — the actual layout type lives in the numeric LayoutType field. The tool handles these quirks so the generated output is identical to what SLS would produce.
LVGL v8 and v9
Both major versions are supported:
- v8.3.x — including COLORWHEEL (removed in v9)
- v9.x — 9.1, 9.2, 9.3, 9.5
- CONTAINER is the v9 name for PANEL (both work in SLS)
- Board-specific LVGL version is indexed from
.slbboard packs
The tool indexes board definitions directly from the user’s local SLS installation to match the correct supported_lvgl_version, so the generated code export always targets the right LVGL API.
Events and navigation
Screen transitions, button callbacks, and value-changed handlers are generated with the correct dual-template format that SLS uses:
Call— MicroPython template with<{Screen_to}>placeholdersCallC— C template with matching placeholders
This ensures the exported code works correctly in both C and MicroPython output modes.
How it works
It’s a “skill” (structured instruction set) for AI coding agents — works with Claude Code, Google Antigravity, Cursor, or any AI coding harness that supports skills. The skill includes:
- 54K format specification documenting the
.spjJSON schema - Per-widget property catalogues
- A Python widget builder API (handles GUID generation, nid tracking, style part nodes)
- A project validator (GUID uniqueness, nidcnt consistency, structural checks)
- Board search script that indexes installed
.slbfiles in-place
Hardware
Works with any SLS-supported board — CrowPanel, MaTouch, M5Stack Dial/Core2/Tab5, Arduino TFT_eSPI, ESP32-S3 dev kits, NXP i.MX, and the SDL desktop simulator.
Issues / Feedback
The skill knows how to raise issues on the skill repo so just tell the skill what you think the problem is and your agent should be able to file the issue directly for me to take a look at.
Links
I’d love to get any feedback from anyone who’s worked AI coding tools and Squareline studio to generate LVGL widget trees. The format has some interesting quirks (gradient colours use [R, G, B] with no alpha while backgrounds use [R, G, B, A], TABPAGE uses its own property prefix instead of OBJECT/, etc.) and I’m sure there are edge cases I haven’t hit yet.
Anyone else doing programmatic LVGL UI generation? I’ve seen discussions about feeding wireframes to Claude/ChatGPT for initial code generation, and I’ve been using this skill alongside the new Claude Design tools. This takes it a step further by generating the structured SLS project file rather than just the raw C code.
Matt