---
name: eggapi-social-carousel
description: Create Xiaohongshu-style image posts and social carousels with EggAPI - a scroll-stopping cover with a big title, 4-8 content slides with readable text in one consistent style, plus the caption and hashtags, and YouTube or Bilibili thumbnails on request. Use when the user wants a Xiaohongshu note, Instagram or LinkedIn carousel, image post, infographic slides, social cover or video thumbnail (小红书图文、笔记封面、轮播图、图文笔记、视频封面).
---

# Social carousels

Make a complete image post: a cover that stops the scroll, content slides that read well on a phone, all in one visual style, plus the caption. Reply in the user's language. Write model prompts in English; put any text that should appear in an image in quotes, in its target language.

## EggAPI basics

This skill uses the EggAPI MCP server, usually added under the name `eggapi`: `list_models`, `generate_image`, `generate_video` and `get_task` (in Claude Code they show up as `mcp__eggapi__*`). If these tools are missing, stop and send the user to https://eggapi.ai/connect to add the server.

- **Models.** Call `list_models` once at the start. Use the model IDs this skill names when they are listed; otherwise pick the closest model with the same `generation_type`. `unit_price_usd` is the price per image, or per second of video; `unit_price_by_resolution` overrides it for a given `resolution`.
- **Local files.** The generate tools only accept public `http(s)` URLs. Upload local files first (up to 20 MB per image):

  ```bash
  curl -sS https://api.eggapi.ai/v1/uploads \
    -H "Authorization: Bearer $EGGAPI_API_KEY" \
    -F "files[]=@./photo-1.jpg" -F "files[]=@./photo-2.jpg"
  ```

  The URLs are in `data.files[].url`. If `EGGAPI_API_KEY` is empty in the shell, ask the user to export it; never ask for the key in the chat. Uploaded files can be opened by anyone who has the URL, so say so before uploading anything private.
- **Tasks are async.** `generate_image` and `generate_video` return a `task_id` at once. Submit every independent task first, then poll `get_task` for each until `done` is true: every 5-10 s for images, 10-15 s for videos (usually 1-3 min). If a generate call already returns `urls`, no polling is needed.
- **Always pass** `aspect_ratio` (the default is 16:9) and, for video, `duration` (4-15 s). Supported ratios: `1:1`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9`.
- **Edit models return one image per call.** For more variants, call again; `num_outputs` only applies to text-to-image models.
- **Output URLs work as inputs.** Pass a finished image's URL straight into the next edit or video call; no re-upload needed.
- **Save everything.** Download each output as soon as its task completes, into `eggapi-output/<project>/` under the current directory, with `curl -sSL -o <file> <url>`: some output links expire after 24 hours, and some file hosts reject other HTTP clients. Keep the extension from the URL and use descriptive file names.
- **Cost.** Show the plan with an estimated cost before generating and wait for a go-ahead, unless the user already said to go ahead. At the end, report each task's `cost` and the total.
- **Errors.** `insufficient balance`: ask the user to top up at https://eggapi.ai/dashboard. `temporarily unavailable`: switch to another model of the same type. A `failed` task: read `error`, adjust the prompt if it points at the content, and retry once.

## 1. Collect the inputs

Ask only for what is missing:

- **Topic and goal**: recommend a product, teach something, a list or ranking, a story, a brand update.
- **Audience** and **platform**.
- **Content**: the user's notes, or let you draft it.
- **Number of slides**: default a cover plus 5.
- **Style**: brand colors as hex codes, the mood (clean, playful, premium, hand-drawn), a logo, or posts the user likes as references.
- **Product photos**, if a product appears.

## 2. Write the post and confirm

| Platform | Ratio | Notes |
| --- | --- | --- |
| Xiaohongshu | 3:4 | the cover decides the click; title of 8-16 Chinese characters |
| Douyin image post | 3:4 or 9:16 | |
| Instagram carousel | 1:1, or 3:4 cropped to 4:5 on export | |
| LinkedIn carousel | 1:1 | uploaded as a PDF document |
| YouTube thumbnail | 16:9 | 1280 x 720, readable at a small size |
| Bilibili cover | 16:9 | |

Write a slide table: slide, role (cover, hook, point 1 to n, summary, call to action), the exact text on the slide, what the slide shows. Keep text short: a title of up to 8 words or 16 Chinese characters, and at most three short lines below it. Longer explanations belong in the caption.

Also write the caption (title, body, 5-10 hashtags). In China, advertising law forbids absolute terms such as 最, 第一 and 国家级 in ads, so keep them out of posts that promote a product.

Show the table, the caption and the cost (one image per slide), and wait. Users often rewrite the title here.

## 3. Cover first

The cover sets the style for every other slide. Use `resolution: "2k"` and the platform's ratio.

- Without product photos: `openai/gpt-image-2/text-to-image` (best with dense text) or `google/nano-banana-pro/text-to-image`:

  > Xiaohongshu cover image. Big bold title "{title}" in a {heavy rounded sans-serif} font, {color}, across the top half. {What the image shows}. {Style: clean pastel flat illustration / bright real photo / notebook paper collage}. High contrast, readable at thumbnail size.

- With product photos: `google/nano-banana-pro/edit` with the photos as `images`, starting the prompt with "Keep the product exactly as in the reference photos: same shape, colors, logo and label text."

For a cover, `num_outputs: 2` on a text-to-image model gives the user a choice. Get the cover approved before anything else.

## 4. Content slides

Make every slide from the approved cover so the style holds:

- `google/nano-banana-pro/edit` with the cover first in `images`, then any product photos:

  > Make the next slide of this carousel in exactly the same visual style, colors, fonts and layout grid as the first image, with new content. Title: "{title}". Text: "{line 1}", "{line 2}". Visual: {what it shows}. Do not repeat the cover's title. Small page number "{n}/{total}" in the bottom right corner.

- Text-heavy slides: `openai/gpt-image-2/edit` with the cover as its single input image and the same prompt.

Submit all content slides together, then poll.

## 5. Check

If you can view images, check every slide: each character spelled exactly as approved (models sometimes drop or garble Chinese characters), text readable on a phone, the same style across slides, no stray or duplicated text. Regenerate once with the problem named. If a slide's text still comes out wrong, regenerate it with the text area left empty and give the user the text to add in an editor such as Canva, Meitu or Xingtu.

## 6. Export and deliver

Save to `eggapi-output/<post-slug>/` as `01-cover-3x4.png`, `02-<topic>-3x4.png` and so on, plus `caption.md` with the title, body and hashtags.

If ImageMagick is installed (`magick -version`):

```bash
# Instagram portrait 4:5 from 3:4 slides
magick 0*.png -resize 1080x1350^ -gravity center -extent 1080x1350 -set filename:base "%t" "ig-%[filename:base].jpg"
# LinkedIn carousel as one PDF
magick 0*.png -resize 1080x1080^ -gravity center -extent 1080x1080 linkedin-carousel.pdf
# YouTube thumbnail
magick thumbnail.png -resize 1280x720^ -gravity center -extent 1280x720 -quality 90 thumbnail.jpg
```

Finish with the list of files, the cost of each slide and the total.
