lesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured datalesson 2 of 3 · the design kit — brand bible and design tokens as structured datathe design kit — brand bible and design tokens as structured data
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
Full pipeline: validate the kit, then compile it into a prompt — and refuse to compile a broken kit, because a broken kit poisons every asset in the batch.
Write two functions.
validate_kit(kit) returns a list of problem strings, in this order:
"missing {field}"for each ofREQUIREDnot present in the kit (inREQUIREDorder)"banned list is empty"ifbannedexists but is[]
compile_prompt(kit, brief):
- if
validate_kitfound problems, return"REJECTED: "+ problems joined with"; " - otherwise return
f"{subject}, {medium}, featuring {motifs}, palette of {palette} --no {negatives}"where motifs =kit["motifs"]joined with", ", palette = the color names joined with", ", negatives =sorted(kit["banned"])joined with", ".
Expected output:
rooftop espresso bar at dusk, flat vector illustration, featuring halfmoon mark, steam lines, palette of terracotta, deep teal, off-white --no gradients, neon, stock-photo smiles
hands cupping a warm mug, risograph print, featuring halfmoon mark, steam lines, palette of terracotta, deep teal, off-white --no gradients, neon, stock-photo smiles
REJECTED: missing type; banned list is empty