ads-generate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ads Generate: AI Ad Image Generator

广告生成:AI广告图像生成器

Generates platform-sized ad creative images from your campaign brief and brand profile. Uses banana-claude as the image generation provider.
根据你的活动brief和品牌资料生成适配平台尺寸的广告创意图片。使用banana-claude作为图像生成服务提供商。

Quick Reference

快速参考

CommandWhat it does
/ads generate
Generate all images from campaign-brief.md
/ads generate --platform meta
Generate Meta assets only
/ads generate --prompt "text" --ratio 9:16
Standalone generation without brief
命令功能
/ads generate
从campaign-brief.md生成所有图片
/ads generate --platform meta
仅生成Meta平台素材
/ads generate --prompt "text" --ratio 9:16
无需brief的独立生成模式

Environment Setup

环境配置

Required before running:
  • Requires banana-claude (v1.4.1+) with nanobanana-mcp configured
  • Run
    /banana setup
    to configure API key and MCP
  • Fallback: if banana is not available, use
    scripts/generate_image.py
    (deprecated)
If banana-claude is not installed, this skill will display setup instructions and stop. It will never fail silently.
运行前必备条件:
  • 需要安装配置了nanobanana-mcp的banana-claude(v1.4.1及以上版本)
  • 运行
    /banana setup
    配置API密钥和MCP
  • 备选方案:如果无法使用banana,可使用
    scripts/generate_image.py
    (已废弃)
如果未安装banana-claude,该技能会展示配置指引并终止运行,不会无提示静默失败。

Process

运行流程

Step 1: Verify banana-claude

步骤1:验证banana-claude

Verify banana-claude is installed (run
/banana setup
to check). If not installed, display setup instructions and exit.
验证banana-claude是否已安装(可运行
/banana setup
检查)。如果未安装,展示配置指引并退出。

Step 2: Locate Source Files

步骤2:定位源文件

Check for:
  • campaign-brief.md
    → primary source for prompts and dimensions
  • brand-profile.json
    → brand color/style injection (optional but recommended)
If campaign-brief.md is found: Use
## Image Generation Briefs
section as the generation job list.
If no campaign-brief.md: Enter standalone mode (Step 2b).
检查以下文件:
  • campaign-brief.md
    → 提示词和尺寸的主要来源
  • brand-profile.json
    → 品牌颜色/风格注入(可选但推荐提供)
如果找到campaign-brief.md:使用
## Image Generation Briefs
章节作为生成任务列表。
如果未找到campaign-brief.md:进入独立生成模式(步骤2b)。

Step 2b: Standalone Mode

步骤2b:独立生成模式

Ask the user:
  1. Generation prompt (what should the image show?)
  2. Target platform (to set correct dimensions)
  3. Output filename (optional)
Then skip to Step 5.
询问用户以下信息:
  1. 生成提示词(图片需要展示什么内容?)
  2. 目标平台(用于设置正确的尺寸)
  3. 输出文件名(可选)
之后直接跳转至步骤5。

Step 3: Read Provider Config

步骤3:读取服务提供商配置

Load
~/.claude/skills/ads/references/image-providers.md
to confirm:
  • Active provider pricing (show user the cost estimate)
  • Rate limits for current tier
  • Batch API availability
加载
~/.claude/skills/ads/references/image-providers.md
确认以下信息:
  • 活跃服务商定价(向用户展示成本估算)
  • 当前档位的速率限制
  • 批量API可用性

Step 4: Read Platform Specs

步骤4:读取平台规范

For each platform in the campaign brief, load the relevant spec reference:
  • ~/.claude/skills/ads/references/meta-creative-specs.md
  • ~/.claude/skills/ads/references/google-creative-specs.md
  • ~/.claude/skills/ads/references/tiktok-creative-specs.md
  • ~/.claude/skills/ads/references/linkedin-creative-specs.md
  • ~/.claude/skills/ads/references/youtube-creative-specs.md
  • ~/.claude/skills/ads/references/microsoft-creative-specs.md
针对活动brief中的每个平台,加载对应的规范参考文件:
  • ~/.claude/skills/ads/references/meta-creative-specs.md
  • ~/.claude/skills/ads/references/google-creative-specs.md
  • ~/.claude/skills/ads/references/tiktok-creative-specs.md
  • ~/.claude/skills/ads/references/linkedin-creative-specs.md
  • ~/.claude/skills/ads/references/youtube-creative-specs.md
  • ~/.claude/skills/ads/references/microsoft-creative-specs.md

Step 5: Prepare banana Configuration

步骤5:准备banana配置

Create banana brand preset from brand-profile.json if one does not already exist at
~/.banana/presets/{brand-slug}.json
.
Select banana domain mode based on campaign brief content:
  • Product: e-commerce, packshots
  • Editorial: brand awareness, lifestyle
  • Cinema: video thumbnails, dramatic
  • UI/Web: app install, SaaS
  • Portrait: testimonials, people
如果
~/.banana/presets/{brand-slug}.json
路径下不存在对应的品牌预设,就根据brand-profile.json创建banana品牌预设。
根据活动brief内容选择banana领域模式:
  • Product:电商、产品展示图
  • Editorial:品牌曝光、生活方式
  • Cinema:视频缩略图、戏剧化风格
  • UI/Web:应用安装、SaaS
  • Portrait:用户评价、人物类素材

