Xhs Article Images logo

Xhs Article Images

Community
lampooo
xhs-article-images

把长文(Markdown,含本地/远程图片)渲成小红书 3:4(1242×1656)图片组,保留全文文字与图片, 内置「理性暖」(默认)、「优雅黄」、「灵感记」、「逻辑蓝」、「简约白」五种风格。Use when 用户说小红书图文、长文转图、文章转小红书、 md转小红书图片、生成小红书长图、小红书笔记配图,或要把某篇 Markdown 文章做成可直接上传的小红书图片。

Overview

Publisherlampooo
Repositoryagent-skills
Skill namexhs-article-images
Stars
26
Forks
0
Bundled files
14
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 14 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lampooo on GitHub. Read the source before you install it.

Installation

Install the Xhs Article Images AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lampooo/agent-skills/tree/main/skills/xhs-article-images
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lampooo/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/xhs-article-images .claude/skills/xhs-article-images
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Xhs Article Images in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Xhs Article Images on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Xhs Article Images is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

长文 → 小红书图片(xhs-article-images)

把 Markdown 长文渲染成一组 3:4(1242×1656) 的 PNG,按 page-01.png… 编号,可直接上传小红书。全文文字与图片一张不漏。

内置五种风格(规范见 references/style-spec.md):

风格名CSS印象
理性暖(默认)assets/style.css暖米色杂志风:米色底、棕橙强调、标题双色竖条
优雅黄assets/style-youya-huang.css浅灰底、黄色荧光记号、灰细线标题、红色打字光标收尾
灵感记assets/style-linggan-beiwang.cssApple 备忘录深色截图感:黑底、备忘录黄、每页顶栏、黄圈✓/数字列表
逻辑蓝assets/style-luoji-lan.css冷调近白底、单一强调蓝:标题粗蓝竖条、列表细蓝竖条/蓝色大数字
简约白assets/style-jianyue-bai.css纯白底黑字极简编辑器风:标题无装饰、星号*列表符、全程无彩色、黑色打字光标收尾

技术路线:Markdown → HTML(套用 CSS)→ Playwright 分页截图。不要用 AI 生图——中文大段文字会糊、会漏。

工作流

进度:
- [ ] 1. 拿到 Markdown
- [ ] 2. 问风格
- [ ] 3. 装依赖(仅首次)并渲染
- [ ] 4. 校验页数,预览交付

1. 拿到 Markdown

  • 用户给了文件路径 → 直接用。
  • 用户粘贴正文 → 先写到临时文件(建议 <标题或时间戳>.md,与图片同目录或 ./xhs-out/),再渲染;相对路径图片需要与 md 同目录才解析得出来。
  • 都没有 → 请用户提供。

2. 问风格

每次渲染前用 AskQuestion(或列出选项)问一次:

选项行为
理性暖(默认)不加 --style,或 --style 理性暖
优雅黄加 --style 优雅黄
灵感记加 --style 灵感记
逻辑蓝加 --style 逻辑蓝
简约白加 --style 简约白

用户请求里已写明风格则跳过询问。本 skill 不生成封面图,第一张就是正文。

3. 装依赖并渲染

Skill 根目录(本文件所在目录)记为 $SKILL。

首次(或 node_modules 缺失)在 $SKILL/scripts 安装:

bash
cd "$SKILL/scripts" && npm install

渲染:

bash
# 默认理性暖风格
node "$SKILL/scripts/render.mjs" /path/to/article.md --out /path/to/out

# 指定风格(内置:理性暖、优雅黄、灵感记、逻辑蓝、简约白;也可传自定义 .css 路径)
node "$SKILL/scripts/render.mjs" article.md --out out --style 灵感记

# 可选:指定页宽高(默认 621×828 CSS 像素 @2x → 1242×1656)
node "$SKILL/scripts/render.mjs" article.md --out out --width 621 --height 828 --scale 2

默认输出目录:与 md 同级的 <md文件名>-xhs/。产出 page-01.png…。

依赖:playwright、markdown-it(见 scripts/package.json)。系统需已安装 Chromium(本机若已有 Playwright 浏览器缓存可复用)。

4. 校验、预览、交付

  • 页数 > 18 → 明确警告:小红书图文上限约 18 张,建议拆文或删图后再渲。
  • 在回复中用 Markdown 图片嵌入前 2–3 张预览(读本地 PNG)。
  • 告知输出目录与完整文件列表;提醒按 page-01 → page-NN 顺序上传。
  • 用户要换风格 → 先试另一个内置风格(--style 理性暖 / --style 优雅黄 / --style 灵感记 / --style 逻辑蓝 / --style 简约白)重跑;要微调细节 → 改对应 CSS(理性暖 assets/style.css,优雅黄 assets/style-youya-huang.css,灵感记 assets/style-linggan-beiwang.css,逻辑蓝 assets/style-luoji-lan.css,简约白 assets/style-jianyue-bai.css,规范见 style-spec),再重跑同一命令。

输入约定

  • 支持:标题、段落、加粗/斜体、引用、有序/无序列表、图片(本地相对路径或 http(s))、代码块、分割线、链接(链接文字保留,URL 可不展示)。
  • 图片:相对路径相对 md 文件所在目录;远程图需可访问。
  • 分页规则(脚本内已实现):块级装箱;标题不与后续内容拆开成页尾孤行;超长段按句号拆;列表按条目拆;过高图等比缩到单页可用高度内。
  • 语义绑定(脚本内已实现):图片视为其上方文字的配图——当前页放不下时先等比缩小挤进同页(下限约 45% 宽 / 220px 高),缩不动则把上一段文字一起挪到新页与图同页;以「:」结尾的段落与下一块(图/列表)强制同页。

反模式

  • ❌ 用 GenerateImage / 文生图模型画正文页
  • ❌ 手工截浏览器长图再切片(易漏字、切到行中间)
  • ❌ 擅自删减原文段落「为了好看」——必须全文保留

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Xhs Article Images AI skill do?

把长文(Markdown,含本地/远程图片)渲成小红书 3:4(1242×1656)图片组,保留全文文字与图片, 内置「理性暖」(默认)、「优雅黄」、「灵感记」、「逻辑蓝」、「简约白」五种风格。Use when 用户说小红书图文、长文转图、文章转小红书、 md转小红书图片、生成小红书长图、小红书笔记配图,或要把某篇 Markdown 文章做成可直接上传的小红书图片。

Why use Xhs Article Images on TypingMind?

Because you install it once and use it with any model. Xhs Article Images is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Xhs Article Images in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lampooo/agent-skills/tree/main/skills/xhs-article-images. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Xhs Article Images?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Xhs Article Images?

As many as you like. As long as a model supports skills, you can use Xhs Article Images with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Xhs Article Images AI skill free?

Yes. It is published on GitHub by lampooo under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