Globetrotter docsversion 0.3.0 · 2026-12-04

Reference

On this page
  1. Project configuration
  2. CLI
  3. Keyboard
  4. MCP tools (globetrotter-design)
  5. Ready to hand off
  6. Lint rules
  7. Stress tests and moments
  8. The studio's pages
  9. The design panel, the state bar and the problem chip
  10. Project memory
  11. The design file
  12. Catalogue
  13. Layout
  14. Tokens
  15. Contrast
  16. Relations, indexes and ids
  17. A generated backend's environment variables
  18. Package notes
  19. Repository
  20. Glossary

Exact names and numbers. Nothing here needs reading in order.

Project configuration

globetrotter.config.json at the project root, written by init. Every field is optional; paths are relative to the root.

Field Default Meaning
designsDir designs where *.design.json live
generatedDir src/generated pages, <slug>.types.ts, <design>.openapi.json, index.ts
bindingsDir src/bindings binding modules, one per page with a contract
routeBase /g where the app mounts generated pages; next.config.ts exposes it to useNavigate
appDir src/app the app router directory init writes routes into
studioPort 3100 the port dev serves the studio on; --port overrides it. When it is taken, dev prints the command to run instead
appUrl http://localhost:3000 where the studio's Open page button and the checks in the app point; keep it equal to the port the app runs on (dev --app-port N says when it is not)
library @globetrotter/widgets-m3 the widget library
failQuery none for a frontend with no backend: the query (failed=1) its own pages answer by showing their failed state, which states adds to the address in place of failing requests
deploy none what globetrotter deploy remembers of the last deploy: { "host": "cloudflare", "project", "url", "at", "backendUrl" }; backendUrl (the backend's public https:// address, /api goes there) may also be set by hand before the first deploy
backend none the server half: { "dir": "backend", "default": "python", "targets": { "python": { "port": 8000 }, "rust": { "port": 8180 } } }; default is the target the pages talk to (set_default_target, or Make default in the Targets view); with it and no frontend keys the project is a backend alone, its contract in <dir>/contract; service names the service design it serves
frontend the root the pages' side in a folder of its own: { "dir": "frontend", "static"?: true } with any of generatedDir, bindingsDir, routeBase, appDir, appUrl inside it, relative to that folder; static is a site with no bindings to a service; null says there are no pages

<slug> is <design>--<page>, both slugified.

CLI

npx globetrotter init [dir] [--name <design>] [--as frontend|backend|both|static] [--target python|rust|python,rust] [--app-port 3000] [--backend-port 8000] [--yes] [--force]   add Globetrotter to a project, or create one; asks what you are making (--yes answers: pages alone); the design name is lower-case letters, digits and hyphens (up to 64), else init says so and offers one; a held port is refused with the free ones named
npx globetrotter add backend [--target python|rust|python,rust] [--port 8000] [--name <app>] | frontend [--name <app>] [--force]   the other side: a service drafted from the pages, or pages beside a backend
npx globetrotter add target python|rust [--port N] [--default]   another language beside the backend's, on a port of its own (the next sync writes it)
npx globetrotter dev [--no-app] [--no-backend] [--no-studio] [--port 3100] [--app-port 3000] [--host 127.0.0.1]   studio at :3100, the project's app at :3000, and beside a backend its Python and Rust targets (uv sync, migrate, serve on their ports; --no-backend leaves it to you)
npx globetrotter studio build | start [--port 3100] [--host 127.0.0.1]   the studio for production (CI, screenshots)
npx globetrotter sync [--check] [--no-migrations] [--restart-migrations [--yes]]   regenerate; --check exits 1 when stale or invalid, or two pages claim one route; --no-migrations writes everything but the migrations; --restart-migrations moves the unapplied migrations aside and writes one fresh 0001 (it asks first; --yes answers); any other flag is refused
npx globetrotter mcp                                     MCP server over stdio (the plugin runs it)
npx globetrotter check                                   catalogue vs the installed component types
npx globetrotter shots                                   every page at every width → shots/
npx globetrotter tour [design…]                          a video through the app by its own links → shots/tour/
npx globetrotter states [design…]                        each page waiting, failed and loaded in the app, checked → shots/states/
npx globetrotter presses [design…]                       each action pressed in the app on a phone: does the screen change or the page say so? → shots/presses/
npx globetrotter a11y [design…]                          each page read by axe in the app at 412 and 1280: landmarks, names, roles, contrast → shots/a11y/
npx globetrotter a11y --theme dark --open "Discard this job?"   the same in dark, with that dialog (its name, words or id) pressed open → shots/a11y/<design>.dark.open-discard-this-job.md
npx globetrotter m3 [design…] [--page <name>] [--theme light|dark] [--rail expanded]   each page held against Material 3 (colour roles, type, height, corner, elevation, state layers) → shots/m3/<design>.md; exits 1 on a mismatch
npx globetrotter monkey [design…]                        each page pressed at random on a phone, seeded: throws, errors, 5xx, missing pages → shots/monkey/
npx globetrotter journeys [design…] [--journey <name>]   each recorded journey walked in the app by its links, checked → shots/journeys/
npx globetrotter diff [ref]                              each page changed since a git ref, before | after, ringed → shots/diff/ (needs a studio running)
npx globetrotter memory [recall <q> [--limit n] | remember <text> [--tags a,b] [--design name] [--by name]]   the project's design memory
npx globetrotter words [design] [--page <name>] [--out <file>] [--md|--apply <sheet> [--dry]|--check [--strict]]  the words as a sheet or Markdown for a writer; an edited sheet back (--dry first); placeholder copy fails --check
npx globetrotter status [design…] [--json|--check] [--since <ref>] [--watch]  each page ready to hand off or what is still to do, the last checks in the app, what to do next
npx globetrotter doctor [--json]  every rule of "in sync" in one line each, with what to run when it fails (pages, bindings against their types, backend, contract, migrations applied locally, the installed version); exit 1 when one fails — [Upgrade a project](upgrade-a-project.md)
npx globetrotter --version  the version and the commit it was packed from
npx globetrotter deploy [--to cloudflare] [--name <project>] [--backend-url <https url>] [--replace] [--keep] [--dry-run] [--json]   the pages as plain static files on Cloudflare Pages (not yet run against a real account); beside a backend, /api goes to its public address; exit 0 done, 1 failed, 2 wrong arguments
npx globetrotter export <dir>                            a standalone app serving pages at their routes

--host <address> (dev, studio start) is where the studio listens: 127.0.0.1 (this computer only) unless you say 0.0.0.0, which lets a phone on the network open the prototype (/play/<design>) and its tests and nothing else; the studio stays on this computer. A tunnel or Codespaces name for the studio itself: start it with GLOBETROTTER_STUDIO_HOSTS=name1,name2 (exact host names). Every command takes --cwd <project>. In a project, dev stages the studio into <project>/.globetrotter/studio (git-ignored), because Next.js will not compile an app from node_modules.

The checks in the app

Each runs against the project's app (appUrl, or <NAME>_URL), writes a Markdown report and pictures into shots/<name>/, and exits 1 when something fails, so CI can run it. A page whose route takes a value (/jobs/[id]) is opened on the first row its list answers (GET /api/jobs; presses, a11y, monkey, states); with no row it is skipped, said as skipped: no job to open in the report and in status, and not counted as run.

Command What it does Fails when Knobs
tour goes through every page by the page's own links, lingering while entrances play; a video and a captioned storyboard — TOUR_WIDTHS (412, 1280), TOUR_THEME=dark, TOUR_CAPTIONS=0; Playwright's ffmpeg for the video
states holds, fails (503) and lets through each page's own requests in the browser a loading rows' label or an error state missing in its moment, an empty state during a failure, a console error STATES_WIDTH (412)
presses presses every action on a phone from the page as it loads; undoes what offers Undo a press that changes nothing in view and says nothing; slow past 0.4 s is a warning PRESSES_WIDTH (412)
a11y axe on each page as it loads, then with each dialog or sheet pressed open; Tab stops not hidden under a fixed bar, text spacing, no sideways scroll at 320 px; --theme dark in dark, --open <dialog> with that one pressed open, each its own report (<design>.dark.md, <design>.open-<dialog>.md), the light one as it loads kept for Handoff a serious or critical problem; an --open that names nothing A11Y_WIDTHS (412, 1280)
monkey taps, odd words in fields, keys, scrolls and Back at random, seeded a throw, an uncaught promise, an error logged, a 5xx, a link to a page that is not there MONKEY_SEED (1), MONKEY_STEPS (40), MONKEY_WIDTH (412), MONKEY_LOG=1, MONKEY_SLOW=1
journeys walks each journey recorded in the studio by its links at each width a link gone, turned off, opening another page, or the page throwing JOURNEYS_WIDTHS (412, 1280), JOURNEYS_THEME=dark, --journey
status every page: route, shell, lint, ready of seven, the last checks above, what to do next; beside a backend its to-dos too (operations to write, lint, drift, stale checks); --since <ref> says what changed on each side in words and the migrations that came --check: a page not ready; with --since <ref>, only a page made less ready --json, --watch
The storyboard of a tour of the mail app at phone width
The storyboard of a tour of the mail app at phone width

shots takes SHOTS_URL, SHOTS_WIDTHS and SHOTS_THEMES; diff takes DIFF_STUDIO_URL and DIFF_WIDTHS.

The studio's Code & handoff, Handoff view shows each page's last presses, a11y and monkey; the MCP tools check_presses, check_accessibility and check_monkey run the same for an agent.

Keyboard

The studio's ? lists the same, with a line on each.

Find and command ⌘K command palette (the highlighted command draws its After) · ⌘F find layers on every page · ⌥⌘F find and replace the words · / insert where the selection is · C ask for a change · ? this list
Select click · right-click for the actions · ⇧-click adds · ⌘-click in the layers takes a run · a drag on the page body draws a marquee · ⌘-click a link follows it (hold ⌘ to peek first)
⌃1 … ⌃9 open a page · ↑ ↓ ⌥↑ ⌥↓ in Pages move between and reorder
↑ ↓ previous / next node · ⇧↑ ⇧↓ grow the selection · ← → parent / first child · Enter ⇧Enter in / out · Tab ⇧Tab along the siblings · ⌘A the siblings · ⌥⌘A everything that looks like the selection · Esc clear, leave Play
Edit double-click edits text in place · ⌫ delete · ⌘D duplicate · F2 name the layer ($n, $& for several) · ⇧⌘C copy a picture · ⌥⌘C ⌥⌘V copy and paste style · ⌘X ⌘C ⌘V cut, copy, paste · ⇧⌘V paste words as written · ⌘Z ⇧⌘Z undo / redo
Arrange and resize R or F draw where something goes · hover for + · drag (siblings make room; Esc puts them back) · ⌥-drag drops a copy · drag a handle, a gap or a padding grip · ⌥-hover for redlines
⌥← ⌥→ narrower / wider · ⌥↑ ⌥↓ smaller / bigger · ⌘↑ ⌘↓ move among siblings · ⌥⌘T tidy grid items · ⌘G ⇧⌘G group / ungroup
View ⌘+ ⌘− zoom · ⇧0 100% · ⇧1 fit the frame · ⇧2 fill with the selection · ⌘-scroll or pinch zooms around the pointer · Space-drag or middle-drag pans
drag the frame's edge for any width (Page Up/Down on it steps the ladder) · P play · ⇧P present · G grid guides · [ ] hide / show the side panels

MCP tools (globetrotter-design)

Targets: {kind:"content"}, {kind:"secondPane"}, {kind:"region", region}, {kind:"slot", parentId, slot} ("children" is the default slot). Pass design: "<design>~<branch>" to any tool to work on a branch.

Tool Does
design_session(design, page?) start here: the brief, the rules in force, decisions, blocks, the page's review with applies, the latest changes, the open asks and a howTo list, in one call
design_status(design) every page: route, shell, lint, handoff readiness (ready of seven, what is still to do), each finding in its words, the last checks in the app
design_handoff(design, page) finish here: readiness, the Handoff view's prompt, the generated files, the contract, rules, blocks, what is open, a checklist
list_designs · get_page(design, page, format?) · get_node · get_catalog(type?) designs; a page's outline with every node id (json, or markdown: its words as a writer reads them); one node; a type's props, slots and starter
find_nodes(design, query, page?, limit?) nodes by name, words, type, bound path, action or #id, every page
create_design(name, pageName?, route?, template?) · add_page(design, name, route?, template?) · duplicate_page · rename_page (links follow) · move_page · remove_page (its destinations go with it; content links to it are named) templates: project (like this project), blank, article, dashboard, list-detail, settings, form, empty, sign-in (its button runs the service's sign-in); create_design takes all but project and sign-in
add_node(design, page, target, type | node, props?, starter?, index?, wrap?) validated insert; props not passed follow the conventions (the answer says which); a component where only widgets go comes in a Stack of its own (wrap: "row" | "stack")
add_words(design, page, target, text, index?) · add_pages_from_words(design, text) Markdown as widgets in one call; an outline as Article pages, each in the navigation
set_props · remove_node · move_node(…, wrap?) · duplicate_node · wrap_node · unwrap_node · group_nodes(nodeIds, wrapper?, direction?) · convert_node(nodeId, type?) · match_style(from, nodeIds, fromPage?) values may be {"$bind": path, "sample": …}; convert keeps id, children, bindings and words (without type, the options); match carries variants, sizes and layout only
set_region · spread_region(design, page, region) · move_to_page(nodeIds, toPage, copy?) a shell region; the same on every page without one, each made for its page; nodes onto another page
set_grid_layout(nodeId, layout? | spans?) · wrap_in_grid(nodeId, span) · place_beside(anchorId, side, nodeId? | type?, props?, starter?) · split_into_grid(nodeId, spans?) · fill_grid(nodeId, type?) · tidy_grid_items(nodeIds, mode) layouts halves, thirds, quarters, sixths, main-side, side-main, wide-narrow, narrow-wide, feature-two, two-feature, full, or spans of 12; mode: even or same
replace_text(design, find, replace, page?) · get_words(design, page?) · set_words(design, sheet) the words the design shows, never names or paths; every text as a tab-separated sheet (Page, Widget, Part, Words, Id) with the words check's findings; the sheet back, one save
list_asks(design, page?) · describe_action(design, name, description?, calls?, owner?) · list_actions(design) the changes pinned on nodes (clear each with set_props(nodeId, { ask: null })), and forTheBackend: what the pages asked of the service, each open, answered (when, by whom, what was done) or gone (its node removed first); calls names the operation an action runs (Session.signIn); owner: page claims the action's path for the pages (service gives it back); one sentence per action, into the types, the stub and the OpenAPI
set_theme(design, mode?, brand?, motion?) · set_page_transition(design, page, transition) · set_page_refresh(design, page, action) · set_page_reads(design, page, "Loans.overdue") · show_count(design, page, nodeId, "Reports.out") · choreograph_page(design, page, apply?) mode, brand (source, variant, contrast −1..1), motion standard / expressive; slide rise zoom fade none; pull to refresh; Material's entrances for a page
lint_design(design, page?) · apply_fix(design, page, rule, nodeId?, all?) · review_page(design, page) · get_suggestions(design, page) · dismiss_suggestion(design, page, suggestionId, reason?) findings with node ids; a finding's fix (all: every finding of that rule, as Fix all); lint and the memory's suggestions in one report with an ask; what the project would do here, each with an apply
audit_contrast(design) WCAG per colour pair and mode with suggestions; colourBlind: accent roles alike with protanopia, deuteranopia or tritanopia
look_at_page(design, page, width?, theme?, whole?, open?) a picture of the page in the running app (412 a phone, 1280 a laptop; open presses a dialog or sheet open first)
check_presses(design, page?, width?) · check_accessibility(design, page?, width?, theme?, open?) · check_monkey(design, page?, width?, seed?, steps?) the presses, a11y and monkey checks above, for an agent
get_code(design, page, kind?, nodeId?) · get_contract(design, path?) · get_brief(design, page?, prompt?) · get_flows(design) · get_trials(design, journey?) · session_changes(design) page, types or binding (a node's own lines with nodeId); OpenAPI 3.1 (path: one path of it); the handoff brief or a paste-ready prompt; the page graph; how people did on a journey; what this session changed
explain_node(design, page, nodeId) why a node is the way it is: conventions it keeps or breaks, decisions, suggestion verdicts, agent runs
recall(query?, design?, limit?) · remember(text, tags?, design?, page?, kind?) · forget(id) · get_memory(design?) · import_rules(design, text, from?) the project memory: ask it; write a decision (or, with kind, a preference) down; take one out on the person's word; the derived facts; adopt another project's rules or bundle
list_blocks(design?, side?) · save_block(design, page, nodeId, name) · insert_block(design, page, target, blockId, index?) · update_block_instances(design, blockId) pieces of a page saved by name, inserted as a fresh copy linked to the block; a re-saved block updates every place it is used; side: "service" lists the backend's blocks
create_branch · list_branches · merge_branch · update_branch · delete_branch(design, branch, discard?) · get_reviews(design, branch) a copy of the design to try another way, never generated; merge replays its changes on the design as it is now (merged, skipped, overrode); update brings the design's changes in; a delete is refused while the branch holds unmerged changes or a review, unless discard; the reviews made on its prototype
regenerate(migrate?) every design's files; with migrate: true also the migrations a service waits for, as globetrotter sync writes them (never applied)

A Fix can write the service instead of the page (a done checkbox's update command made optional in its params, a related list given its relation param): apply_fix then saves the service design first, through its write path, and its answer carries service: { changed, lint } beside the page's did. In the studio the Fix button on such a finding opens the backend's own review over the page (what changes, the migration it adds, Save or Cancel); Cancel changes nothing, and after Save the finding is gone and a notice says what the backend changed. ⌘Z does not undo a backend save.

Backend tools

The same server, on designs/<name>.service.json. Every change goes through the write path and answers what changed and lint's findings. Studio and agents has each with its arguments.

Tool Does
service_session(design) · service_status(design) start here: what waits for the backend (asks and drift, whose move each is), then the service as an outline: sign-in and the roles, each field's type, default and rules, relations, indexes, what each operation does, allows, emits, takes and refuses, flows and jobs, every node named (entity.field, Service.operation, flow.step, #id); where it stands, nothing run: operations still to write, a migration waiting, a step whose last run died, the pages' data nothing answers, lint (each target's target-unsupported too), drift, the pages' asks, the last checks and presses
add_entity(design, name, store?, fields?) · add_operation(design, service, kind, name, props?, params?) · add_service_node(design, type, target, props?) an entity with its fields; a Query or a Command (a Command's does, left out, is read from its name: create/new/add, update/edit, delete/remove, restore, else custom); any primitive (a field, a step, a job, a cache…), its target a section, {parent, slot}, or just a name ("booking", "flows")
set_service_props(design, node, props) · remove_service_node · move_service_node allow, emits, a field's rules; null takes one away; a field's rename carries the references by name (owner, audited fields, indexes, searches, where, sets, sort, a create's or update's param of that name, a query param's field) and the answer says what it carried and what it could not (words that still say the old name, a param left), and what the pages now ask of it
set_auth(design, types?, roles?, allowFor?, off?, tenancy?, tenancyOff?) sign-in on (the ways in, the roles lowest first; allowFor gives every operation without an allow to that role) or off, as Permissions does; tenancy turns organisations on or changes them, tenancyOff takes them away
use_service_block · save_service_block · insert_service_block shipped blocks (pagination with X-Total-Count, soft delete with undo, email verification, password reset, signed upload, a state machine) and your own
propose_operations(design) what the pages need that the service does not give, each with the add_operation that makes it: a list reads the entity its service or its rows name (returns, many), a form that makes an entity a service keeps is a create there (then describe_action calls), and a row picked beside its list (open, select) is the page's own and needs none
press_operation(design, operation, as?, body?, params?, org?, target?) · check_auth(design, target?) · check_audit · check_tenancy · get_audit one operation pressed in the running backend as a role or a stranger (org: in which organisation; target: which backend); every operation against its allow; every audited write; every read or write around the org scope in your own code; who changed what
get_runs · look_at_traces what flows and jobs did, each try; a request as a tree of spans
compare_targets(design, repeat?) · set_default_target(design, target, why?) the same checks pressed against each running target, nothing changed (every read for real repeat times, every write with a body no operation takes), each operation's status and time side by side from both backends' traces; the target the pages talk to, written through the design's write path (the app's /api forward follows at the next request, the pages unchanged)
who_is_here · blame(design, side?, node?, limit?) · ask_other_side(design, to, text, page?, at?) · decline_drift(design, path) who is on either side; who changed a node, in words (side: design or service); an ask left for the other side; a drift declined by the path's owner

A tool that answers "the design changed on disk" wants to be called again; never retry by rewriting whole JSON.

Ready to hand off

The seven checks of the Handoff view, All pages, design_status and globetrotter status share, in order:

Check Passes when
lint the page has something on it, and no lint errors or warnings
contrast every audited pair is AA in light and in dark
lists each list has its loading rows, empty state and error state
actions every action is described, no button does nothing, and the binding gives every action the page wires
inputs every control is a field or runs an action, and every text field names its keyboard
words no copy is still a placeholder
asks no ask is open on the page

Lint rules

Errors and warnings keep a page from ready (the lint check); notes do not. The ones with a Fix are one click in the studio or apply_fix for an agent.

Area Rules
Structure unknown-type, empty-page, empty-container, empty-grid, empty-list, empty-tabs, empty-form-group, empty-text, empty-label, no-page-inset, duplicate-route, self-link, dangling-href, page-no-way-out, page-unreachable
Shell no-compact-nav, no-wide-nav, no-app-bar, appbar-crowded, bottom-nav-count, nav-selected, tabs-selected, menu-twice, shell-drift, nav-drift, nav-kind-drift
Names and headings icon-button-label, fab-label, fab-empty, icon-empty, image-alt, image-empty, card-media-alt, avatar-alt, control-unnamed, no-h1, second-h1, heading-repeats-title, overlay-unnamed, swipe-unnamed
Data contract, control-unbound, choice-unbound, search-unbound, rows-lead-nowhere, detail-unpicked, detail-unreachable, detail-unmarked, empty-state, list-fails-silently, loading-rows-shape, loading-rows-always, badge-for-status, badge-hides-value, action-undescribed, refresh-missing, swipe-only, table-columns, table-row-width
Forms field-label, field-type-multiline, field-keyboard, field-autofill, street-address, postal-code, current-password
Dialogs and menus opens-missing, overlay-unreachable, overlay-no-way-back, destructive-unconfirmed, dialog-actions, dropdown-no-menu, menu-no-items, menu-and-link, inert-option
Layout and targets targets-overlap, grow-outside-row, image-jumps, exception
Motion motion-in-motion, pop-twice, in-view-without-entrance, shared-alone, shared-twice, morph
Journeys and memory journey-broken, convention, emerging, grid-layout, shell-parity, repeat (a structure repeated: save it as a block), block, memory (a decision that applies here), placeholder, words
Service (*.service.json; all of them in the Backend reference) entity-no-key, operation-unprotected, operation-undescribed, refusal-unsaid, owner-not-applied, create-lacks-field, create-named-otherwise, command-silent, emits-without-entity, command-spans-stores, list-unbounded (info: a many Query with no page, size or limit param; its Fix adds page and size), where-invalid (a Query's where names a field its entity lacks, a value not of the field's type, or a type a where does not take yet — uuid, date, datetime, decimal, json, a relation; until it reads right both targets write the list as a 501 that says why), restore-without-soft-delete, flow-orphan, store-unused, audit-off-pii, audit-sensitive-field, audit-on-volatile-store, magiclink-keeps-no-one, passkey-keeps-no-one, relation-always-many, relation-always-set-null, index-empty, index-unknown-field, overlap-span, overlap-unique, overlap-on-mysql, target-unsupported (a target turned on does not write a kind this service has)
Both sides list-unpaged: the service answers a page's list in pages (page, size) and the page has no field named page to reach the others, so it shows the first and says nothing of the rest. contract-drift: a page and its service disagree on a path (a form field the entity lacks, a kind that clashes, an action calling a path nobody serves, a form field its command does not read, a list row or a form field named for what a renamed field was called (an error: due → due_date, its Fix names it), sign-in on and no page offering it); said on both, the fix on the side that does not own the path

Stress tests and moments

Menu Shows
Stress Long text · Long words · Large text · No text · Many rows · Filled in · Right to left; every widget that breaks is marked and listed
State Loaded · Loading · Empty · Failed · Missing · With errors; with Live on, the app follows (?gt-moment=loading or failed, in a development build)
Where does it break? every width 320–2020 in steps of 16, narrowed to the pixel, under the stress test that is on

The studio's pages

Each is a page to read or send on, live, listed under Share.

Route What it is
/studio/<design> the editor
/play/<design> (~<branch>, ?at=<commit>, ?test=…) the prototype: the pages alone at the window's size; a branch; a version; a journey's test
/changes/<design>?since=<version> or ?at=<commit> what changed: each page before and after, ringed and numbered
/handoff/<design> every page at two widths with its checks, data, actions, moments and files
/responsive/<design> every page at the six widths, what breaks ringed
/accessibility/<design> contrast per pair and mode, colour-blind look-alikes, each page as a screen reader meets it, what axe found in the app
/report/<design>?journey=…&round=… a journey's test with people
/guide/<design> the style guide: colours, type, each widget's looks, the pages' shells and grids, motion, decisions, blocks
/sheet the component sheet: every type and variant
/docs this documentation

The design panel, the state bar and the problem chip

The words are the labels on screen; Build a page does each with a recording.

Design panel, selected widget (top to bottom, no tabs): the widget's name (press: turn into another widget), About, move up, move down, duplicate, delete; then What it does, Style, States, Content, More (folded). With nothing selected: the page's name and route, States, the lint count, More (how it arrives, reads, pull to refresh, shell regions, theme, data contract, contrast, history). Ask Claude is docked under it; Map and Code & handoff are above the canvas. The studio says "Add menu", "Add footer button" where the engine says slot; kind:"slot" in the tools is the same place.

Section For Holds
On press a button, a row, a destination… one of Nothing, Go to a page, Open a menu, Open a dialog, Run an action, Toggle on and off. Run an action: Action name, Then say, Ask first, Then go to (a page, or Stay here). A flow line reads the press; "The binding has no handler “name” yet." names a handler a hand-written binding lacks
What it edits an input its Field (two-way data path)
Repeats over a list or a row Repeat over (a collection); buttons Loading rows, Empty state, Error state
Opened by a dialog or sheet what opens it; its confirming button; Remove this dialog
Style every widget with a surface the widget's own variant, size, shape…; then Corners, Border, Border colour, Fill, Padding, Gap; Custom CSS classes last. Each choice is a token; Default is a choice; Reset per row
States a widget with two or more states Rest; Automatic (Hover, Focus, Pressed); Set by the page (Disabled, Error, Selected, Filled, Busy). Canvas only, never saved
Content the widget's words, icons, and what it holds its text props; buttons that add (Add menu, Add footer button…)
More the remaining props, in the groups Options, Motion, Behaviour, Advanced the widget's other options; Enters, As it scrolls into view, shared name; link, action, field, Repeat over, Show when empty / while loading / when it fails / when the record is missing; Note, Ask, Layer name, Block

Style: corners, border, fill, padding

Props on any node whose widget takes a class (not Page, Spacer, Divider or a shell region). A key the widget already has of its own is never taken (GridItem's fill stays its boolean "Fill the row", with no colour Fill row). A choice left at default writes nothing; a set one writes a class that states.css defines from the tokens, so the canvas and the generated page agree. set_props takes them. Source: packages/core/src/style.ts.

Prop Values Maps to
corners none extra-small small medium large extra-large full gt-r-<value>: --m3-radius-none … -xsmall, -small, -medium, -large, -xlarge, -full. Button, IconButton and Fab also take round and square as their own shape
border none outline gt-border-none; gt-border (1px, --m3-outline)
borderColor outline outline-variant primary secondary tertiary error gt-bc-<role>: --m3-<role> (sets outline on its own)
fill surface surface-container-low surface-container surface-container-high surface-container-highest primary-container secondary-container tertiary-container error-container primary secondary tertiary inverse-surface gt-fill-<role>: --m3-<role> behind it, and the content in --m3-on-<role> (on-surface for the surface roles)
pad 0 1 2 3 4 5 6 8 10 12 16 (the panel draws None, XS, S, M, L, XL as buttons, the rest under More…) gt-pad-<n>: padding: calc(var(--spacing) * n), 4dp steps. Only containers with no padding of their own (a Stack's own padding is driven instead)
gap the same steps the widget's own gap prop (Stack, Section…)
className free text the Custom CSS classes escape hatch (Tailwind or your own); prefer the choices

Lint fill-unreadable (warning) flags text whose tone is the fill's own colour role (it vanishes into it) and a filled Button on a primary fill; its Fix sets the on-colour or makes the button tonal.

State bar above the canvas, Page is: Loaded, Loading, Empty, Failed, Missing (only those the page can be in), Design this state, and Which data where a page lists several collections. ?state=loading|empty|failed|missing shows a moment in the running app (development, or NEXT_PUBLIC_GLOBETROTTER_STATES=1).

Problem chip (Lint clean · N notes, N warning, N error): This page / Whole design; each finding: its sentence, Why it matters, Fix, Show (or Go to the …, Show page).

Project memory

Every project keeps a design memory beside its designs, in designs/.memory/:

File What Kept by
facts.json derived from the designs on every sync: pages, widget usage, the conventions the designs follow (Card.variant=elevated), breakpoint exceptions, grid layouts, brand, actions, data paths globetrotter sync, every studio save
memory.jsonl one entry per line: decisions people wrote down, changes the sync noticed, what became of suggestions the Memory section, remember, globetrotter memory remember, the sync
blocks.json · versions/ pieces of a page saved by name; restore points, kept out of git Save as block…, Save a version…, every agent run

A convention is a prop value most nodes of a type share (at least three, three quarters of them) that differs from the catalogue default. New widgets start with it, the inspector flags one that differs, and a change from outside that breaks it is called out on the canvas. A decision that reads Say X, not Y makes the words check flag Y everywhere. Copy rules and Copy bundle carry a project's rules and blocks to another (import_rules).

With MEM0_API_KEY set, every entry is also sent to Mem0 and recall is semantic; without it, recall matches words. GLOBETROTTER_MEMORY=off disables the layer.

The design file

{
  "version": 1,
  "name": "inbox",
  "theme": { "mode": "system", "motion": "expressive" },       // mode: light | dark | hc-light | hc-dark | system; motion: standard (default) | expressive
  "brand": { "source": "#1b5fcc", "variant": "tonalSpot", "contrast": 0 },   // optional
  "pages": [{
    "id": "p1", "name": "Inbox", "route": "/inbox", "transition": "zoom", "refresh": "reload",
    "shell": { "appBar": Node, "navigation": Node, "panel": Node, "bottomNavigation": Node, "secondPane": [Node], "centered": true },
    "content": [Node]
  }],
  "journeys": [ … ], "actions": { "compose": { "description": "…" } }, "blocks": …,
  "words": { "undo": "Deshacer", "refreshing": "Actualizando {page}" }   // the pages' own words in another language: undo, back, refreshing, loaded, failed, unreachable, notAnswering
}

A node is { id, type, props, slots?, children? }. Prop values: string, number, boolean, { "$icon": "Inbox" }, { "$bind": "path", "sample": …, "samples"?: […] }, or a condition { "$bind": "lines", "when": "empty" | "filled" } and { "$bind": "status", "when": "loading" }. Every type takes note, layer (the designer's name) and ask; every type but the menu and drawer entries takes className; every type but the shell regions takes block; every type but Page and the shell regions takes repeat, whenEmpty, whenLoading, whenError; those that also take a class take grow and shared, and (the two progress indicators apart) enter (fade, rise, scale, pop, slide) and enterInView; actionable types take href, action and opens (a Drawer item href only); inputs take field; a text field also type and autoComplete; a list item swipe, swipeIcon, swipeLabel. Ids are stable [a-z0-9-]+.

A Destination, a Drawer item, a Button or an Icon button whose only job is href is drawn as a real link (<a href>, Linked in the generated page): a plain click still plays the page transition, while ⌘-click, a middle click, a search engine and a browser without scripts follow the address. One that also runs an action stays a button. A static site's links end in /.

Catalogue

Tiers: a page's content takes widgets and layouts; components go only where a slot names them, or in a Stack.

Tier Types
Shell regions AppBar, NavigationRail, Drawer, BottomNavigation, SidePanel, SideSheet
Layout Page, Stack, Grid, GridItem, Section, Spacer
Content widgets Text, Hero, Card, Image, Bullets, MotionGraphic, StatTile, EmptyState, LoadingRows, DataTable, SegmentedButtons, List, Tabs, FormGroup, SearchBar, Dialog, BottomSheet, Snackbar
Components Button, IconButton, Fab, Chip, MenuItem, MenuDivider, TextField, SurfaceTextField, FormControlLabel, Checkbox, Radio, Switch, Divider, Avatar, Badge, Icon, LinearProgress, CircularProgress, ListItem, Tab, NavigationAction, DrawerItem, DrawerSectionHeader, DrawerInfoItem, DrawerInlineFab, DrawerBanner, ThemeToggle

get_catalog(type) or the Add panel's hover gives a type's props, slots and a starter; the skill plugins/globetrotter/skills/m3-design/SKILL.md has every prop in tables; /sheet renders every variant. Adding a widget means packages/widgets-m3/src: implement it, add a catalogue entry (defaults equal to the component's own), map it in render.tsx, then npm run typecheck && npm run check:catalog && npm test.

Icons: Add, Close, CloseSmall, Check, CheckSmall, CheckIndeterminateSmall, ArrowBack, ArrowForward, ArrowUpward, ArrowDownward, ArrowDropDown, ArrowDropUp, ArrowRight, ChevronLeft, ChevronRight, ExpandMore, ExpandLess, Menu, MenuOpen, MoreVert, Search, Edit, Delete, Favorite, FavoriteOutline, Person, DragIndicator, Circle, Pentagon, LocalTaxi, GridGuides, CheckBoxOutlineBlank, CheckBox, IndeterminateCheckBox, RadioButtonUnchecked, RadioButtonChecked, RadioButtonPartial, Inbox, Settings, Attachment, Archive, Logout.

Layout

Size class by content width; each docked panel shifts the ladder one step:

Size class 0 docked 1 docked 2 docked
xsmall < 600 — —
small 600–839 840–1279 1280–1659
medium 840–1279 1280–1659 1660–2019
large 1280+ 1660+ 2020+

Compact (xsmall, small): no rail, drawer or panel; bottom navigation shown; a panel with something to do in it opens as a modal side sheet from a tonal button. A side panel gives way first: it docks where the class counted with it is not compact (1660 beside a rail, 1280 alone); narrower, it opens from its button and the page is sized without it, so the rail shows from the same width on every page. Each page draws its own navigation widget: a page whose kind (drawer, rail) differs from the clear majority's is nav-kind-drift. Pane caps: compact 936 (a tablet sideways), medium 936, large 1128; prose 720; the pane is centred in its room (shell.centered: false keeps it to the start). Dual pane: two equal panes, 24 dp gutter; on compact the detail is its own screen (useDetail). Column grid by pane width: 4 under 600, 8 under 840, 12 from 840 (gutters 16/16/24). Fixed widths: rail 80, drawer 360, side panel 360, bottom navigation 72, app bar 64/112/152. Spacing is 4 dp steps; radii 4, 8, 12, 16, 28; container radius 16. Frames: Phone 412, Foldable 600, Tablet 840, Laptop 1280, Desktop 1660, Wide 2020; a phone sideways 915 × 412; browser bars leave 412 × 787 (Chrome on Android) or 412 × 785 (Safari).

Tokens

Everything is a token and a Tailwind name: bg-primary, text-on-surface-variant, border-outline-variant, bg-surface-container-low, text-title-medium, font-display / font-sans / font-mono, rounded-container, shadow-e2. Colour roles are pointers into tonal palettes, so a brand swaps palettes and everything follows. Type scale: display 52/41/36, headline 32/28/25, title 22/18/14, body 16/14/12, label 14/12/11 (Readex Pro for display to title, Inter for body and label).

Modes: data-theme on <html> (light, dark, hc-light, hc-dark), or the OS preference when unset; ThemeToggle persists the choice.

Motion (@globetrotter/widgets-m3/motion.css, generated from packages/core/src/motion.ts by npm run motion:css -w @globetrotter/widgets-m3): --m3-motion-duration-{short1…extra-long4}, --m3-motion-easing-{standard,emphasized}[-decelerate|-accelerate], and the M3 springs as linear() curves: --m3-motion-{spatial,effects}-{fast,default,slow} and …-duration. data-motion="expressive" switches the spatial springs. Entrances are gt-enter-{fade,rise,scale,pop,slide}, staggered by --m3-motion-stagger; a page transition sets <html data-gt-transition="gt-slide-forward"> (and the like), the content is the gt-page view transition, a shared element gt-shared. Under prefers-reduced-motion: reduce, or a data-reduced-motion attribute, every entrance is a short fade and pages cross-fade.

Contrast

Audited pairs (17): on-colour on primary/secondary/tertiary/error and their containers, body and supporting text on surface and containers, text button and error text on surface, snackbar, outlines and selection controls as UI (3:1). Thresholds: text AA 4.5, AAA 7; UI 3. Built theme and level 0: AA everywhere, dark AAA everywhere. Brand contrast level 1: AAA everywhere.

Relations, indexes and ids

a Relation many or one; required (Always, one only): the link column is NOT NULL, the contract requires <name>Id, a create needs it, an id with no row is a 404; turning it on or off later is a migration step with a NOTE (sqlite gets a rebuild recipe)
an Index fields, unique; noOverlap (No overlap between, two date-time fields start, end) with message (When it overlaps): postgres an EXCLUDE constraint (half open, btree_gist), sqlite two triggers, mysql not kept (lint says so); an overlap is a 409 in the message's words, a span that ends before it starts a 400, on create and update; one may end where the next starts
a uuid postgres UUID; sqlite TEXT and mysql CHAR(32) holding 32 hex digits (as SQLAlchemy's Uuid and the Rust target write it; an older mysql table's CHAR(36) still fits); hyphenated in JSON; the audit, outbox and flow-run ids are hyphenated text (CHAR(36))

A generated backend's environment variables

What the Python backend reads where it runs (Deploy and operate has the steps; every prop and lint rule is in Backend reference).

Variable Read by What it does
GLOBETROTTER_ENV everything the environment, its settings in designs/components.<env>.json; unset is production and the server refuses to start (only the exact word local restarts on a change, answers a 500 with its exception and line, and serves /docs); a name the project does not declare needs every store's address given below
GLOBETROTTER_<STORE>_URL settings, migrate a store's address, over the components file's (GLOBETROTTER_DB_URL for a store named db)
a secret's name ({secret:NAME}) settings its value, set where the backend runs; globetrotter status lists each environment's
HOST, PORT python -m <app>_fastapi where it listens (127.0.0.1 and the config's port by default)
WORKERS python -m <app>_fastapi processes outside local (1 by default; local runs one, reloading)
LOG_LEVEL the app, the relay your code's and the generated code's log level on stderr (INFO)
GLOBETROTTER_BROKER_URL the relay, the worker the broker a worker flow's events go through
GLOBETROTTER_MAX_BODY the app the largest request body, in bytes (2 MB; a larger one is refused with 413)
GLOBETROTTER_BACKEND_URL the pages' src/proxy.ts where the pages' /api/* goes, at each request (else the address the app was built with)
CORS, list bounds, pools, metrics, sign-in limits and the secrets the app, db.py one row each in the Backend reference

GET /health (the process is up) and GET /ready (every store reached and migrated, else 503 with what is behind) are the backend's own, not the contract's.

Package notes

Two behaviours of @material3-electricmonk/tokens 0.1.0 that Globetrotter compensates for; both belong upstream:

  • hc-light and hc-dark re-declare opacity and blur tokens only; their colour roles equal light and dark.
  • setBrandColor's contrast option does not change the palettes. Globetrotter's Brand widget emits the roles of Material's dynamic scheme for any non-zero level, and the audit reads the same roles.

Repository

packages/core        engine: schema, catalog (registry + rules), ops, codegen, contract, openapi, lint, flows, brief, readiness, memory, branches, config, fs
packages/widgets-m3  the Material library: widgets, Brand, catalogue entries, templates, renderer, contrast audit, motion.css
packages/primitives  the backend's building blocks (Store, Entity, Service, Query, Command, Flow, Job, …) and the SQL migrations
packages/target-python  the Python target: a uv workspace of FastAPI, SQLAlchemy and your impl package
packages/target-rust the Rust target: a workspace member per service design (axum, SQLx, Cedar, apalis, tracing) beside your crate
packages/studio      the Next.js editor; e2e.mjs drives it, the steps in e2e/ by area (basics, canvas, memory, frames, apps)
packages/cli         globetrotter: init, add, dev, studio build|start, sync, mcp, check, shots, tour, states, presses, a11y, monkey, journeys, diff, memory, words, status, export; templates/ is what init writes
examples/mail        a mail client: Zustand store, list–detail with nested replies, settings via a route handler
examples/fieldops    field service on its generated Python backend (backend/), nested tasks, item actions, a form of fields
examples/storefront  a shop: repeated grid, cart, checkout; dark, brand contrast 1 (AAA)
scripts/example-designs  how the example designs were first built (the same ops the MCP tools use)
plugins/globetrotter the Claude Code plugin (MCP server + skill); .claude-plugin/marketplace.json at the root
docs/                this documentation; img/ holds the pictures, shots.mjs, gifs.mjs, example-shots.mjs, states-shots.mjs, plan-shots.mjs, backend-shots.mjs and backend-views-shots.mjs take them

Checks: npm run typecheck, npm run lint, npm run check:catalog, npm run design:sync -- --check, npm test (the core's tests), node packages/cli/test/mcp-smoke.mjs, npm run build, npm run e2e (the studio and the mail app running; E2E_ONLY=memory,apps runs a subset; E2E_DESIGN=fieldops E2E_STUDIO=0 E2E_APP_URL=… for the other apps), npm run monkey:studio. CI runs all of them plus a fresh init from packed tarballs, and presses, a11y and monkey on each example app.

Glossary

  • Design: one app, one *.design.json: pages, theme, brand, journeys, actions, blocks.
  • Page: a route with a shell (regions) and content.
  • Shell regions: app bar, navigation (rail or drawer), panel (side panel or side sheet), bottom navigation, optional second pane.
  • Widget / layout / component: the three tiers; see Catalogue.
  • Slot: a named place in a widget that accepts certain types. The studio says it in words ("Add menu", "Add footer button").
  • Catalogue: the registry of placeable types, their props, defaults and slots; the authority for validation, rendering and codegen.
  • Binding: a prop that reads a path in the page's data ($bind), with a sample for the canvas.
  • Repeat: a node rendered once per element of a collection; its bindings use item.*.
  • Action: a named handler in the binding module; receives the item inside a repeat.
  • Field: an input bound two ways: the page reads data.<path> and calls actions.change(path, value).
  • Contract: the page's bindings, collections, actions and fields, as TypeScript types and OpenAPI.
  • Binding module: src/bindings/<slug>.ts, yours; exports use<Page>Page(). A stub until your first edit, then never written again.
  • Sync: regenerate everything from the designs; --check only reports.
  • Size class: xsmall, small, medium, large; of the content area, after docked panels.
  • Compact: xsmall or small.
  • Brand: a source colour, a scheme variant and a contrast level; regenerates the palettes.
  • Convention: a prop value most nodes of a type share in a design; new widgets start with it.
  • Block: a piece of a page saved by name, inserted as a linked copy.
  • Branch: a copy of a design to try another way, never generated, merged as one reviewed edit.
  • Journey: a named path through the app, recorded in Play mode, walked by journeys and tested with people.
  • Ask: a change requested on a node, pinned on the canvas until done; never rendered.