xiaohongshu-card-publish

xiaohongshu-card-publish is a skill for Codex from tranfu-labs/tranfu-skills. It costs 181 tokens per session (4,742 once invoked), scanned A, original, MIT.

A card-making workflow that turns Chinese Xiaohongshu copy into vertical 1080×1440 pixel preview cards and WebP images. Xiaohongshu is a Chinese social platform where image-based posts are commonly shared.

In plain words
What is it for?
Use it to create, preview, screenshot, and batch-export Xiaohongshu post cards from supplied copy.
Why use it?
It removes the manual work of placing copy into a fixed card layout, assembling a series preview, and exporting each card at the required size.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: reads .claude/ paths.

Good fit Use it to create, preview, screenshot, and batch-export Xiaohongshu post cards from supplied copy.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tranfu-labs/tranfu-skills --skill xiaohongshu-card-publish
Clone the repo
git clone --depth 1 https://github.com/tranfu-labs/tranfu-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xiaohongshu-card-publish

README.md
[![agentmods](https://agentmods.dev/badge/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish/github.svg)](https://agentmods.dev/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish)
Your own site
<a href="https://agentmods.dev/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish"><img src="https://agentmods.dev/badge/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xiaohongshu-card-publish

Your own site · 80×15
<a href="https://agentmods.dev/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish"><img src="https://agentmods.dev/badge/skills/tranfu-labs/tranfu-skills/xiaohongshu-card-publish.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 181 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,742 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00181 $0.04742
Opus 5 $0.00090 $0.02371
Sonnet 5 $0.00036 $0.00948
Haiku 4.5 $0.00018 $0.00474

Measured 9d ago against content hash 6e50df78650c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

xiaohongshu-card-publish scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/export.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

own-skills/xiaohongshu-card-publish/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

小红书文案 → 成品配图流水线

本 skill 是这条流水线的唯一事实源:版式模板、变量契约、结构约定、导出规范都在这里(模板文件在 assets/,导出脚本在 scripts/)。仓库根没有独立的 template/ 目录,dist/ 下全是一次性产物,可随时删掉重生成、不手工长期维护。

这个 skill 在做什么

把小红书文案渲染成 HTML 卡片,再截图导出为成品图片。成品尺寸固定 1080×1440 px(3:4 竖版),是小红书配图的硬性规格。

整条结果链:

文案  ──填充──▶  dist/<系列>/<卡片>/index.html   (由 assets/default.html 复制 + 填充而来)
                        │
              pages.json 声明顺序
                        │
            dist/<系列>/index.html (由 assets/app.html 复制而来,iframe 预览整组)
                        │
              playwright 截 .card
                        ▼
            dist/<系列>/snapshot/NN.webp  (2x 超采样 + 无损 WebP 成品)

两条主流程:A 生成预览(文案 → 卡片产物 + 系列预览)和 B 导出成品图(系列 → WebP)。用户说「生成预览/做卡片」走 A,说「导出/截图」走 B;两者常先后发生。

skill 自带的事实源文件

复制与填充时只用这两个模板,它们随 skill 走、就是唯一权威:

  • assets/default.html纯卡片模板(1080×1440 版式)。其顶部注释块是变量映射的权威说明:每个 {{变量}} 叫什么、是单值/内联 HTML/块结构、有什么字数与格式约束,都以它为准;本文档下面的清单只是摘要,冲突时听模板注释的。
  • assets/app.html系列预览应用壳:读 pages.json,用 <iframe> 逐张浏览,PPT 式翻页 + iPhone 设备框开关 + 浏览器内 JS 导出(降级备用)。

各「不触发」项的去向:改卡片版式/CSS、新增模板主题 = 改 assets/ 里的模板(这就是改事实源本身,单独发起);定义文案输入格式/分页规则等数据建模、选型构建工具链 = 本流水线之外的设计决策,单独发起、不在本 skill 内处理;与本仓库无关的通用 HTML/截图任务 = 不适用本 skill。日常生成只复制、不改模板。

不可逾越的护栏

这些约束破一条就会让下游全部失效,写代码前先内化:

  • NEVER 改卡片真实尺寸 1080×1440(3:4)。 由 CSS 变量 --card-w / --card-h 固定,是小红书成品规格,改它会破坏所有导出。预览缩放由 app 壳承担,不动真实尺寸。
  • NEVER 把预览专用东西混进卡片产物或成品图。 卡片模板与每张卡片产物里 不得出现 .ruler(标尺)、.stage(占位容器)、--scale(预览缩放);iPhone 设备框只是 app 壳里的纯预览开关。成品图只应是 .card 本身——无背景、无标尺、无设备框。
  • NEVER 让导出反向依赖文案结构。 域依赖方向是 content → render → export,单向。导出只接收渲染好的 HTML/DOM,逐张加载卡片 index.html.card,不感知文案有几节、什么字段。
  • 画质规范(任何导出方式都必须满足):2x 超采样 + WebP 无损。 直接 1x 渲染或有损 WebP 会让文字/终端边缘发糊。
  • NEVER 把截图产物(.png/.jpg/.webp)或密钥提交进仓库。

卡片与系列的结构约定

填充和组织系列时遵守,省得撑破版面或破坏预览/导出:

  • 一张卡片三段结构:顶栏(品牌 + 页码)→ 标题区(大序号 + 标题,可带终端块)→ 正文小节 → 页脚(账号 + 引导)。缺字段时按可缺省规则省略对应元素(KICKER、副标等可缺省;标题、正文、页码不可缺)。
  • 颜色与字号集中在模板 :root 的 CSS 变量里(如 --accent--ink--card-w),不要在元素上散落硬编码色值/尺寸。
  • 页码连续性PAGE_NO01 递增,PAGE_TOTAL = 系列卡片总数;当前页 ≤ 总页数,总页数 = 卡片序列长度。
  • pages.json 结构{ "series": "<系列展示名>", "pages": [ { "src": "<slug>/index.html", "title": "NN · <标题或命令>" }, … ] }pages 数组顺序就是浏览顺序和导出顺序。
  • 改系列内容 = 只改 pages.json:增删卡片、调顺序,MUST 只编辑 pages.json,MUST NOT 去改 app 壳或卡片 HTML。app 壳只通过 iframe 引用卡片,不内联卡片 HTML。

Read the full file on GitHub · 216 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 216 lines · 181 tokens per session scan A 6e50df78650c

Subscribe to this mod's changes

xiaohongshu-card-publish is a skill published in the GitHub repository tranfu-labs/tranfu-skills (2 stars, last pushed 2d ago), licensed MIT. It adds 181 tokens to every session and 4,742 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens