Case study
BrandMaker
BrandMaker turns named, typed workflows into production brand assets — logos, social cards, thumbnails, posters, animated web assets, and short videos. It runs as a browser dashboard and a CLI, with AI models doing the generation and deterministic code as a fallback, so a real asset always comes back. In development.
What it does
A catalogue of assets
Eight typed workflows cover logos and brand marks, social cards, thumbnails and posters, animated web assets, and short ambient video — each a reusable recipe, not a one-off prompt.
Always returns an asset
Every job grounds a prompt, generates, verifies the result, then degrades to a deterministic SVG or pre-written text when a model or quota is unavailable. Nothing ever blocks.
Brand as the durable noun
A brand owns its palette, type, voice, and logos; refined once in an AI-review loop, it becomes the context every downstream asset is generated from.
No anchoring on logos
Logo runs return four diverse options side by side with no “recommended” bias; you pick the winner, and it feeds the rest of the brand.
Under the hood
Plain English by default — switch to the engineering detail.
The deterministic seam
A hard line separates pure prompt-building — same inputs, same prompt — from the AI calls that have side effects. Everything crosses it as one validated asset type.
buildPrompt is a pure function; the model client owns all effects; a Zod-validated GeneratedAsset is the seam contract, and every call runs ground → generate → verify → degrade.
Model routing by job
Different assets need different models — legible-text images, true-vector logos, photoreal backgrounds, video — each with a fallback chain that ends in deterministic code.
Templates are organized by lane (text-critical, logos, photoreal) and carry their model; fallback chains live in one models module, and every call logs its model and cost for telemetry.
A typed brand model
A brand is a strict, validated record — palette, typography, voice, logos — with per-field provenance, re-checked on every read.
A Zod brand schema caps every free-text field (guarding against prompt-amplification) and records the source of each field; it’s the validated output of the onboarding AI-review step.
Spend and abuse control
Free, verified, and paid tiers meter generation per identity, and a dry run builds the prompt without spending anything.
A composite identity key — account, hashed email, fingerprint, network — drives a token-bucket budget; deterministic, template-rendered assets cost nothing, and the per-identity cap is the real loss bound.
Offline-capable surfaces
The dashboard caches templates and recent assets and queues work offline; the CLI calls the exact same procedures as the browser.
A service worker caches the versioned template catalogue and recent assets; the CLI speaks the same tRPC procedures over Node HTTP, so the two surfaces can’t diverge.
How you reach it
Built with
- TypeScript
- Next.js
- tRPC
- Zod
- React
- Tailwind
- Supabase
- Google AI
Do the prompt work once
BrandMaker encodes a brand-asset method as typed, reusable workflows — invoke one by name and it composes its own prompt, calls the right model, and falls back to code if the model can’t. The “always returns an asset” guarantee is built in, not bolted on.