Skip to content
Back to search

xhs-imagen

Skill for popular science image content creation on Xiaohongshu

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/nimachu--xhs-imagen/badge.svg)](/listings/nimachu--xhs-imagen)

HTML

<a href="/listings/nimachu--xhs-imagen"><img src="/api/listings/nimachu--xhs-imagen/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 202 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: xhs-imagen
  3. description: Create complete Xiaohongshu image-and-text posts from a topic, article, document, or rough idea, including research, fact checking, post copy, pagination, storyboards, a 3:4 cover, 9:16 content pages, image generation or fully local SVG-to-PNG fallback, and final quality review. Use for 小红书图文、小红书封面、知识卡片、漫画科普、文章转图片、AI/科技科普图组、逐页生图提示词, or revisions to an existing Xiaohongshu series. Prefer an available image-generation model; use the bundled local renderer only when no image-generation tool is available. Apply an SVG text patch only after the user explicitly reports incorrect or unreadable text in an image.
  4. ---
  5. # xhs-imagen
  6. Turn one topic or source article into a publication-ready Xiaohongshu post package.
  7. ## Required result
  8. Create:
  9. ```text
  10. output/<topic-slug>/
  11. ├── project.json
  12. ├── research.md
  13. ├── post.md
  14. ├── storyboard.md
  15. ├── prompts/
  16. │ ├── 00-cover.md
  17. │ ├── 01-*.md
  18. │ └── ...
  19. ├── images/
  20. │ ├── cover.png
  21. │ ├── page-01.png
  22. │ └── ...
  23. └── qa-report.md
  24. ```
  25. If the user requests only part of the package, create only that part. Never claim that images were generated when no image-generation or local SVG renderer was available.
  26. ## Fixed Xiaohongshu defaults
  27. - Create a `3:4` cover, recommended `1080 × 1440`.
  28. - Create `9:16` information pages, recommended `1080 × 1920`.
  29. - Default to one cover plus 5–8 information pages.
  30. - Use Simplified Chinese unless requested otherwise.
  31. - Explain one dominant idea per page.
  32. - Optimize titles and labels for phone reading.
  33. - Do not render page numbers or page-position markers such as `04`, `01/08`, or `PAGE 04`. Keep ordering only in filenames. Numbered steps are allowed when the numbers explain the content itself.
  34. - Default to the `alpaca-line-art` profile: pure-white background, fine black hand-drawn lines, and the bundled white alpaca creator IP.
  35. - Preserve `glasses-chibi-blue` as a selectable profile for the original glasses-wearing host, warm off-white paper, and cobalt-blue comic style.
  36. - Use `toolbox-bot-risograph` for tool ecosystems, plugins, Skills, Agents, and workflows in two-color risograph.
  37. - Use `maker-girl-editorial` for professional AI Coding, workplace, tutorial, and opinion content in modern editorial illustration.
  38. - Use `cyber-luban-woodcut` for Skill–Harness–Agent architecture and system-building topics in new-Chinese woodcut.
  39. - Use `capybara-gouache` for beginner explainers, pitfalls, reassurance, and everyday analogies in warm gouache.
  40. - Make the character perform the page's core conceptual action; never use it as corner decoration.
  41. Read [references/visual-profiles.md](references/visual-profiles.md), [references/visual-style.md](references/visual-style.md), and [references/character-consistency.md](references/character-consistency.md) before producing images.
  42. ## Workflow
  43. ### 1. Resolve the brief
  44. Determine or infer:
  45. - topic, audience, and desired outcome;
  46. - the single sentence readers should remember;
  47. - source material and whether facts may have changed;
  48. - page count and language;
  49. - selected visual profile, character, palette, and brand constraints;
  50. - whether the user wants a complete package, images, copy, or prompts.
  51. Use beginner-friendly AI/technology education as the default audience and tone when the request does not specify them.
  52. Store the choice in `project.json` as `visual_profile`. Honor an explicit user choice; otherwise use the default declared in `references/visual-profiles.json`. Use one profile for the whole series unless the user explicitly requests otherwise.
  53. When reviewing pages the user selected or rejected, distinguish explicit feedback from inferred preference. Treat only explicitly confirmed rules as durable defaults; use the final selection primarily to understand visual appeal and expression accuracy rather than infer rigid layout rules.
  54. ### 2. Research before writing
  55. Search primary and authoritative sources for current, technical, disputed, product-specific, numerical, legal, or attributed claims. Write a claim table to `research.md`. Separate sourced facts from analogies and editorial framing.
  56. Read [references/fact-checking.md](references/fact-checking.md) for detailed rules.
  57. ### 3. Build the content arc
  58. Create:
  59. - one thesis;
  60. - one useful analogy;
  61. - one misconception;
  62. - 4–7 supporting ideas;
  63. - one limitation, boundary, or human-control point;
  64. - one final takeaway.
  65. Select pages by cognitive anchors instead of distributing content evenly. Keep only moments that change what the reader understands: a core judgment, cognitive turn, comparison, bottleneck, boundary, common mistake, state change, or takeaway. Drop a page when removing it does not weaken the learning arc.
  66. For every selected page:
  67. 1. state the cognitive anchor and why it deserves a page;
  68. 2. convert the abstract concept into a physical action;
  69. 3. map that action to one ordinary low-tech object;
  70. 4. make the character perform the action so the metaphor depends on the character.
  71. Write `post.md` with a Xiaohongshu title, publishable body copy, optional source note, and relevant hashtags. Write `storyboard.md` before generating images.
  72. Read [references/content-planning.md](references/content-planning.md) when choosing pages and reducing copy. Read [references/visual-metaphors.md](references/visual-metaphors.md) before writing the storyboard or image prompts.
  73. ### 4. Create and validate the project
  74. Store exact content and page decisions in `project.json`. Start from [references/project.template.json](references/project.template.json) and follow [references/project.schema.json](references/project.schema.json).
  75. Validate it:
  76. ```bash
  77. python3 scripts/validate_project.py /absolute/path/project.json
  78. ```
  79. Generate the image-model prompt files:
  80. ```bash
  81. python3 scripts/make_prompt_pack.py \
  82. /absolute/path/project.json \
  83. --output-dir /absolute/path/output/prompts
  84. ```
  85. ### 5. Choose the rendering path automatically
  86. #### When an image-generation tool is available
  87. Use it as the default path.
  88. 1. Resolve the selected profile in `references/visual-profiles.json`.
  89. 2. Use that profile's `character_reference` as the only bundled image reference. Never attach multiple profile references to one generation call.
  90. 3. Generate the cover and one representative inner page first.
  91. 4. Inspect character identity, core action, metaphor originality, typography, spacing, color, copy accuracy, and absence of page-position markers.
  92. 5. Lock the successful visual description.
  93. 6. Generate the remaining pages using the same reference and style lock.
  94. 7. Save files as `cover.png`, `page-01.png`, and so on.
  95. Do not invoke the local renderer merely to pre-empt possible text errors.
  96. #### When no image-generation tool is available
  97. Use the bundled local SVG-to-PNG renderer:
  98. ```bash
  99. python3 scripts/render_xiaohongshu_project.py \
  100. /absolute/path/project.json \
  101. --output-dir /absolute/path/output
  102. ```
  103. This path preserves the Xiaohongshu cover and inner-page ratios while converting the project into deterministic local knowledge-card layouts. Read [references/local-rendering.md](references/local-rendering.md) for limitations and renderer requirements.
  104. ### 6. Repair text only after explicit user feedback
  105. Do not create a separate hybrid workflow. If the user explicitly identifies incorrect, corrupted, or unreadable text in an existing image:
  106. 1. Confirm the target image, exact replacement text, and affected region.
  107. 2. Prefer local image editing or regeneration when available.
  108. 3. If the problem remains, apply a deterministic SVG overlay only to that region:
  109. ```bash
  110. python3 scripts/patch_image_text.py \
  111. --input /absolute/path/page.png \
  112. --output /absolute/path/page-fixed.png \
  113. --visual-profile <selected-profile> \
  114. --x 100 --y 300 --width 880 --height 180 \
  115. --text "正确文字"
  116. ```
  117. 4. Inspect the repaired image before delivery.
  118. Never apply an SVG text patch speculatively.
  119. ### 7. Inspect every output
  120. Write `qa-report.md`. For every failed check, record the defect, repair action, and recheck result; do not stop at listing problems. Verify:
  121. - correct ratio and orientation;
  122. - readable, accurate Chinese and product names;
  123. - background, line treatment, palette, and typography match the selected visual profile;
  124. - one dominant idea per page;
  125. - a meaningful cognitive anchor on every page;
  126. - an original physical metaphor with one primary structure;
  127. - the character performs the metaphor's core action;
  128. - stable profile-specific character identity and proportions;
  129. - valid diagram flow;
  130. - no cropped titles, faces, hands, or summaries;
  131. - no unsupported factual claims or invented quotations;
  132. - no visible page number, page count, or page-position marker; content-level numbered steps remain allowed;
  133. - ordered, stable filenames.
  134. Run:
  135. ```bash
  136. python3 scripts/check_png_ratios.py /absolute/path/output/images
  137. ```
  138. Read [references/quality-checklist.md](references/quality-checklist.md) for the full review.
  139. ## Final response
  140. Provide:
  141. - a concise summary of the content arc;
  142. - the cover and ordered pages, or links to their files;
  143. - the publishable post copy;
  144. - source citations for time-sensitive claims;
  145. - an honest note about any unresolved image or text defect.
