Ad Designer
Generate marketing ad images from campaign-planner creative briefs. Wrap nano-banana-pro with brand-aware prompt construction, aspect ratio handling, and a self-review loop that catches quality issues before marking images final.
Roles
- - Ad Designer (this skill) — sole executor
- nano-banana-pro — image generation engine (upstream dependency)
- campaign-planner — upstream source of creative briefs
- brand-bible-builder — upstream source of brand visual identity
Prerequisites
Verify before starting:
CODEBLOCK0
If uv is missing: tell the user to install it with curl -LsSf https://astral.sh/uv/install.sh | sh.
If GEMINI_API_KEY is unset: tell the user to export it from Google AI Studio.
If the script is missing: tell the user the nano-banana-pro skill must be installed first.
Step 1: Collect Inputs
Identify which inputs are present in the conversation or filesystem:
| Input | Source | Where to find it |
|---|
| Creative brief(s) | campaign-planner skill | INLINECODE3 → ad_creatives[] array, or inline in conversation |
| Brand bible |
brand-bible-builder skill |
/tmp/marketing/brands/<brand>/brand-bible.md or inline |
| Aspect ratio | User or brief | Defaults to 1:1 if not specified |
| Resolution mode | User | Defaults to draft (1K) unless user says "final" or "4K" |
If the creative brief is missing, ask:
"I need a creative brief to generate the ad. Run /campaign-planner first, or paste the brief details: headline, visual direction, CTA, and target audience."
If the brand bible is missing, proceed with neutral visual defaults — note this in the output and recommend running /brand-bible-builder for on-brand results.
Step 2: Read Brand Bible Visual Identity
Open the brand bible and extract these fields into a working reference:
- - Primary colors — hex codes or descriptors (e.g.
#1A2E5A deep navy, #F5A623 amber) - Secondary / accent colors — supporting palette
- Font style — serif vs sans-serif, weight, mood descriptor (e.g. "bold geometric sans", "light editorial serif")
- Imagery style — photography vs illustration, lifestyle vs product-only, color grading mood (warm/cool/muted/vibrant)
- Layout pattern — minimal and clean vs content-dense, whitespace-heavy vs layered
- Tone — formal, casual, bold, playful, premium, approachable
Keep this as a 6-field internal reference. Do not show it to the user. Use it when constructing prompts in Step 3.
Step 3: Construct Image Generation Prompt
Apply these rules every time. They are non-negotiable.
Core Rules (from best-practice image generation)
Rule 1 — Less is more. Short, focused prompts outperform long descriptive ones. Target 15–30 words for the visual description. Cut adjectives that repeat the same idea.
Rule 2 — No logos, brand names, or company names. Never include the brand name, product name, logo description, or any trademark in the prompt. The generation engine hallucinates these badly and they must be added in post-production.
Rule 3 — Only include text that is explicitly specified. If the brief specifies a headline to appear in the image, include it exactly as written — no paraphrasing. If no text is specified, do not add any text to the prompt. Do not include CTAs, taglines, or copy unless the brief explicitly says to render text.
Rule 4 — Describe emotion and composition, not data. Instead of "a woman saving money on her bills," write "confident woman, bright home office, warm morning light, relaxed expression." The emotion communicates the message; the model handles the rest.
Rule 5 — Translate brand colors without naming the brand. Convert hex codes to descriptors: #1A2E5A → "deep navy", #F5A623 → "warm amber". Use these color words in the prompt naturally.
Prompt Construction Formula
Assemble the prompt in this order:
CODEBLOCK1
Do not use all 8 fields every time. Use only those relevant to the brief. A 5-field prompt is often stronger than an 8-field one.
Example Construction
Brief input:
CODEBLOCK2
Brand bible: warm coral #E8735A, off-white #FAF7F2, editorial sans-serif, warm and minimal photography style.
Constructed prompt:
CODEBLOCK3
What was excluded: brand name, CTA text, product name, headline text (no text was specified for visual rendering).
Step 4: Select Aspect Ratio
Map the brief's platform or format to the correct ratio flag and pixel dimensions:
| Platform / Format | Ratio | Pixel Dimensions | Use Case |
|---|
| Instagram / Facebook Feed | 1:1 | 1080 × 1080 | Square feed post |
| Instagram Story / Reel |
9:16 | 1080 × 1920 | Full-screen vertical |
| Facebook Feed (portrait) | 4:5 | 1080 × 1350 | Taller feed post, more screen area |
| YouTube / LinkedIn Cover | 16:9 | 1920 × 1080 | Landscape / banner |
If the brief does not specify a platform, default to 1:1.
For carousel ads: generate all cards at the same ratio. Use 1:1 unless the brief specifies otherwise.
Pass the ratio to the script via --resolution. The nano-banana-pro script handles internal sizing. Generate at 1K for drafts, 4K for finals.
Step 5: Generate Images
Create the output directory:
CODEBLOCK4
Single image generation
Use this command pattern. Always use absolute path for the script.
CODEBLOCK5
Filename format: yyyy-mm-dd-hh-mm-ss-<brief-id>-draft.png
- -
brief-id: lowercase kebab-case derived from the brief headline (e.g. finally-sleep-works) - Use current date/time for timestamp
Draft-first workflow
Always follow this sequence:
- 1. Draft at 1K — generate first at 1K for fast feedback. Present to user.
- Iterate — if issues found in self-review (Step 6), adjust prompt and regenerate at 1K. Max 3 attempts.
- Final at 4K — only after user approves the draft or after self-review passes. Change filename suffix from
-draft to -final, set --resolution 4K.
Carousel ads
Generate each card as a separate image. Naming convention:
CODEBLOCK6
Ensure visual consistency across cards:
- - Use the same color palette descriptor in every card's prompt
- Use the same style descriptor in every card's prompt
- Use the same lighting descriptor in every card's prompt
- Vary only the subject and composition per card
Step 6: Self-Review Loop (CRITICAL)
After generating each image, perform a structured self-review before presenting to the user. Do not skip this step.
Run through this checklist for every generated image:
| Check | Pass Condition | Fail Action |
|---|
| Text accuracy | Any specified text appears correctly and is readable | Simplify prompt; add explicit text instruction |
| No hallucinated logos |
No brand marks, wordmarks, icons, or watermarks visible | Add "no logos, no text, no watermarks" to avoid clause |
| No hallucinated brand names | No company names or product names rendered as text | Add "no brand names, no product names" to avoid clause |
| Aspect ratio | Matches requested format | Re-run with correct ratio flag |
| Color alignment | Dominant colors match brand palette intent | Strengthen color descriptors in prompt |
| Overall quality | Image is coherent, professional, on-brief | Rebuild prompt from scratch using simpler structure |
Fail response
If any check fails:
- 1. Identify the specific failure from the table above.
- Apply the corresponding fail action to the prompt.
- Regenerate at 1K.
- Re-run the self-review checklist on the new image.
- Stop after 3 total attempts. If still failing on attempt 3, present the best result to the user with a note explaining what the issue is and what was tried.
Do not present a failing image silently. Always tell the user what was wrong and what fix was applied.
Step 7: HITL — Present for User Review
After self-review passes (or after 3 attempts), present the results:
CODEBLOCK7
Wait for the user's response before generating the 4K final or moving to the next brief.
If the user says "adjust" or describes changes:
- - Apply the change to the prompt (keep changes minimal — one diff at a time)
- Regenerate at 1K
- Re-run self-review
- Present again
If the user approves:
- - Regenerate at 4K with
-final filename suffix - Confirm: "Final saved:
/tmp/marketing/assets/images/[filename]-final.png"
Step 8: Process Multiple Briefs
If the input contains multiple briefs (e.g. from a campaign-planner JSON with 3–5 image ad entries), process them sequentially. Complete the full cycle (generate → self-review → HITL approval → final) for each brief before moving to the next.
After all briefs are processed, present a summary:
CODEBLOCK8
Error Handling
| Error | Action |
|---|
| INLINECODE23 | Tell user to run export GEMINI_API_KEY=<key> and retry |
| INLINECODE25 |
Verify the
--input-image path exists; fix path and retry |
|
quota / 403 / permission API error | Wrong key or quota exceeded; ask user to check Google AI Studio quota |
| Script not found at
~/.codex/skills/... | nano-banana-pro skill is not installed; tell user to install it from ClawHub |
|
uv: command not found | Run
curl -LsSf https://astral.sh/uv/install.sh | sh then retry |
| Image generation returns blank/empty | Prompt may be too restrictive; remove avoid clauses and simplify to subject + style only |
File Paths Reference
CODEBLOCK9
广告设计师
根据营销活动策划师的创意简报生成营销广告图片。将nano-banana-pro与品牌感知提示构建、宽高比处理以及自我审查循环相结合,在将图片标记为最终版本前捕捉质量问题。
角色
- - 广告设计师(本技能)— 唯一执行者
- nano-banana-pro — 图片生成引擎(上游依赖)
- campaign-planner — 创意简报的上游来源
- brand-bible-builder — 品牌视觉识别的上游来源
前置条件
开始前请验证:
bash
command -v uv
test -n $GEMINIAPIKEY
test -f ~/.codex/skills/nano-banana-pro/scripts/generate_image.py
如果缺少 uv:告知用户使用 curl -LsSf https://astral.sh/uv/install.sh | sh 安装。
如果未设置 GEMINIAPIKEY:告知用户从 Google AI Studio 导出。
如果脚本缺失:告知用户必须先安装 nano-banana-pro 技能。
步骤 1:收集输入
识别对话或文件系统中存在的输入:
| 输入 | 来源 | 查找位置 |
|---|
| 创意简报 | campaign-planner 技能 | /tmp/marketing/campaigns/<品牌>-campaign-plan.json → ad_creatives[] 数组,或对话中的内联内容 |
| 品牌圣经 |
brand-bible-builder 技能 | /tmp/marketing/brands/<品牌>/brand-bible.md 或内联内容 |
| 宽高比 | 用户或简报 | 如未指定,默认为 1:1 |
| 分辨率模式 | 用户 | 默认为草稿(1K),除非用户指定最终或4K |
如果缺少创意简报,请询问:
我需要一份创意简报来生成广告。请先运行 /campaign-planner,或粘贴简报详情:标题、视觉方向、行动号召和目标受众。
如果缺少品牌圣经,则使用中性视觉默认值继续 — 在输出中注明这一点,并建议运行 /brand-bible-builder 以获得符合品牌形象的结果。
步骤 2:读取品牌圣经视觉识别
打开品牌圣经并将以下字段提取到工作参考中:
- - 主色 — 十六进制代码或描述(例如 #1A2E5A 深海军蓝、#F5A623 琥珀色)
- 次要/强调色 — 辅助调色板
- 字体风格 — 衬线体 vs 无衬线体、字重、情绪描述(例如粗体几何无衬线体、轻盈编辑衬线体)
- 图像风格 — 摄影 vs 插画、生活方式 vs 仅产品、色彩分级情绪(暖/冷/柔和/鲜艳)
- 布局模式 — 极简干净 vs 内容密集、大量留白 vs 层次丰富
- 语调 — 正式、休闲、大胆、俏皮、高端、平易近人
将其作为 6 字段内部参考保留。不要向用户展示。在步骤 3 中构建提示时使用。
步骤 3:构建图片生成提示
每次应用以下规则。这些规则不可协商。
核心规则(来自最佳实践图片生成)
规则 1 — 少即是多。 简短、聚焦的提示优于冗长的描述性提示。视觉描述目标为 15–30 个词。删除重复相同概念的形容词。
规则 2 — 无标志、品牌名称或公司名称。 切勿在提示中包含品牌名称、产品名称、标志描述或任何商标。生成引擎会严重产生幻觉,这些必须在后期制作中添加。
规则 3 — 仅包含明确指定的文本。 如果简报指定了要在图片中显示的标题,请完全按原样包含 — 不要改写。如果未指定文本,则不要在提示中添加任何文本。除非简报明确说明要渲染文本,否则不要包含行动号召、标语或文案。
规则 4 — 描述情感和构图,而非数据。 不要写一个在账单上省钱的女性,而写自信的女性,明亮的家庭办公室,温暖的晨光,放松的表情。情感传达信息;模型处理其余部分。
规则 5 — 在不提及品牌的情况下翻译品牌颜色。 将十六进制代码转换为描述符:#1A2E5A → 深海军蓝,#F5A623 → 暖琥珀色。在提示中自然地使用这些颜色词。
提示构建公式
按此顺序组装提示:
[主体] — 谁或什么是焦点元素
[场景] — 环境或背景上下文
[氛围/情感] — 图片应唤起的感觉
[构图] — 取景、拍摄类型、视角
[光线] — 光线的质量和方向
[调色板] — 从品牌圣经中提取的 2–3 种颜色
[风格] — 来自品牌圣经的摄影/插画风格
[避免] — 明确排除项(文本、标志、杂乱等)
不要每次都使用全部 8 个字段。仅使用与简报相关的字段。5 字段提示通常比 8 字段提示更强。
示例构建
简报输入:
headline: 终于,有效的睡眠
visual_direction: 女性神清气爽地醒来,自然光卧室
cta: 今晚免费试用
target_persona: Aisha,28岁,吉隆坡,压力大的职场人士
品牌圣经:暖珊瑚色 #E8735A、米白色 #FAF7F2、编辑无衬线体、温暖极简摄影风格。
构建的提示:
年轻女性平静地醒来,阳光充足的极简卧室,亚麻纹理,
暖珊瑚色和米白色调,透过薄纱窗帘的柔和晨光,
放松表情的特写,温暖编辑摄影风格
排除的内容:品牌名称、行动号召文本、产品名称、标题文本(未指定视觉渲染的文本)。
步骤 4:选择宽高比
将简报的平台或格式映射到正确的比例标志和像素尺寸:
| 平台 / 格式 | 比例 | 像素尺寸 | 使用场景 |
|---|
| Instagram / Facebook 信息流 | 1:1 | 1080 × 1080 | 方形信息流帖子 |
| Instagram 故事 / Reel |
9:16 | 1080 × 1920 | 全屏竖屏 |
| Facebook 信息流(竖屏) | 4:5 | 1080 × 1350 | 更高的信息流帖子,更多屏幕区域 |
| YouTube / LinkedIn 封面 | 16:9 | 1920 × 1080 | 横屏 / 横幅 |
如果简报未指定平台,默认为 1:1。
对于轮播广告:以相同比例生成所有卡片。除非简报另有指定,否则使用 1:1。
通过 --resolution 将比例传递给脚本。nano-banana-pro 脚本处理内部尺寸调整。草稿以 1K 生成,最终版以 4K 生成。
步骤 5:生成图片
创建输出目录:
bash
mkdir -p /tmp/marketing/assets/images
单张图片生成
使用此命令模式。始终使用脚本的绝对路径。
bash
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py \
--prompt <构建的提示> \
--filename /tmp/marketing/assets/images/<时间戳>-<简报ID>-draft.png \
--resolution 1K
文件名格式:yyyy-mm-dd-hh-mm-ss-<简报ID>-draft.png
- - 简报ID:从简报标题派生的小写短横线命名(例如 finally-sleep-works)
- 使用当前日期/时间作为时间戳
草稿优先工作流
始终遵循此顺序:
- 1. 以 1K 生成草稿 — 首先以 1K 生成以获得快速反馈。呈现给用户。
- 迭代 — 如果在自我审查中发现问题(步骤 6),调整提示并以 1K 重新生成。最多尝试 3 次。
- 以 4K 生成最终版 — 仅在用户批准草稿或自我审查通过后。将文件名后缀从 -draft 更改为 -final,设置 --resolution 4K。
轮播广告
将每张卡片生成为单独的图片。命名约定:
yyyy-mm-dd-hh-mm-ss-<简报ID>-card-01-draft.png
yyyy-mm-dd-hh-mm-ss-<简报ID>-card-02-draft.png
确保卡片之间的视觉一致性:
- - 在每张卡片的提示中使用相同的调色板描述符
- 在每张卡片的提示中使用相同的风格描述符
- 在每张卡片的提示中使用相同的光线描述符
- 每张卡片仅变化主体和构图
##