Developer docs

Using AI to build a theme

Dispense Flow developers

In short

Generate a theme from a brief, or build one on your machine with the theme CLI and Claude Code, Cursor or any agent.

In the developer dashboard

Themes > Generate with AI. Describe the style, pick the categories that should get their own design, choose default colors. The AI writes a complete package against the theme spec, our checks run on it (and it gets one chance to fix what they find), and it opens in the browser editor as a draft. Developers get 2,000 free AI credits a month.

On your machine

npx @dispenseflow/theme-cli init my-theme
cd my-theme
npx dftheme dev      # every page with sample products per category, at phone, tablet and desktop widths
npx dftheme check    # the platform's own checks, offline
npx dftheme package  # my-theme-1.0.0.zip
DFTHEME_API_KEY=dfdev_... npx dftheme push

init writes two files for your AI: THEME-SPEC.md (the whole contract, generated from our validator) and AGENTS.md (the build, check and preview loop). Open the folder in Claude Code, Cursor or any agent and ask for a theme; it can run npx dftheme check --json after every change and fix what blocks.

The local preview runs every page in the same isolated frame and under the same security policy as a live store, so a page that works locally works on a store.