Four agent skills for building UIs with CUI — one visual language across C, WebAssembly, Python and plain CSS, written from real build and test sessions (Windows and Linux), not from reading docs alone.
- ~210 native components in C99, zero dependencies, ~250 KB apps — see
cui-app - The same C app in the browser with plain clang +
wasm32, no Emscripten — seecui-web - Desktop apps in Python via nexa, the CUI port — see
cui-py - The CUI look in HTML/CSS for sites and web UIs without any C — see
cui-style
- The four skills
- How the layers fit together
- Requirements per skill
- Setup
- Recorded clone paths (
paths.json) - Installing the skills into an agent
- RTL / Persian support
- Repository layout
The main skill. CUI is an immediate-mode UI library for native apps, written in C99, built with CMake, zero external dependencies.
Contains:
- The mental model (immediate mode, tokens, springs, hit rects)
- Full component map of all ~210 components by category (
api.md) - Copyable UI patterns: app skeleton, sidebar, list+detail, forms, tables, threads, RTL (
patterns.md) - Working CMake template:
template/CMakeLists.txt+template/main.c - The Windows/MSVC build recipe and the pitfalls actually hit (
C2099on compound literals, multi-config generators) - Icons (Lucide), theming, fonts, screenshots, headless testing
When to use: "build me a desktop tool/app in C", "add a component to my CUI app", questions about CUI itself.
The web layer only: the same C codebase compiled to WebAssembly with plain clang and drawn with WebGL2.
Contains:
- The contract your app must satisfy (
int main(void)+cui_app_run, no manual loop) - Build & run:
web/tools/build.sh app my_app.c+serve.sh→http://localhost:8765/#/app/my_app - Browser constraints verified in the source, not guessed:
fopenalways returnsNULL,cui_app_file_dialog/cui_app_open_urlare no-ops - Hosting:
web/site/is plain static files — any static host works - Toolchain notes (clang
wasm32+wasm-ld+llvm-ar+ python3; Windows gotchas)
When to use: "run my C/C++ app in the browser", "build it as WASM".
nexa (pip install nexa-ui) is the Python port of CUI: same components, same tokens, zero Python dependencies.
Contains:
- Install and the value-returning immediate-mode mental model
- The two scope kinds (unconditional vs. conditional — the #1 beginner bug) and ID rules
- Theming from Python:
Accent,Tone,Token,ThemeMode - OOP layer with a working example:
Application,Component,Router/View,Store[T] - RTL/Persian shaping (on by default), headless screenshot testing
- Docs map: which file in
docs/answers which question - Windows build troubleshooting
When to use: "make me a Python GUI", "port this CUI app to Python", anything with nexa.
The theme layer as CSS: the same tokens cui-app uses, implemented with CSS variables — for sites and UIs with no C or WASM.
Contains:
- Dark + light token sets, Geist typography, pill controls, 1px-bordered surfaces, word-blur motion
- Lucide mechanics (re-running
createIcons(), pinned CDN, self-hosting) - Persian/RTL section: tested font URLs,
@font-face, logical properties, always-RTL rules, Latin digits - React/Tailwind recipes, a restyle workflow for existing projects
- Scaffolder script (
cui.py), startertokens.css/components.css,example.html
When to use: "style this site like CUI", "make a landing page in this look" — no build step involved.
| You want | Skill |
|---|---|
| A desktop window (Windows/macOS/Linux) in C/C++ | cui-app |
| The same C app running in the browser (WASM) | cui-web |
| A desktop app in Python | cui-py |
| A plain HTML/CSS site or UI in the CUI look | cui-style |
One codebase can ship both ways: a cui_app_run app builds natively with CMake and as WASM with build.sh app. All four skills share one token system — cui-app is the reference for components and theming; the others cover their own layer and point back to it.
| Skill | Needs installed | Needs cloned |
|---|---|---|
cui-app |
git, CMake 3.14+, a C compiler (Visual Studio Build Tools / gcc / clang) | CUI |
cui-web |
git, clang with wasm32 target (LLVM), Git Bash, python3 |
CUI |
cui-py |
Python 3.9+ (pip install nexa-ui); a C compiler only when building from source |
nexa (development only) |
cui-style |
nothing — a browser | no |
Two ways:
- Slash command — copy
commands/cui-setup.mdinto your agent's command directory (OpenCode:~/.config/opencode/command/), then run/cui-setup. - Ask your agent directly — say "set up the CUI skills"; the flow below is written for agents to follow.
- Ask which skill branch the user wants (multiple is fine):
cui-app(native C),cui-web(WASM),cui-py(Python),cui-style(CSS only). - Check what already exists before installing anything:
git --version,cmake --version,clang --version(forcui-web, alsoclang --print-targetsand look forwasm32),python --version. - Install only the missing tools for the chosen branches:
- Debian/Ubuntu:
sudo apt install git cmake clang lld llvm python3 - Windows: git, CMake, LLVM, Python from official installers; Visual Studio Build Tools for
cui-app cui-stylealone needs nothing
- Debian/Ubuntu:
- Clone the projects into a location the user approves (suggest
~/Git/CUIand~/Git/nexa):Forgit clone https://github.com/yappologistic/CUI.git # cui-app, cui-web git clone https://github.com/x017/nexa.git # cui-py development only
cui-pyalone,pip install nexa-uiis enough — no clone needed. - Record the paths in
paths.json(see below). - Install the skills into the agent's skills directory if not already there.
- Verify one cheap check per branch — configure the template (
cui-app),clang --print-targets | grep wasm32(cui-web),python -c "import nexa"(cui-py);cui-styleneeds nothing.
Finish with a table: branch → tools found/installed → clone path → verified or not.
Each skill points at a local clone of the upstream project as its source of truth. Instead of hardcoding paths (which differ on every machine), setup writes them here:
{
"cui_clone": "/home/you/Git/CUI",
"nexa_clone": null
}paths.json is gitignored — it holds machine-local paths. A fresh checkout ships with nulls; the setup flow fills them in, and the skills stay portable untouched.
Copy (or symlink) the four skill folders into your agent's skills directory:
| Agent | Destination |
|---|---|
| OpenCode | ~/.config/opencode/skills/ |
| Claude Code | ~/.claude/skills/ |
| Codex / others | any directory your agent reads skills from |
The files are plain Markdown — any agent that can follow instructions can use them even outside these formats.
Covered at every layer, because CUI ships real BiDi + OpenType shaping:
cui-app:CUI_DIRECTION_RTL/AUTO,CUI_TEXT_SHAPINGbuild option, font-fallback recipecui-py: shaping is on by default (fonts.supports_text_shaping()),direction=on containers,ctx.use_rtl_font(), localized calendarscui-style: tested webfont URLs,@font-face, logical properties, always-RTL rules, Latin digits in Persian prose
cui-skills/
├── README.md ← you are here
├── paths.json ← written by setup (gitignored)
├── commands/
│ └── cui-setup.md ← /cui-setup slash command
├── cui-app/
│ ├── SKILL.md ← the main guide
│ ├── api.md ← ~210 components by category
│ ├── patterns.md ← copyable UI shapes
│ └── template/ ← CMakeLists.txt + main.c starter
├── cui-web/
│ └── SKILL.md ← build, browser constraints, hosting
├── cui-py/
│ └── SKILL.md ← nexa: install, model, theming, RTL, docs map
└── cui-style/
├── SKILL.md ← tokens, Lucide, RTL, restyle workflow
├── tokens.css ← the design tokens
├── components.css ← ready-made components
├── react-tailwind.md
├── cui.py ← scaffolder
├── example.html ← full styled demo page
└── fonts/ ← Geist + OFL license
Upstream: CUI · docs: https://yappologistic.github.io/CUI/ · Python port: nexa