Skip to content
How I use AI

Ad creative generator

The Claude skill I use to make Cactus's posts and ad images: it researches, writes the prompt, generates with Nano Banana 2, reviews the image and hands it over with the logo on and the caption written. Here's how it's built inside so you can make your own.

9 min read · Claude · Nano Banana 2

01

Why a skill and not a one-off prompt

At first I made the images by asking Nano Banana directly. They looked nice and were almost never usable. Typos in the headline, the same phone in the middle of every design, shadows and bevels on the letters, colors that weren't the brand's, a “1/6” in a corner because the model had seen plenty of carousels. Every post took several attempts and touch-ups.

All those mistakes kept repeating, which meant I could write them down. A Claude skill is exactly that: a folder with instructions, scripts and files that Claude loads when the request matches its description. I put the brand, the rules, how to write prompts and the final review in there. Now I give it the topic and get the finished post back.

02

What you'll need

  • Claude SkillsWhere everything lives. They work in the Claude app and in Claude Code. Claude needs to be able to run code to launch the scripts.
  • Nano Banana 2The model that makes the images. It's Gemini's image model.
  • Gemini APITo call Nano Banana from a script. The key is created in Google AI Studio and the project needs billing turned on: on the free tier the image quota is zero.
  • PythonThe skill's two scripts. They use requests for the API and Pillow to place the logo.
  • InstagramThe destination. Formats are 4:5 for feed posts and carousels and 9:16 for stories.

You'll also need your logo as a PNG with a transparent background, in at least two versions: one for light backgrounds and one for dark.

03

What's inside the folder

Skill structure
cactus-ig-posts/
├── SKILL.md              ← la marca, el flujo de trabajo y las reglas
├── config.json           ← la API key de Gemini (no sale de tu ordenador)
├── references/
│   └── design-system.md  ← patrones sacados de las cuentas de referencia
├── scripts/
│   ├── generate.py       ← llama a Nano Banana 2
│   └── add_logo.py       ← pega el logo y elige versión según el fondo
└── assets/
    ├── logo_verde.png
    ├── logo_white.png
    └── logo.svg

The file in charge is SKILL.md. It starts with a name and a description. Claude reads that description to decide when to use the skill, so it has to say plainly when it applies. Mine says to use it whenever I ask for a post, carousel, story or image for Cactus's Instagram, even if I don't name it. It's in Spanish, like everything I make for Cactus:

SKILL.md (header)
---
name: "cactus-ig-posts"
description: "Generador de posts de Instagram para Cactus Marketing con Nano Banana 2 (Gemini). Úsala SIEMPRE que Nacho pida un post, carrusel, story, portada, diseño o imagen para Instagram de Cactus, aunque no nombre la skill."
---

# Generador de posts de Instagram · Cactus Marketing

Nacho te da una idea o tema. Tú haces de director de arte y copywriter:
investigas, diseñas el prompt, generas con Nano Banana 2, revisas el
resultado como un diseñador exigente, pegas el logo y entregas imagen(es)
+ caption.

Below that come the brand, the step-by-step workflow and the rules. The scripts and references sit in separate files so SKILL.md doesn't go on forever. Claude opens them when it needs them.

04

How to install it

A skill is a folder, and there are two ways to install it depending on where you'll use it. The steps below are in Spanish; in the English app, look for Settings → Capabilities → Skills:

Installing the skill
1. Crea la carpeta de la skill con SKILL.md dentro (más scripts y assets).
2. Comprímela en un .zip con la carpeta en la raíz del zip.
3. En la app de Claude: Ajustes → Capacidades → Skills → Subir skill.
   En Claude Code: copia la carpeta en .claude/skills/ del proyecto
   o en ~/.claude/skills/ para tenerla en todos.
4. Pide algo que encaje con la descripción («hazme un post sobre…»)
   y comprueba que Claude dice que está usando la skill.

05

The brand, written for a machine

An agency's brand book is written for people. An image model needs something else: colors in HEX, rules that can be either followed or broken, and the typeface described in words, because Nano Banana can't load a font.

SKILL.md (brand)
## Marca

- Paleta principal: verde Cactus #2D5C4B, verde bosque oscuro #12291F,
  blanco #FFFFFF y negro casi puro para texto.
- Fondos: portadas de carrusel, posts únicos y stories SIEMPRE en blanco.
  El verde, solo en slides interiores de carruseles, y no en todas.
- Tipografía: Nano Banana no carga fuentes. Descríbela siempre como
  "extra-bold geometric sans-serif, tight letter-spacing, compact line
  height, similar to Objektiv Mk1 XBold".
- Texto y botones siempre planos: sin bisel, relieve, extrusión 3D,
  sombra, brillo ni degradado. Solo el objeto protagonista puede ir en 3D.
- Protagonista visual: objetos y mockups, nunca personas salvo que se pida.

## Variedad del protagonista

El móvil NO es el protagonista por defecto. Úsalo solo cuando el tema lo
pida de verdad y, como mucho, en 1 de cada 3 diseños. Alternativas:
símbolo 3D de la plataforma, gráfica o flecha 3D, monedas, hucha, lupa,
embudo, diana, cohete, reloj de arena, megáfono, imán, candado, bombilla,
portátil, el producto del cliente o la tipografía sola.