README.md · README · 207 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # xhs-imagen
  2. [English](./README.en.md)
  3. > 输入一个主题,生成一套可发布的小红书图文:调研、文案、分镜、角色一致性生图、发布前 QA,一次完成。
  4. `xhs-imagen` 是一个跨 Agent 的小红书图文生成技能。它不只负责“写一段生图 Prompt”,而是把内容准确性、移动端阅读体验、系列叙事、角色一致性和成品检查放进同一条工作流。
  5. Claude Code、OpenCode、OpenClaw、Hermes、Codex,以及其他能够读取 `SKILL.md` 并调用本地脚本或生图工具的 Agent 都可以使用。
  6. ## 能做什么
  7. - 从主题、文章、文档或粗略想法开始,先调研并核验事实
  8. - 生成小红书标题、正文、标签和完整图文叙事
  9. - 用“认知锚点”筛选值得独立成页的内容,而不是机械分页
  10. - 为每页设计原创视觉隐喻,让角色真正参与核心动作
  11. - 自动生成 3:4 封面和 9:16 内页
  12. - 在 6 套绑定角色与画风的 `visual_profile` 中选择
  13. - 有生图工具时优先调用模型;没有时使用本地 SVG → PNG 降级方案
  14. - 逐张检查文字、构图、比例、角色漂移和事实准确性
  15. - 默认不在图片中显示页码,发布时可自由调整顺序
  16. ## 快速开始
  17. ```bash
  18. git clone https://github.com/NimaChu/xhs-imagen.git
  19. cd xhs-imagen
  20. ```
  21. 根据所用 Agent 的技能目录约定安装仓库,或者直接让 Agent 读取根目录的 `SKILL.md`。
  22. 支持 `$skill-name` 调用的 Agent 可以直接使用:
  23. ```text
  24. 使用 $xhs-imagen,先调研“RAG 为什么不是给模型安装知识”,
  25. 再生成一张 3:4 封面、6 张 9:16 小红书科普图和可发布正文。
  26. ```
  27. 也可以指定视觉档案:
  28. ```text
  29. 使用 $xhs-imagen,以 toolbox-bot-risograph 风格,
  30. 制作一期“10 个值得安装的 Codex 插件”小红书图文。
  31. ```
  32. 不支持 `$skill-name` 时,直接要求 Agent 读取本仓库的 `SKILL.md` 即可。
  33. ## 6 套角色与绘画风格
  34. 每个 `visual_profile` 都把角色身份、绘画媒介、配色、适用题材和防漂移规则绑定在一起。生成时只传入所选档案的一张 `character-sheet.png`,避免多个角色或画风互相污染。
  35. <table>
  36. <tr>
  37. <td width="50%" valign="top">
  38. <strong>alpaca-line-art(默认)</strong><br>
  39. 白色羊驼创作者 × 极简黑线手绘。适合清爽科普、概念解释和轻量观点。
  40. <br><br>
  41. <img src="./assets/characters/alpaca-line-art/character-sheet.png" alt="alpaca-line-art character sheet">
  42. </td>
  43. <td width="50%" valign="top">
  44. <strong>glasses-chibi-blue</strong><br>
  45. 眼镜漫画主持人 × 钴蓝知识漫画。适合小白教育和信息稍密的知识卡片。
  46. <br><br>
  47. <img src="./assets/characters/glasses-chibi-blue/character-sheet.png" alt="glasses-chibi-blue character sheet">
  48. </td>
  49. </tr>
  50. <tr>
  51. <td width="50%" valign="top">
  52. <strong>toolbox-bot-risograph</strong><br>
  53. 工具箱机器人 × 双色孔版印刷。适合 Codex、插件、Skill、Agent 和工作流。
  54. <br><br>
  55. <img src="./assets/characters/toolbox-bot-risograph/character-sheet.png" alt="toolbox-bot-risograph character sheet">
  56. </td>
  57. <td width="50%" valign="top">
  58. <strong>maker-girl-editorial</strong><br>
  59. 成年女工程师 × 现代杂志编辑插画。适合 AI Coding、职场教程和观点内容。
  60. <br><br>
  61. <img src="./assets/characters/maker-girl-editorial/character-sheet.png" alt="maker-girl-editorial character sheet">
  62. </td>
  63. </tr>
  64. <tr>
  65. <td width="50%" valign="top">
  66. <strong>cyber-luban-woodcut</strong><br>
  67. 鲁班木偶工匠 × 新中式木刻版画。适合 Skill–Harness–Agent 架构和系统搭建。
  68. <br><br>
  69. <img src="./assets/characters/cyber-luban-woodcut/character-sheet.png" alt="cyber-luban-woodcut character sheet">
  70. </td>
  71. <td width="50%" valign="top">
  72. <strong>capybara-gouache</strong><br>
  73. 水豚运营官 × 温暖不透明水粉。适合小白科普、避坑、清单和生活化类比。
  74. <br><br>
  75. <img src="./assets/characters/capybara-gouache/character-sheet.png" alt="capybara-gouache character sheet">
  76. </td>
  77. </tr>
  78. </table>
  79. 角色资产统一位于:
  80. ```text
  81. assets/characters/<profile-id>/character-sheet.png
  82. ```
  83. 每张角色表包含多视图、表情、核心动作和固定道具,可直接作为跨页角色参考图。
  84. ## 从主题到发布的工作流
  85. 1. **明确任务**:确定受众、目标、页数、语言和视觉档案。
  86. 2. **调研核验**:优先检查时效性、产品信息、数字、归因和争议性表述。
  87. 3. **筛选认知锚点**:保留真正改变读者理解的判断、转折、对比、误区和边界。
  88. 4. **设计视觉隐喻**:把抽象概念转换成物理动作和日常物件。
  89. 5. **让角色承担动作**:角色必须连接、拆解、搬运、修复或揭示核心关系,而不是站在角落装饰。
  90. 6. **先做视觉样张**:先生成封面和一张代表性内页,通过后锁定画风与角色。
  91. 7. **生成整套并 QA**:逐张检查比例、文字、构图、事实和角色一致性,发现问题后修复并复检。
  92. ## 默认输出
  93. ```text
  94. output/<topic-slug>/
  95. ├── project.json
  96. ├── research.md
  97. ├── post.md
  98. ├── storyboard.md
  99. ├── prompts/
  100. │ ├── 00-cover.md
  101. │ └── 01-*.md
  102. ├── images/
  103. │ ├── cover.png
  104. │ └── page-01.png
  105. └── qa-report.md
  106. ```
  107. | 图片 | 比例 | 推荐尺寸 |
  108. |---|---:|---:|
  109. | 封面 | 3:4 | 1080 × 1440 |
  110. | 内页 | 9:16 | 1080 × 1920 |
  111. 默认生成 1 张封面和 5–8 张内页,一页只解释一个主概念。
  112. ## 两条渲染路径
  113. | 条件 | 执行方式 | 结果特点 |
  114. |---|---|---|
  115. | Agent 有生图工具 | 使用所选 visual profile 的唯一角色参考图调用生图模型 | 插画表现力强,适合直接发布 |
  116. | Agent 没有生图工具 | 使用本地 SVG → PNG 渲染器 | 中文稳定、可复现,作为完整知识卡降级方案 |
  117. 仅当用户明确指出现有图片文字错误或不可读时,才使用局部 SVG 文字修复;主流程不会为预防错字而提前拆分文字和插画。
  118. ## 本地工具
  119. 校验项目:
  120. ```bash
  121. python3 scripts/validate_project.py references/project.template.json
  122. ```
  123. 生成生图模型逐页 Prompt:
  124. ```bash
  125. python3 scripts/make_prompt_pack.py \
  126. references/project.template.json \
  127. --output-dir output/demo/prompts
  128. ```
  129. 本地渲染:
  130. ```bash
  131. python3 scripts/render_xiaohongshu_project.py \
  132. references/project.template.json \
  133. --output-dir output/demo
  134. ```
  135. 只生成本地渲染 Prompt:
  136. ```bash
  137. python3 scripts/render_xiaohongshu_project.py \
  138. references/project.template.json \
  139. --output-dir output/demo \
  140. --prompts-only
  141. ```
  142. 本地渲染会依次尝试 `rsvg-convert`、Inkscape、macOS `sips` / `qlmanage`、ImageMagick,或 `FREE_IMAGEGEN_EXPORT_SCRIPT` 指定的导出器。
  143. ## 添加自己的角色
  144. 1. 新建 `assets/characters/<profile-id>/character-sheet.png`。
  145. 2. 在 `references/visual-profiles.json` 中加入角色身份、风格锁、负向约束和背景色。
  146. 3. 在 `references/character-consistency.md` 中写明不可变特征与漂移检查。
  147. 4. 运行项目校验和测试。
  148. 角色与画风应作为一个不可拆分的 profile 维护;每个 profile 只保留一张角色参考图。
  149. ## 测试
  150. ```bash
  151. python3 -m unittest discover -s tests -v
  152. python3 scripts/validate_project.py references/project.template.json
  153. python3 scripts/make_prompt_pack.py references/project.template.json --output-dir /tmp/xhs-prompts
  154. python3 scripts/render_xiaohongshu_project.py references/project.template.json --output-dir /tmp/xhs-render --prompts-only
  155. ```
  156. ## 兼容性
  157. 原 `scripts/free_image_gen.py` CLI 和 Story Plan 接口继续保留,已有本地工作流仍可使用。`agents/openai.yaml` 仅提供支持该元数据格式的客户端界面信息,不限制其他 Agent 使用本技能。
  158. ## License
  159. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.