{"version":"v1.0","client_state":{"DocsNavigation.default":{"fields":{"query":""},"persist":"memory","send_to_server":true},"ColorScheme.default":{"fields":{"mode":"system"},"persist":"local","send_to_server":true}},"endpoints":{"action":"/_bretzel/action","sse":"/_bretzel/sse","refetch":"/_bretzel/refetch"},"csrf":"2fbfbbbc03434d0d3c7e486bffa1fa54","page_id":"5f8c16a627904be6a2f3d4da1f069523","address":""}
WorkflowMockup first

Start with a mockup

Before any real logic exists, you see the screen. A Bretzel mockup is a throwaway page on invented data, made of the very components, theme and layout the finished screen will ship. What you approve is what you get: nothing is redrawn when it is wired.

Elsewhere

A mockup is a picture. Someone redraws it in code, the spacing drifts, a state nobody drew shows up, and the screen you approved is not the one you get.

In Bretzel

The mockup is the screen's code, on invented data. Validating it decides the layout, the words and the components; wiring only replaces the data.

Four steps, one screen at a time

1You

Describe

Who opens the screen, what it shows, what can be done from it. In your words, not in a spec.
2Your agent

Mock it

It writes the mockup on plausible data — a long label, an empty case — and screenshots it in a real browser, light and dark.
3You

Validate

Cards or a table? A missing column? A round or two on screenshots, before a line of real logic exists.
4Your agent

Build it

Invented data becomes typed state and real queries. The screen is checked against the mockup you approved.

A mockup, live on this page

Not a screenshot: the screen below is rendered by Bretzel right now, from the code under it. Click New repair — a mockup's actions do nothing on purpose.

Today's repairs

6 bikes in the workshop

Booked today

6

Ready to collect

2

Expected today

€374.50
Camille MartinCity bike · Gazelle Esprit
Rear derailleur bent, the chain skips under load
Waiting for parts€35.00
Thomas LeroyRoad bike · Trek Domane AL 2
Brake bleed front and rear, new pads, and a hydraulic hose that weeps at the lever after every long descent
In progress€82.50
Ana SilvaCargo bike · Urban Arrow Family
Front puncture
Ready€18.00
Paul DuboisKids' bike
Yearly check before the holidays
Booked€30.00
Sofia GarnierE-bike · Moustache Samedi 28
Motor error E-07 at start-up
In progress€64.00
Marc FournierGravel · Specialized Diverge
Full service
Ready€145.00
def price(amount: float) -> str:
    return f"€{amount:,.2f}"


def todays_jobs() -> list[dict]:
    """Invented for the mockup. Wiring replaces this body, and only it."""
    return JOBS


def nothing() -> None:
    ui.notification("Mockup: nothing is saved.")


def repair_jobs() -> None:
    """Today's repair jobs of a bike shop — the screen being decided."""
    jobs = todays_jobs()
    ready = [job for job in jobs if job["status"] == "Ready"]
    with ui.vstack(gap="lg"):
        with ui.hstack(justify="between", align="center", gap="md", wrap=True):
            with ui.vstack(gap="none"):
                ui.heading("Today's repairs", level=2)
                ui.text(f"{len(jobs)} bikes in the workshop", size="sm", color="muted")
            ui.button("New repair", icon_left="plus", on_click=nothing)
        with ui.grid(cols={"base": 1, "md": 3}, gap="md"):
            ui.stat(label="Booked today", value=len(jobs))
            ui.stat(label="Ready to collect", value=len(ready))
            ui.stat(label="Expected today", value=price(sum(job["price"] for job in jobs)))
        with ui.vstack(gap="sm"):
            for job in jobs:
                with ui.card(padding="md"):
                    with ui.hstack(justify="between", align="center", gap="md", wrap=True):
                        # A minimum width: on a phone the status and the price
                        # wrap under the text instead of crushing it.
                        with ui.vstack(gap="xs", classes="min-w-48 flex-1"):
                            with ui.hstack(gap="sm", align="center", wrap=True):
                                ui.text(job["customer"], weight="medium")
                                ui.text(job["bike"], size="sm", color="muted")
                            ui.text(job["problem"], size="sm")
                        with ui.hstack(gap="sm", align="center", classes="shrink-0"):
                            ui.badge(job["status"], variant="soft",
                                     color=STATUS_COLORS[job["status"]])
                            ui.text(price(job["price"]), weight="medium",
                                    classes="tabular-nums")
JOBS is a list of six invented jobs, chosen to meet the cases the real screen will: a long description, every status, a price that needs its thousands separator one day.

Build it: only the data changes

Once the screen is approved, the file moves into the app. repair_jobs() is not touched: it called todays_jobs() on invented data, it calls it on the database now.
In the mockup
def todays_jobs() -> list[dict]:
    return JOBS          # invented
Wired
from bretzel.state import Topic, reads

REPAIRS = Topic("repairs")


@reads(REPAIRS)
def todays_jobs() -> list[dict]:
    return db.fetch_all(
        "select * from repairs where day = current_date")
New repair gets a real handler marked @writes(REPAIRS), and every open screen that read the repairs follows. A change of design goes back to the mockup, not into the wiring.

See it yourself

A mockup is one file with its own app: mockups/repair_jobs.py holds the four functions above, then a page and the app.
import sys

from bretzel import Bretzel, page, ui

# … JOBS, price(), todays_jobs(), nothing(), repair_jobs(), as above …


@page("/", title="Today's repairs — mockup")
def home() -> None:
    with ui.container(width="lg", classes="py-8"):
        repair_jobs()


app = Bretzel(title="Mockup", secret_key="mockup-only-not-a-real-secret", mode="dev")
app.include(sys.modules[__name__])
Three commands judge it, screenshot it, and let you click through it. The probe needs its extra, installed once.
pip install "bretzel[probe]"
bretzel check mockups/repair_jobs.py
bretzel probe mockups.repair_jobs:app --out mockups/shots/repair_jobs
bretzel dev mockups.repair_jobs:app
bretzel probe drives a real browser and writes the screenshots in light and dark: that is what you validate.

With Claude Code, in plain words

The Bretzel plugin brings this workflow to your agent: ask for a screen, get the mockup and its screenshots, answer with changes, then let it wire the screen. Its hook runs bretzel check on every Python file the agent writes, once bretzel is installed in the project, and hands the findings back.
claude plugin marketplace add JeanHoccart/bretzel
claude plugin install bretzel@bretzel
“I run a small bike repair shop. Show me what a screen listing today's repair jobs would look like before you build anything.”