1---
2name: brand-mascot
3description: Create a branded mascot for a product and keep it visually consistent across an entire ad or content campaign. Runs one of two arcs — invent a mascot from scratch (discovery, character brief, anchor kit) or wrap a consistency system around existing mascot art — then generates on-brand campaign images by conditioning every render on an actual reference PNG, composites real text over the art in HTML/Chromium, and renders each platform format natively. Use when the user says "create a mascot", "brand character", "design a mascot", "mascot kit", "keep the mascot consistent", "character consistency", "consistent character across images", "brand campaign images", "on-brand illustrations", or "make my mascot do X".
4---
5
6# Brand Mascot — create a mascot and hold it consistent across a campaign
7
8Turns a product into a recognizable mascot and then generates a whole campaign's
9worth of on-brand images of that mascot without the character drifting between
10renders. The whole system rests on one mechanism: **identity lives in an attached
11reference image, never in prose.** Every generation call passes an actual PNG of
12the mascot as the first `inlineData` part and tells the model, in a short fixed
13line, to keep that character exactly consistent and only re-pose it. Text that
14re-describes the character's appearance is the #1 cause of drift — so we never do it.
15
16**Read the four reference files before generating anything. They are the contract,
17not background reading:**
18
19- `references/prompt-patterns.md` — the exact reference-conditioning request shape
20 (image part first, text part second) and the fixed consistency line. Copy it verbatim.
21- `references/style-contract-template.md` — the `BRAND_STYLE` contract to fill in per
22 brand, with the WHY behind every hard-negative guardrail (each one prevented an
23 observed failure).
24- `references/format-matrix.md` — the format render table (7 platform sizes with dims, plus
25 the source art = 8 artifacts per piece) and the letterboxing gotcha that must be fixed in
26 the compositor.
27- `references/pitfalls.md` — the documented failure log. Read it before the first render
28 so you design against these, not into them.
29
30Everything here was extracted from a campaign that shipped: the soclever "Lottie"
31mascot pipeline, built as three pieces — a generator that renders the art, a concepts
32file that holds the campaign's scene list, and a compositor that lays real text over
33each render. That three-file split is the shape §3 describes, and it is worth keeping.
34This skill is self-contained; you do not need that codebase to run it.
35
36## 0. Prep — pick the entry point
37
38Ask, with AskUserQuestion (batched), which arc this is:
39
40- **Entry A — no mascot yet.** The brand has no character. Do §A1 → §A2 → §A3, then §1–§4.
41- **Entry B — mascot art exists.** There's already a mascot (a logo character, an existing
42 illustration, a prior kit). Skip to §B1, then §1–§4.
43
44Also gather up front, whichever arc: the brand's color tokens (hex), the campaign's
45surfaces (which platforms/formats — see `references/format-matrix.md`), and the image API
46key (`GEMINI_API_KEY`; see §3 for the env pattern).
47
48---
49
50## Entry A — invent the mascot
51
52### A1. Discovery — AskUserQuestion, batched
53
54Ask these together (up to 4 per call, let the owner arrow between them). Never invent the
55answers; a mascot chosen without them drifts toward a generic stock character.
56
571. **Brand personality** — 3-5 adjectives (e.g. patient, playful, precise). These become
58 the mascot's default expression and the campaign's emotional baseline.
592. **Audience** — who sees these images, and what should the mascot make them feel
60 (reassured? challenged? amused?).
613. **Product metaphor** — what does the product *do*, reduced to one concrete image? The
62 mascot usually embodies or accompanies that metaphor.
634. **Species / character candidates** — animal, creature, object, or abstract form? Offer
64 2-3 candidates that fit the personality and let the owner pick or redirect. Favor a
65 silhouette that stays recognizable at thumbnail size and has one or two signature
66 features (a color, a shape) that carry identity.
67
68### A2. Character design brief — get it approved before generating
69
70Write a short brief (not code) and get an explicit yes:
71
72- **Species + signature features** — the 1-2 non-negotiable identity markers (Lottie: a
73 peach-gold axolotl with feathery gill-plumes). These are what the reference image must
74 lock and what `BRAND_STYLE` must protect from recoloring.
75- **Signature palette** — the mascot's own colors, stated as hex, **separate from and
76 allowed to differ from** the brand palette. This separation matters: the brand wash can
77 be blue/teal while the mascot stays warm gold — and the contract must forbid the model
78 from blending one into the other (see pitfall 1).
79- **Default expression + proportions** — the resting pose the front anchor will hold.
80- **Persona modes (optional)** — "hats" the same character wears for different campaign
81 registers (coach, professor, scout, spark). Decide these now; they become mode variants
82 in the kit and per-use-case reference choices later (§2).
83
84### A3. Generate the anchor reference kit — reference-conditioned iteration
85
86This is the bootstrap. The **first acceptable render becomes the anchor**, and every
87subsequent kit image is generated FROM that anchor as an `inlineData` reference — so the
88kit is internally consistent by construction, not by re-describing the character each time.
89
901. **Seed render.** Generate the front-facing mascot from a text description (this is the
91 *only* time appearance is described in prose — you have no reference yet). Generate
92 against a plain solid background (a magenta/chroma key if you'll cut it to transparent
93 later). Iterate the text until one render matches the A2 brief. **That render is the
94 anchor.** Save it (`anchor-front.png`).
952. **Every other kit image conditions on the anchor.** Now switch to the
96 reference-conditioned request shape from `references/prompt-patterns.md`: attach
97 `anchor-front.png` as the first part, and in text ask ONLY for the new angle/mood/mode —
98 never re-describe the character. Generate:
99 - **Angle anchors** — three-quarter-left, three-quarter-right, profile, full-body.
100 (These exist so downstream calls have a clean angle to condition on, not for direct
101 campaign use.)
102 - **Mood set** — one render per emotional register the campaign needs (encouraging,
103 focused, playful, oops, wistful, etc.). Match this list to the campaign's tones.
104 - **Persona/mode variants** — one per "hat" decided in A2.
105 - **Accessories (optional)** — standalone overlay props (spectacles, cap, headphones)
106 if the campaign reuses them across moods.
1073. **One state change per call.** Never combine pose + accessory + mood in a single
108 generation — it multiplies drift. Change one thing, condition on the anchor, accept, move on.
1094. **Human-judge each round.** Lay the batch out as a contact sheet and accept only renders
110 that hold identity against the anchor. Accepted files become the kit. If you'll use them
111 on colored backgrounds, chroma-key the accepted renders to transparent RGBA (keep the raw
112 renders untouched alongside).
113
114Kit output: `anchor-{front,34l,34r,profile,full}.png`, `mood-{...}.png`,
115`mode-{...}.png`, optional `acc-{...}.png`, plus a transparent-cut copy of each for
116overlay use. This kit is now the reference library §2 draws from.
117
118---
119
120## Entry B — mascot art already exists
121
122### B1. Build the consistency system around the existing art
123
1241. **Confirm the anchor.** Get the cleanest existing front-facing image of the mascot.
125 That becomes `anchor-front.png` — the primary identity reference. If the only art is a
126 logo tile or a busy scene, generate a clean front anchor FROM it using the
127 reference-conditioned shape (§prompt-patterns), then treat that as the anchor.
128 If that source art has a baked-in background and you will overlay the mascot on
129 colored surfaces, also cut a transparent-RGBA version (§A3 step 4) — a tile
130 pasted onto an ad reads as a sticker, not a character.
1312. **Fill gaps in the kit.** If the campaign needs moods/modes/angles the existing art
132 doesn't have, generate them from the anchor exactly as in §A3 step 2 (one change per
133 call, condition on the anchor, human-judge). Skip any the existing art already covers.
1343. **Write the `BRAND_STYLE` contract** for this brand from
135 `references/style-contract-template.md` — fill in the brand palette, the mascot's own
136 signature colors, and any brand-specific guardrails. This contract is prepended to
137 every campaign prompt.
1384. Continue to §1.
139
140---
141
142## 1. Write the per-piece concept briefs
143
144For each campaign image, write a concept with three parts (keep them as data — a config
145object or a list — so copy edits never trigger a re-render):
146
147- **Composition metaphor** — a concrete visual object/scene standing in for the idea.
148- **Emotional register** — the feel the scene must land, stated independently of the metaphor.
149- **Concept-specific guardrail list** — an "avoid" list of clichéd, harmful, or
150 over-promising visuals unique to this piece (e.g. a discouraged-learner piece bans crying
151 children and failing grades). This repeats the brand-wide no-face / no-text rules on purpose
152 — belt-and-suspenders beats trusting the shared preamble alone.
153- **`mascotRef`** — which kit image (§2) this piece conditions on.
154- **Overlay copy** — headline / CTA / wordmark as plain text fields. This is composited later
155 as real HTML (§4), never generated into the art.
156
157## 2. Select a reference per piece — controlled variation, not drift
158
159Assign each piece exactly one `mascotRef` from the kit, matched to that piece's emotional
160register: a supportive piece points at the coach/encouraging mood, a mastery piece at the
161professor mode, a neutral piece falls back to a plain front or three-quarter anchor.
162
163Why this is variation and not drift: every render is still conditioned on a kit image whose
164identity was already locked against the anchor. What differs between pieces is only the
165starting pose/expression the model re-poses from — a curated, pre-approved set — not the
166character's identity. Drift is the opposite: a *new, unreferenced* image where the model's
167own defaults creep in. Picking a different mood sprite is a creative choice; generating with
168no reference is the failure mode.
169
170## 3. Generate the illustrations — reference-conditioned, zero text
171
172Use the exact request shape in `references/prompt-patterns.md`. Per piece:
173
174- Prompt = `[BRAND_STYLE, "Composition brief: <metaphor>", "Mascot: <pose>. Keep the
175 mascot's identity (colors, face, proportions) EXACTLY consistent with the attached
176 reference image — it is the same character, just re-posed."]` joined by blank lines.
177- Request body: `inlineData` PNG part FIRST, `text` part second. Never re-describe the
178 mascot's colors/proportions in the text — the attached pixels carry that.
179- **Zero text in the art.** `BRAND_STYLE` forbids all words/letters/numbers/labels; the art
180 is a pure image layer for §4 to composite over.
181
182Working model default (swappable — this is the model slot, not a hard dependency):
183
184```
185Model: gemini-3.1-flash-image-preview (AI Studio REST, plain fetch — no SDK needed)
186Endpoint: https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:generateContent?key=${KEY}
187Config: generationConfig = { responseModalities: ['IMAGE'], imageConfig: { imageSize: '1K' } }
188Key: GEMINI_API_KEY || GOOGLE_GENERATIVE_AI_API_KEY || GOOGLE_API_KEY (from env, never hardcoded)
189Cost: ~$0.067 / image observed at 1K (verify current pricing; override the estimate if the rate moves)
190```
191
192Retry is coarse and human-in-the-loop: regenerate one piece at a time (~2 tries) if the art
193comes back off-brief (wrong mascot look, a human face, chaotic composition), tweak the prompt,
194retry. Write retry variants to a side path so you don't clobber an accepted render before QA.
195
196## 4. Composite text over the art — HTML/Chromium, native per format
197
198Never bake text into the generated image (models render melty/garbled type; see pitfall 2).
199Composite all copy afterward as real HTML/CSS text screenshotted via headless Chromium.
200
201- **Render each platform format natively at its exact pixel viewport** — do NOT crop or
202 resize one canonical image to hit each platform. Formats that share a layout still get their
203 own render. Use the table in `references/format-matrix.md` as the starting matrix.
204- **Pin square art to a 1:1 card (the letterboxing gotcha).** Square source art dropped into a
205 non-square format's flex box stretches and leaves white gutter bands. Give every
206 illustration card an explicit `aspect-ratio: 1 / 1` and center it — `object-fit: contain`
207 alone does NOT fix this (it shapes the image, not the box). Full detail in
208 `references/format-matrix.md`.
209- **Use a transparent-background mark for the logo**, never the app-icon tile — a tile's baked
210 background reads as a sticker on a colored card (pitfall 4). Keep both asset variants.
211- Editing overlay copy is a pure data change re-run through the compositor only — it never
212 triggers a new (paid, slow) image generation.
213
214## 5. QA — ONE pass at the end
215
216After a full generation + composite pass, review the whole set together (a contact sheet):
217
218- Identity holds across every piece (gill/signature color intact, not recolored toward the
219 scene; proportions consistent; same character everywhere).
220- Zero legible text anywhere in the *art* layer; all real copy is the crisp HTML overlay.
221- No human faces (unless the brand explicitly wants them); no clipped mascot/hero prop.
222- Each format is laid out correctly for its own canvas — no letterbox bands, no off-center text.
223
224Regenerate only the pieces that fail, one at a time. Do not re-run the whole batch to fix one.
225
226## 6. Ship + record
227
228Deliver the kit + the per-format renders. If this is a meirlabs client/campaign, surface the
229deliverable where the owner operates (per the project's deliverable rule — a browsable
230admin/gallery view, not a loose folder), and note the model + observed per-image cost so the
231spend is honest.
232