xhs-imagen is a Claude Code plugin with 1 hand-picked skill, indexed on Flowy in the Image Generation category.
$ npx -y skills add nimachu/xhs-imagen --agent claude-code
输入一个主题,生成一套可发布的小红书图文:调研、文案、分镜、角色一致性生图、发布前 QA,一次完成。
xhs-imagen 是一个跨 Agent 的小红书图文生成技能。它不只负责“写一段生图 Prompt”,而是把内容准确性、移动端阅读体验、系列叙事、角色一致性和成品检查放进同一条工作流。
Claude Code、OpenCode、OpenClaw、Hermes、Codex,以及其他能够读取 SKILL.md 并调用本地脚本或生图工具的 Agent 都可以使用。
visual_profile 中选择git clone https://github.com/NimaChu/xhs-imagen.git
cd xhs-imagen
根据所用 Agent 的技能目录约定安装仓库,或者直接让 Agent 读取根目录的 SKILL.md。
支持 $skill-name 调用的 Agent 可以直接使用:
使用 $xhs-imagen,先调研“RAG 为什么不是给模型安装知识”,
再生成一张 3:4 封面、6 张 9:16 小红书科普图和可发布正文。
也可以指定视觉档案:
使用 $xhs-imagen,以 toolbox-bot-risograph 风格,
制作一期“10 个值得安装的 Codex 插件”小红书图文。
不支持 $skill-name 时,直接要求 Agent 读取本仓库的 SKILL.md 即可。
每个 visual_profile 都把角色身份、绘画媒介、配色、适用题材和防漂移规则绑定在一起。生成时只传入所选档案的一张 character-sheet.png,避免多个角色或画风互相污染。
角色资产统一位于:
assets/characters/<profile-id>/character-sheet.png
每张角色表包含多视图、表情、核心动作和固定道具,可直接作为跨页角色参考图。
output/<topic-slug>/
├── project.json
├── research.md
├── post.md
├── storyboard.md
├── prompts/
│ ├── 00-cover.md
│ └── 01-*.md
├── images/
│ ├── cover.png
│ └── page-01.png
└── qa-report.md
| 图片 | 比例 | 推荐尺寸 |
|---|---|---|
| 封面 | 3:4 | 1080 × 1440 |
| 内页 | 9:16 | 1080 × 1920 |
默认生成 1 张封面和 5–8 张内页,一页只解释一个主概念。
| 条件 | 执行方式 | 结果特点 |
|---|---|---|
| Agent 有生图工具 | 使用所选 visual profile 的唯一角色参考图调用生图模型 | 插画表现力强,适合直接发布 |
| Agent 没有生图工具 | 使用本地 SVG → PNG 渲染器 | 中文稳定、可复现,作为完整知识卡降级方案 |
仅当用户明确指出现有图片文字错误或不可读时,才使用局部 SVG 文字修复;主流程不会为预防错字而提前拆分文字和插画。
校验项目:
python3 scripts/validate_project.py references/project.template.json
生成生图模型逐页 Prompt:
python3 scripts/make_prompt_pack.py \
references/project.template.json \
--output-dir output/demo/prompts
本地渲染:
python3 scripts/render_xiaohongshu_project.py \
references/project.template.json \
--output-dir output/demo
只生成本地渲染 Prompt:
python3 scripts/render_xiaohongshu_project.py \
references/project.template.json \
--output-dir output/demo \
--prompts-only
本地渲染会依次尝试 rsvg-convert、Inkscape、macOS sips / qlmanage、ImageMagick,或 FREE_IMAGEGEN_EXPORT_SCRIPT 指定的导出器。
assets/characters/<profile-id>/character-sheet.png。references/visual-profiles.json 中加入角色身份、风格锁、负向约束和背景色。references/character-consistency.md 中写明不可变特征与漂移检查。角色与画风应作为一个不可拆分的 profile 维护;每个 profile 只保留一张角色参考图。
python3 -m unittest discover -s tests -v
python3 scripts/validate_project.py references/project.template.json
python3 scripts/make_prompt_pack.py references/project.template.json --output-dir /tmp/xhs-prompts
python3 scripts/render_xiaohongshu_project.py references/project.template.json --output-dir /tmp/xhs-render --prompts-only
原 scripts/free_image_gen.py CLI 和 Story Plan 接口继续保留,已有本地工作流仍可使用。agents/openai.yaml 仅提供支持该元数据格式的客户端界面信息,不限制其他 Agent 使用本技能。
MIT
xhs-imagen is a Claude Code plugin with 1 hand-picked skill, indexed on Flowy in the Image Generation category. Install it with the command on its page. It includes xhs-imagen. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it