The phone rule deserves an explanation. Say nothing, and in a post about ads the model puts a huge phone in the middle, every time. On one design that's fine. Ten posts in a row on the feed with the same phone look terrible. So the skill limits it to one design in three, gives it a list of alternatives and makes it switch object if the previous post already had one.

Same with 3D lettering. Without the flat-text rule, the headline often comes out embossed and shadowed. That's the model's default when you ask for something “premium”.

06

A design system built from references

I saved posts from accounts whose design I like and wrote down what they all had in common. I didn't copy any post. What I wanted was the visual language, and it ended up in references/design-system.md. These are the principles that came out of it:

  • One huge hero object, 40 % to 60 % of the canvas, often running off an edge.
  • A clean background: white, or with a very faint paper or grid texture.
  • One or two giant words and everything else much smaller, with the lines nearly touching.
  • Mixed weights in the same headline: regular words in light and the key word in extra bold.
  • A single emphasis device per headline: a colored pill behind a word, a hand-drawn circle or a thick underline.
  • Hand-drawn touches: curved arrows, small notes, numbered circles.
  • Plenty of space. When in doubt, take things out.

From that I defined six layout templates. The most versatile is headline on top, object below running off the edge. The others cover stacked type with an object slotted between the letters, a dark background with a glowing symbol (inner slides only), a colored semicircle behind the object, mockups with numbered notes and side-by-side comparisons. The skill picks one for each request.

07

What happens when I ask for a post

This is the flow Claude follows, as written in the skill:

  1. Understands the request and picks the format. Educational topic, a five to seven slide carousel. A message or a single figure, a single post. It only asks if the topic is ambiguous.
  2. Reads the design system and runs one or two searches on this year's Instagram design trends. If the topic is news, like a Meta Ads change, it looks that up too so it doesn't say anything wrong.
  3. Writes the on-image copy: a seven or eight word headline with a hook, one highlighted word and, if needed, a subtitle of ten words at most. On inner slides, about 25 words at most.
  4. Writes the Nano Banana prompt.
  5. Generates the image.
  6. Reviews it the way an art director would, and if something's off, fixes the prompt and regenerates.
  7. Places the logo.
  8. Writes the caption and the alt text.

Keeping the copy short isn't about looks. Every word you ask Nano Banana to write is another chance for it to get a letter wrong. Less text, fewer typos.

08

The image prompt

It's written in English, because the model does better that way, and the text that has to appear in the image goes in Spanish, in quotes, with orders to copy it exactly, accents included. This is the template:

Prompt template
Instagram [carousel cover | post | story] design, [4:5 vertical | 9:16 vertical],
professional social media graphic for a performance marketing agency.

COMPOSITION: [plantilla elegida: posición del titular, del protagonista,
qué sangra por qué borde, dónde va la flecha].
BACKGROUND: clean white #FFFFFF or white with very subtle light-grey grid paper,
minimal, lots of negative space.
HERO OBJECT: [objeto concreto, material, iluminación, ángulo], large, occupying
~50% of the canvas, cut-out with soft contact shadow, bleeding off the bottom
edge. No smartphone, no phone mockup.
TYPOGRAPHY: extra-bold geometric sans-serif, tight letter-spacing, compact line
height, similar to Objektiv Mk1 XBold, completely flat. Render this text EXACTLY,
with correct Spanish accents, nothing else:
  - Headline: "…" (huge, near-black)
  - Emphasis: the word "…" inside a rounded #2D5C4B pill with white text
  - Subtitle: "…" (small, dark grey)
DETAILS: [flechas a mano, círculos numerados, anotaciones, botón →].
COLOR PALETTE: only #2D5C4B, #12291F, white and near-black.
Keep the bottom-center area (about 20% width x 8% height) completely empty for a
logo. No logo, no watermark, no extra text, no Instagram UI, no username, no
slide counter or page number (like "1/6") anywhere.
Style: premium, modern social media design, crisp, high contrast, editorial.
FLAT TYPE RULE (very important): all text and all pills/buttons must be
completely FLAT 2D vector graphics: solid color fills only, no 3D extrusion, no
bevel, no emboss, no drop shadow, no glow, no gradient. Only the hero object may
be 3D.

Some lines look over the top, and every one is there for a reason. “No slide counter” is there because the model kept inventing page numbers. “Keep the bottom-center area empty” leaves room for the logo, which a script adds later: ask Nano Banana to draw it and it distorts it. The flat-text rule is in capitals and marked as very important so it doesn't get skipped.

09

One prompt from start to finish

Here's the template filled in for a carousel cover about the first seconds of a video ad. The headline means “Your ad lives or dies in 3 seconds”:

Carousel cover
Instagram carousel cover design, 4:5 vertical, professional social media
graphic for a performance marketing agency.