Step 6: Spawn Visual Designer Agent

步骤6:启动视觉设计师Agent

Spawn the
visual-designer
agent using the Task tool with
context: fork
, passing the selected domain mode and preset name.
The agent will:
  • Parse the image generation briefs from campaign-brief.md
  • Inject brand colors and mood from brand-profile.json
  • Use banana-claude with the configured domain mode for each asset
  • Save to
    ./ad-assets/[platform]/[concept]/
    directory structure
  • Write
    generation-manifest.json
使用Task工具以
context: fork
模式启动
visual-designer
Agent,传入选择的领域模式和预设名称。
该Agent将执行以下操作:
  • 解析campaign-brief.md中的图像生成brief
  • 注入brand-profile.json中的品牌颜色和风格基调
  • 对每个素材使用配置好对应领域模式的banana-claude生成
  • 保存到
    ./ad-assets/[platform]/[concept]/
    目录结构下
  • 写入
    generation-manifest.json
    文件

Step 7: Validate with Format Adapter

步骤7:格式适配器验证

After the visual-designer completes, spawn the
format-adapter
agent with
context: fork
to validate dimensions and report missing formats.
视觉设计师Agent完成任务后,以
context: fork
模式启动
format-adapter
Agent,验证素材尺寸并报告缺失的格式。

Step 8: Quality Gate

步骤8:质量校验

Use Claude vision to assess each generated image against the brief (score 1 to 10 on brand alignment, composition, platform fit). If any image scores below 6, regenerate once with an adjusted prompt.
使用Claude视觉能力将每张生成的图片与brief要求进行对比评估(从品牌匹配度、构图、平台适配性三个维度按1-10分打分)。如果任意图片得分低于6分,使用调整后的提示词重新生成一次。

Step 9: Aggregate Costs

步骤9:汇总成本

Read banana cost data from
~/.banana/costs.json
and include total creative spend in generation-manifest.json.
~/.banana/costs.json
读取banana费用数据,将创意生成总支出计入generation-manifest.json。

Step 10: Report Results

步骤10:结果报告

Present a summary:
Generation complete:

  Generated assets:
    ✓ ./ad-assets/meta/concept-1/feed-1080x1350.png
    ✓ ./ad-assets/tiktok/concept-1/vertical-1080x1920.png
    ✗ ./ad-assets/google/concept-1/landscape-1200x628.png [error reason]

  Format validation: See format-report.md

  Cost: $[N] total creative spend (from ~/.banana/costs.json)

  Next steps:
    1. Review assets in ./ad-assets/
    2. Check format-report.md for any missing formats
    3. Upload to your ad platform managers
展示生成总结:
生成完成:

  已生成素材:
    ✓ ./ad-assets/meta/concept-1/feed-1080x1350.png
    ✓ ./ad-assets/tiktok/concept-1/vertical-1080x1920.png
    ✗ ./ad-assets/google/concept-1/landscape-1200x628.png [错误原因]

  格式验证:详见format-report.md

  成本:总创意支出$[N](数据来自~/.banana/costs.json)

  后续步骤:
    1. 查看./ad-assets/目录下的素材
    2. 检查format-report.md确认是否有缺失格式
    3. 上传到你的广告平台管理后台

Cost Transparency

成本透明化

Before generating, estimate and show the cost:
  • Count the number of image briefs in campaign-brief.md
  • Show estimated cost based on banana pricing tiers
  • If >$1.00, ask for confirmation before proceeding
生成前会估算并展示费用:
  • 统计campaign-brief.md中的图像生成brief数量
  • 根据banana定价档位展示预估成本
  • 如果预估成本超过1美元,生成前会询问用户确认

Standalone Mode (No campaign-brief.md)

独立生成模式(无campaign-brief.md)

When running without a campaign brief:
Platform target → dimensions used:
  meta-feed     → 1080×1350 (4:5)
  meta-reels    → 1080×1920 (9:16)
  tiktok        → 1080×1920 (9:16)
  google-pmax   → 1200×628 (1.91:1)
  linkedin      → 1080×1080 (1:1)
  youtube       → 1280×720 (16:9)
  youtube-short → 1080×1920 (9:16)
Use
/banana generate
directly with the specified prompt and aspect ratio.
未提供活动brief时运行的规则:
目标平台 → 对应尺寸:
  meta-feed     → 1080×1350 (4:5)
  meta-reels    → 1080×1920 (9:16)
  tiktok        → 1080×1920 (9:16)
  google-pmax   → 1200×628 (1.91:1)
  linkedin      → 1080×1080 (1:1)
  youtube       → 1280×720 (16:9)
  youtube-short → 1080×1920 (9:16)
直接使用指定提示词和宽高比调用
/banana generate
生成。

Reference Files

参考文件

  • ~/.claude/skills/ads/references/image-providers.md
    : provider config, pricing, limits
  • ~/.claude/skills/ads/references/[platform]-creative-specs.md
    : per-platform specs
  • ~/.claude/skills/ads/references/brand-dna-template.md
    : brand injection schema
  • ~/.claude/skills/ads/references/image-providers.md
    :服务商配置、定价、限制
  • ~/.claude/skills/ads/references/[platform]-creative-specs.md
    :各平台素材规范
  • ~/.claude/skills/ads/references/brand-dna-template.md
    :品牌注入配置Schema