AIUP/ui concept — framework extension

Spec-driven UI

Before there's UI code, there's a clickable mockup

AIUP already drives development from vision.md to working code, but the pipeline has no step for UI/UX — /implement generates views with business logic already wired in. We propose a separate, parallel track: from use case to an approved, fully-looking, clickable prototype — before anyone writes a single line of real screen code.

Doesn't touch the existing pipeline

This track runs alongside entity modeling, other use cases, and migrations — none of them need to be finished first. It has one prerequisite: the target use case's own spec (UC-XXX.md, from core AIUP's /use-case-spec) already has to exist. It meets the AIUP core again at exactly one point: /implement starts working on UI that's already scaffolded, instead of generating it from scratch.

How it works

Six steps, one use case per session

The diagram shows the flow — from the spec interview, through human approval of the mockup, to real code. The labels under each arrow show exactly what gets handed off at each step.

Steps 1–3 need only use_cases.puml (core AIUP /use-case-diagram); step 4 needs that specific UC's own spec (/use-case-spec) ↓

1
/ui-interview
PM + UX Designer-style interview: style, controls, target technology
Human + AI
→ style.md
2
/ui-theme
Brand book: defined manually, from a PDF, or from a client's URL
AI
→ tokens.css
3
/ui-navigation
Sitemap: each actor's use cases clustered into menu sections
Human + AI
→ navigation.md
4
/ui-mockup UC-###
Clickable HTML/CSS/JS prototype, independent of the target stack
AI
→ .html
5
approval
Human-in-the-loop: review the mockup, decide or request changes
Human
✓ approved
6
/ui-implement
Real UI code in the chosen technology → then /implement wires the business logic
AI
step 4 /ui-mockup doesn't stop at one working screen. For every Alternative Flow already written into the UC spec — no results, a failed action, a slow response — it generates the matching variant: an empty state, an error state, a loading state. These scenarios aren't new work; they're already described in the use case, just not mocked yet.
step 5 Approval isn't only a stakeholder sign-off. For use cases where the flow is unfamiliar or the stakes are high, this step can include a short think-aloud session — watch one real user try to complete the task on the clickable mockup — before treating it as approved.
step 6 The mockup's HTML is a visual reference, not production code — it doesn't yet tell a screen reader what each element is or what's happening on the page, and it has no real state management. /ui-implement adds both explicitly; it doesn't just carry the mockup's markup over as-is.

Step 1, in practice

What the interview actually looks like

Illustrative only — the exact question script for /ui-interview isn't written yet (see open questions below). This is the interaction pattern we're aiming for: one question at a time, multiple-choice where possible, freeform where it isn't.

hrs — claude

$ /ui-interview

AIUPLet's define the visual style. How should the interface feel?

1 · Clean, minimal, lots of whitespace

2 · Dense, corporate, data-heavy

3 · Playful, friendly, rounded shapes

4 · Something else — describe it

You1

AIUPClean and minimal, got it. For lists of records — reservations, guests — tables or cards?

YouTables — staff need to scan many rows fast.

AIUPDo you have any reference screenshots, links, or a folder of inspiration I should look at?

YouYeah — ./inspiration/ has three screenshots I like.

AIUPGot it, reviewed all three — using them alongside your answers.

AIUPOne more: which stack should the real implementation target?

1 · React + Tailwind

2 · React + shadcn/ui

3 · Vue + Vuetify

4 · Vaadin (Java)

5 · Other — describe it

You4

→ writing docs/ui/style.md ... done

Illustrative transcript — exact question script not yet defined

Mechanism

Screens are generated one at a time, but stay connected

A mockup is generated one use case at a time — following AIUP's "one UC per session" principle. So it doesn't end up feeling like a pile of disconnected documents, every screen gets two layers of navigation.

Layer 1 + 2 — shared navigation shell and flow-accurate links

On the left: a navigation panel present on every mockup, organized into the menu sections defined by /ui-navigation's sitemap (falls back to a flat per-actor list if that step hasn't run yet). On the right: a specific action button wired to the actual target screen, taken from the "Navigation" table in the UC spec — not just to the generic menu.

localhost — mockups/UC-001/index.html
Search rooms Check in guest Room status (coming soon)

Room search

Guest picks dates and party size, browses available rooms.

Reserve

Scope

Choosing what to generate

Steps 4 and 6 accept a scope, so one command can target a single use case, several, or the whole sitemap — instead of one command per UC.

/ui-mockup UC-002One use case — the default.
/ui-mockup UC-002 UC-003 UC-005Several named use cases, processed one at a time.
/ui-mockup --allEvery use case in the sitemap.
/ui-mockup UC-002 --screen errorJust one state variant of one use case, when only that screen needs redoing.

--all means something different for each command

For /ui-mockup, --all covers every use case in the sitemap — mockups are cheap to iterate and still need approval before anything real gets built. For /ui-implement, --all only covers use cases whose mockup has already passed the approval gate — batching implementation can never skip it.

This is a deliberate opt-in, not the default habit: AIUP's own guidance is one use case per session, specifically to keep token and context cost under control. Wider scopes trade that discipline for convenience.

Input

Brand book from three different sources

Regardless of where the visual theme comes from, the result always lands in the same format — a tokens.json file in the W3C Design Tokens (DTCG) standard — so the downstream steps never need to know its origin.

manual
Interactive interview defining colors, typography and brand tone from scratch.
--from-pdf
An existing client Brand Book document — colors, typography, logo, tone.
--from-url
The client's existing website as a reference — dominant colors and fonts.
docs/ui/themes/<name>.md + tokens.json (W3C DTCG) + tokens.css

Scaling

The component library grows with the project

Instead of building a generic component set up front, we start empty — each new use case adds only what it actually needs, and reuses what already exists. New entries are tiered as atoms → molecules → organisms (atomic design vocabulary) so the library doesn't rot into near-duplicates as it grows.

UC-001
+ table + button + filter form
UC-002
table button + 3-step wizard
UC-003
button 3-step wizard + status card

Open questions — to be settled during implementation planning

  • Exact question script for /ui-interview — not yet scripted step by step.
  • Mechanism for marking which theme is currently "active".
  • Output location convention for /ui-implement — differs for Vaadin vs. a JS SPA.
  • /ui-navigation's first-pass clustering heuristic (grouping by shared noun in UC titles) is untested — may need refinement once tried on a real set of use cases.
  • A consolidated, single-pass prototype for the whole product — a possible future extension, out of scope for v1.