Turn user content into ready-to-publish 3:4 Xiaohongshu infographics. By default, use Codex's built-in image_gen, do not probe external backends, do not ask for an API Key, and do not call third-party image generation scripts.
The visual goal is not to replicate a specific reference image, but to stably reuse an independent "light AI product infographic" system: strong headlines, card-based structure, linear tech icons, purple-blue and lime green accents, and white breathing room.
First read
Must read before execution:
references/visual-system.md: fixed visual language, colors, font hierarchy, components, and prompt locks.references/page-patterns.md: page structures such as cover, process, comparison, checklist, breakdown, and summary.
Scope of application
Suitable for:
- AI, efficiency, product, finance, workplace, tutorials, SOP, and methodology content.
- One cover, a single knowledge graphic, or a continuous series of 6–9 images.
- The user provides a reference image and wants to borrow its information hierarchy, color relationships, and component language.
- The user wants to get bitmap images directly and does not need HTML.
Not suitable for:
- Requires 100% editable text and pixel-by-pixel revisions: switch to
xhs-html。 - Needs native editable formats such as SVG, HTML, or PPT.
- Only writes body text, titles, or topic selection.
- Automatic publishing and batch matrix account production.
Default delivery
- Ratio: vertical 3:4, finally saved as 1080×1440 PNG.
- Quantity:
- When the user explicitly says "single image/cover," make 1 image.
- When the user specifies a quantity, follow that quantity.
- When the user says "image series/photo-text" but does not specify a quantity, give options of 6, 7, 8, and 9 images, and recommend one.
- When the user says "just do it/you decide": short checklist 6 images, complete method 7 images, hands-on tutorial 8 images, complete SOP 9 images.
- By default, place the brand name or account name only on the first page; do not repeat it on inner pages.
- One image should carry only one central task; do not cram the entire article into one image.
- Call the built-in image generation tool once separately for each image; do not generate multiple images with different content in one call.
Workflow
1. Read the content
Read the complete content first, then split pages. Do not generate while reading.
Extract:
- Target readers: who this image series is written for.
- Core promise: what action can be completed after viewing.
- Minimum complete chain: preparation → operation → result → acceptance.
- Materials that can be taken away directly: steps, prompts, fields, templates, checklists, examples.
- Deletable content: repetitive setup, vague encouragement, synonymous repetition, patronizing lessons.
- Specific information in the original text: objects, fields, rules, steps, numbers, thresholds, output names, and human boundaries.
Before splitting pages, establish a "source basis → page copy" mapping. Specific descriptions on the page must be traceable back to the user's original text; sentences may be compressed for layout, but the original text must not be transformed into new slogans or generalized opinions.
2. Establish page order
Output a brief page plan:
## 组图规划
风格:轻盈 AI 产品信息图
数量:8 张
账号名:只在第 1 张出现
| 页码 | 页面任务 | 主标题 | 原文依据 | 结构 | 读者拿走什么 |
|---|---|---|---|---|---|
| 01 | 点击 | 财务人怎么用 Codex | 原文总主题 | 封面 | 明确主题 |
| 02 | 留人 | 完整处理链路 | 原文步骤段 | 总览 | 知道后续路径 |
| 03 | 准备 | 准备 3 份输入 | 原文准备段 | 清单 | 可照着准备 |
...
If the user asks for only one image, do not output a multi-image plan; directly distill the main title, key points, and structure of that image.
3. Control text
Image generation models can generate text, but the denser the information, the higher the probability of typos and line breaks. Use different information densities for the cover and inner pages:
Cover
- Main title: 8–18 Chinese characters, at most 2–3 lines, and may occupy a larger area.
- Subtitle: 0–28 Chinese characters.
- Keep only the theme, result, and one main visual; it does not carry the full teaching content.
Inner pages
- Main title: 6–16 Chinese characters, at most 2 lines; the visual font size is about 55%–68% of the cover title.
- Keep the title area height at 8%–14% of the page, leaving the main space for the body.
- Body: 4–6 modules; each module must have a “short title + a complete explanation of 12–28 characters” and cannot contain only noun labels.
- Each page is recommended to have 120–180 Chinese characters; an operation template page can go up to 220 characters, but it must be split into clear levels.
- Prioritize preserving the objects, fields, actions, judgment conditions, outputs, and review requirements from the user’s original text.
- All text is written verbatim into the prompt’s
Text (verbatim), and the model must not be allowed to rewrite it on its own.
If there is too much body text, split the page first; if there is too little body text, return to the original text to add specific explanations instead of filling the space with decorative icons.
4. Copy sentence patterns
Inner pages should mainly use direct explanations:
- Write “After extracting from a scanned document, the amount, date, and ambiguous fields need to be checked.”
- Write “Before document generation, provide a fixed template, required fields, and metric definitions.”
- Write “Table processing outputs a standard table, summary table, and difference table.”
Restrict the following slogan-style sentence patterns:
- “Not A, but B”
- “Being able to A does not mean B”
- “Don’t A, do B”
- “Don’t rush to A; first B”
Unless it is a key expression from the user’s original text, a set of images may use it at most once. When facts can be stated directly, write the facts directly.
5. Choose a layout
Choose from references/page-patterns.md according to the content, and do not use the same structure for three consecutive pages.
Priority relationships:
- One conclusion → Hero / single viewpoint
- 3–5 steps → horizontal or vertical process
- A and B → left-right comparison
- 3–6 pieces of parallel information → list / card matrix
- Surface and essence → two-layer breakdown
- Before and after → Before / After
- A complete method → overview + step-by-step + acceptance
6. Generate images
By default, call Codex’s built-in image_gen。
New image:
- Do not pass
num_last_images_to_include。 - When there is no reference image, do not pass
referenced_image_paths。 - When the user provides reference images and asks to draw on them, the 1–3 most representative ones may be used as
referenced_image_paths; in the prompt, make it clear that they are only “visual language references” and that account names, logos, watermarks, original text, illustrations, or specific layouts must not be copied.
Series images:
- Call once per image
image_gen, generating them one by one in page order. - Each page reuses verbatim
references/visual-system.md’s Style Lock. - Only change the title, content modules, icons, and layout of that page.
- Do not use
nInstead of calling multiple times; different pages must use different prompts.
Prompts use the following structure:
Use case: infographic-diagram
Asset type: 3:4 Xiaohongshu vertical infographic, page {页码}/{总页数}
Primary request: 根据本页内容生成一张信息图,不增删、不改写给定文字
Input images: {如有,逐张说明“仅作视觉语言参考”}
Scene/backdrop: 白色到极浅薰衣草背景,大面积留白
Style/medium: {粘贴完整 Style Lock}
Composition/framing: {选中的页面结构 + 模块数量 + 位置}
Color palette: {固定色板}
Source grounding:
- 原文依据:“{对应原句或要点}”
- 允许压缩,不允许新增结论
Text (verbatim):
- 顶部标签:“{标签}”
- 主标题:“{主标题}”
- 副标题:“{副标题}”
- 模块 1:“{文字}”
- 模块 2:“{文字}”
Constraints: 3:4;文字逐字准确;简体中文;外边距充足;信息层级清晰
Avoid: 水印、Logo、AI_walker、账号仿冒、乱码、伪文字、照片感、复杂 3D、拥挤小字、厚重阴影、过度装饰
Specific visual constraints are subject to references/visual-system.md .
7. Review image by image
After each image is generated, check:
- Whether it is 3:4, and the subject is not touching the edges or cropped.
- Whether the main title can be read at a glance, and whether the purple/green emphasis falls only on keywords.
- Whether the Chinese is correct character by character, and whether the numbers and English are accurate.
- Whether the cards, linear icons, and process relationships are consistent with the content of this page.
- Whether the reference image's account name, Logo, watermark, or near copy appears.
- Whether it maintains the same color palette, corner radius, line width, shadow, and whitespace rhythm as the previous page.
- Whether the main title and main structure are still clear after shrinking to feed size.
- Whether the inner-page title is clearly smaller than the cover, and whether the body text occupies the main space of the page.
- Whether each body module has a complete explanation and can be supported by the user's original text.
- Whether reversal sentence patterns such as "not... but..." and "can... does not equal..." are overused.
Runnable:
python3 scripts/check_image.py <图片路径>
It checks aspect ratio, dimensions, light background, file size, and outputs a 260px thumbnail. After the machine check passes, the text still needs to be checked by eye.
8. Fixes
Fix only one problem at a time:
- Typo: request "only change X to Y, and keep the rest of the composition, colors, icons, and text completely unchanged."
- Too crowded: first shrink the inner-page title area; if the body text is still crowded, split the page, and do not compress module explanations into small text.
- Too empty: add back fields, steps, outputs, or acceptance requirements from the original text, and do not add vague slogans and decorations.
- Copy drifting off: return to the "original text basis → page copy" mapping, and replace it with explanations close to the original text.
- Style drifting off: repost the complete Style Lock, and specify the previous approved image as the visual consistency reference.
- Wrong aspect ratio: regenerate first; if the image is safe, it can be center-cropped to 3:4 and then scaled to 1080×1440.
When editing the most recently generated image, include only the most recent image needed to complete this edit; do not use the entire image set as input.
If the same image still has Chinese errors after two consecutive attempts:
- First shorten the text and generate once more.
- If the user requires 100% accuracy, explain the limitation and suggest using
xhs-htmlto make a text-finalized version. - Do not deliver an image with obvious typos as a finished draft.
9. Saving and delivery
Preview discussions can remain in the Codex default generation directory. When the user wants to publish, continue editing, or use it for a project, the final images must be saved to the workspace.
Default directory:
09 frames/xhs-image/{主题-slug}/
├── 01-cover.png
├── 02-overview.png
├── 03-step-1.png
├── ...
├── 08-checklist.png
└── prompts.md
Do not overwrite existing files; use -v2、-v3 version names. When delivering, list:
- The path of each final image.
- The actual number of pages and visual system used.
- The final prompt or
prompts.mdpath. - Use "Codex built-in image_gen", and do not write it as an external API.
Fixed visual principles
- White or very light lavender background, wide outer margins, and the page can breathe.
- The cover uses a bold black title as the first visual; the inner-page title is smaller, and the body information becomes the primary reading subject.
- Use a large rounded white card in the center to carry information; within the card, use a short title, complete explanatory sentences, numbering, and linear icons.
- Icons are primarily browser windows, code, processes, checklists, targets, shields, robots, and documents.
- Decorations are only used to balance the composition, not to compete with the main text.
- It can be information-rich, but must not look like a screenshot stuffed full; prioritize hierarchy first, then quantity.
- The first page can have an account name; inner pages by default do not have an account name or repeated slogans.
Originality and Safety
- Reference images only provide visual direction; do not copy their titles, copy, account names, logos, watermarks, unique illustrations, or pixel-by-pixel layouts.
- Do not impersonate other creators, do not retain
AI_walkeror any source account identifiers. - Do not generate false data, income promises, rankings, efficacy claims, or facts that were not provided.
- Do not use descriptions like “the style of a certain living designer/artist”; use only objective visual characteristics.
- Unless requested by the user, do not generate real-person portraits or brand trademarks.
File Structure
space-xhs-image/
├── SKILL.md
├── agents/openai.yaml
├── evals/evals.json
├── references/
│ ├── visual-system.md
│ └── page-patterns.md
└── scripts/check_image.py