Any look. One contract.
The engine decides what a page says and does. The theme decides how it looks. Between them is the storefront contract: every page, every field and every rule, written down and checked.
A theme is a folder.
Server-rendered pages in Go templates, your own CSS and scripts, and one file that names the contract version. The engine does the rest: data, words, forms, checkout and payment.
my-theme/ ├─ contract.yaml version 5 or 6 ├─ _base.html your layout ├─ product.html a page type ├─ cart.html, checkout.html, order.html, … ├─ order_confirmation.txt a mail type ├─ mail/ HTML mail (v6) └─ assets/ CSS, fonts, scripts └─ theme.css at /assets/theme.css
Counted in the storefront contract (CONTRACT.md) on main, 18 November 2026. Some page and mail types are optional.
{{/* _base.html: your layout */}} {{define "base"}}<!doctype html> <html lang="{{lang}}"> <head><link rel="stylesheet" href="{{asset "theme.css"}}"></head> <body><main>{{block "main" .}}{{end}}</main> {{engine.PolicyLinks}}</body></html>{{end}} {{/* product.html: your page, the engine's parts */}} {{define "main"}} <h1>{{.Title}}</h1> {{engine.ProductImage .}} {{engine.AddToCartForm . "options" "boxes"}} {{end}} {{template "base" .}}
After the example in the contract. {{asset}} adds the file’s hash to its address, so a browser keeps a copy for good and a change gets a new address.
Your markup, safely escaped
Templates are Go html/template: data is escaped for where it is written, so it is never taken for markup.
The engine’s parts, your style
The add-to-cart form, the checkout form, the order summary and the policy links come from engine.* calls. Your theme places them and styles them, and never writes them.
Words in the store’s language
Every word a buyer reads comes from the engine’s message catalogue through t. Amounts come through price, times through when.
Any CSS, any script
Plain CSS, a utility framework or your own design system, in assets/ or a <style> in a template; scripts as files in assets/. The security policy allows no style attributes and no inline script.
Works without JavaScript
A buyer can find a product, add it and check out to the payment gateway with no script. Add htmx if you like: the cart and the search answer with fragments.
A change shows at once
The engine reads assets from disk on each request, so a changed stylesheet shows on the next reload. Restart the engine after a template change.
How theme work goes
The engine is not public yet. These are the three stages of theme work.
Start from an example
Copy the small example theme or the bare skeleton. Both are in the contract folder,
shared-contracts/storefront.Check it, and see every page
The engine checks the theme and writes each page in each of its states to a folder, with example data, no store and no port.
Serve it on a store
A store serves the theme. A test catalogue fills an empty store, so that every page has something to show.
Same data. Switch the theme.
The product, the price and the form stay the same. Only the theme changes. That is the whole idea of the contract.
Illustrations of three looks. The engine ships no storefront CSS.
A theme is mostly CSS. Change it live.
Start from a look, then move the controls and watch a small shop change. Below the shop is the CSS that makes the look, and a check of every pair of text and colour. In a real theme it is a file in your theme folder, next to your page templates. The engine does not know it is there.
An illustration with invented products. The look is real CSS, but the engine’s own parts (the cart, the checkout, every word) come from the engine in the same way for every theme.
This tool needs JavaScript. A theme is a folder with your page templates and CSS: see below.
Who owns which part.
The theme decides how it looks: Go html/template pages, the CSS, the pictures and a contract.yaml that names the contract version.
The engine gives each page its data and its words, and the parts it depends on: the cart and checkout forms, the order summary and the policy links. A theme places them with template functions.
From the storefront contract (CONTRACT.md) on main, 18 November 2026.
Checked before it serves.
The engine loads the theme once at start. It refuses to serve a theme that breaks the contract, and names every problem. The same check runs before you ship.
The check can also write every page with example data, so that you can look at each one before a buyer does.
A contract that only grows.
Version 5 is closed
Its list of additions is final.
Version 6 is open
It can still get additions. From version 6 a theme can also give HTML mail, with its own tokens and components.
A typed contract
A data struct for each page and a generated CONTRACT.md. A test fails when the document and the code differ.
Three places to start.
A small styled theme
Uses every template function and a shared layout partial.
The bare skeleton
One unstyled template for each page.
A full theme
Covers every page and every mail, phone first.
Source: shared-contracts/storefront on main, 18 November 2026.