COMPOSITION: huge stacked headline in the upper half, left-aligned. Hero object
in the lower half, slightly right of centre, bleeding off the bottom edge. A
small round button with an arrow → in the bottom-right corner.
BACKGROUND: clean white #FFFFFF with very subtle light-grey grid paper, minimal,
lots of negative space.
HERO OBJECT: a 3D glass hourglass with dark green sand (#2D5C4B), studio
lighting from the top left, three-quarter view, large, occupying ~45% of the
canvas, soft contact shadow. No smartphone, no phone mockup.
TYPOGRAPHY: extra-bold geometric sans-serif, tight letter-spacing, compact line
height, similar to Objektiv Mk1 XBold, completely flat. Render this text EXACTLY,
with correct Spanish accents, nothing else:
  - Headline: "Tu anuncio se juega todo en 3 segundos" (huge, near-black)
  - Emphasis: the word "3 segundos" inside a rounded #2D5C4B pill with white text
DETAILS: a hand-drawn curved arrow from the headline to the hourglass.
COLOR PALETTE: only #2D5C4B, #12291F, white and near-black.
Keep the bottom-center area (about 20% width x 8% height) completely empty for a
logo. No logo, no watermark, no extra text, no Instagram UI, no username, no
slide counter or page number anywhere.
FLAT TYPE RULE (very important): all text and all pills/buttons must be
completely FLAT 2D vector graphics. Only the hero object may be 3D.

Look at the decisions inside it. The object is an hourglass, not a phone, because the topic is time. The highlighted words are “3 segundos”, the figure that has to stick. The headline is eight words, the maximum. The hand-drawn arrow links the text to the object so the eye travels from one to the other.

10

The script that generates

generate.py calls the Gemini API with the prompt, the format and any reference images. It has three models: the standard one for final pieces, a lite one for quick drafts and Pro for text-heavy designs or when the standard one botches the lettering twice.

scripts/generate.py (excerpt)
API = "https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent"

# Se prueban en orden: primero el ID estable, luego el preview.
MODELS = {
    "nb2": ["gemini-3.1-flash-image", "gemini-3.1-flash-image-preview"],
    "lite": ["gemini-3.1-flash-lite-image"],
    "pro": ["gemini-3-pro-image", "gemini-3-pro-image-preview"],
}

parts = [img_part(r) for r in args.ref] + [{"text": prompt}]
body = {
    "contents": [{"role": "user", "parts": parts}],
    "generationConfig": {
        "responseModalities": ["TEXT", "IMAGE"],
        "imageConfig": {"aspectRatio": args.aspect, "imageSize": args.size},
    },
}

for model in MODELS[args.model]:
    for attempt in range(3):
        r = requests.post(API.format(model=model), headers=headers, json=body, timeout=180)
        if r.status_code == 404:
            break  # ese ID no existe, pruebo el siguiente
        if r.status_code == 429 and "free_tier" in r.text and "limit: 0" in r.text:
            sys.exit("La clave funciona, pero el proyecto está en el nivel gratuito "
                     "(cuota 0 para imágenes). Activa la facturación en AI Studio.")
        if r.status_code in (429, 500, 503):
            time.sleep(5 * (attempt + 1))
            continue
        # ...guardar la imagen que viene en inlineData

Each model has two names, the stable one and the preview one, and the script tries them in turn. That way it doesn't break when Google renames things. The free-tier quota error has its own message because it's the most confusing one: the key works and no image ever comes out.

For Instagram pieces I generate at 1K. Instagram shows images at 1080 pixels wide, so more resolution only costs more.

Usage
# Portada
python generate.py --prompt-file p1.txt --aspect 4:5 --out raw_1.png

# Resto del carrusel, con la portada como referencia de estilo
python generate.py --prompt-file p2.txt --aspect 4:5 --ref raw_1.png --out raw_2.png

# Logo
python add_logo.py --in raw_1.png --out cactus_tema_01.png --pos bottom-center

11

The review

This is the step that makes the biggest difference. Claude opens the generated image and goes through this list before showing it to me:

  • Exact spelling and accents. No invented letters, no extra words.
  • Clear hierarchy, a big hero object and space around it.
  • The logo area clear and no slide counter.
  • Flat text and buttons, with no shadow or bevel.
  • Colors within the palette and the right background: white on covers, posts and stories.
  • If a phone showed up for no reason, regenerate with a different object.
  • The last one: if I were scrolling the feed, would I stop here?

If something fails, it fixes the prompt in a specific way. Sending the same prompt again doesn't help. It gets two retries per image, and if the text keeps coming out wrong it switches to the Pro model. The rule is that it never hands me an image with a typo.

13

The caption

Instagram works more and more like a search engine, so the caption is written to be found:

  • The first line has the keyword the way someone would search it, for example “Meta Ads for ecommerce”.
  • 80 to 200 words, short sentences, line breaks and something people can actually apply.
  • The keyword appears once or twice more, alongside two or three secondary ones.
  • It ends with a clear call to action: save, share, comment a word or send a DM.
  • No hashtags.

Separately, it writes one or two sentences of alt text with the keyword to paste into the post's advanced settings. Instagram reads that too. Both texts come back in separate blocks so I can copy them with one tap on my phone.

Want something like this in your business?

Email me and let's talk.

Email me