md-to-xhs-cards

md-to-xhs-cards is a skill for Claude Code, Codex from erafat/skills. It costs 72 tokens per session (1,162 once invoked), scanned A, original, MIT.

A guide for turning Markdown files into sets of image cards for Xiaohongshu, also known as Little Red Book, a Chinese social-media platform.

In plain words
What is it for?
Use it to render headings, paragraphs, lists, quotes, code, dividers, and local images into cards, with optional cover and style settings.
Why use it?
It preserves the source order and formatting cues so the content can be shared as images without rewriting it by hand.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to render headings, paragraphs, lists, quotes, code, dividers, and local images into cards, with optional cover and style settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/erafat/skills/md-to-xhs-cards
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 erafat/skills --skill md-to-xhs-cards
Clone the repo
git clone --depth 1 https://github.com/erafat/skills

Made for: Claude Code, 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 md-to-xhs-cards

README.md
[![agentmods](https://agentmods.dev/badge/skills/erafat/skills/md-to-xhs-cards/github.svg)](https://agentmods.dev/skills/erafat/skills/md-to-xhs-cards)
Your own site
<a href="https://agentmods.dev/skills/erafat/skills/md-to-xhs-cards"><img src="https://agentmods.dev/badge/skills/erafat/skills/md-to-xhs-cards/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 md-to-xhs-cards

Your own site · 80×15
<a href="https://agentmods.dev/skills/erafat/skills/md-to-xhs-cards"><img src="https://agentmods.dev/badge/skills/erafat/skills/md-to-xhs-cards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,162 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.00072 $0.01162
Opus 5 $0.00036 $0.00581
Sonnet 5 $0.00014 $0.00232
Haiku 4.5 $0.00007 $0.00116

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

Security

Grade A, and why

md-to-xhs-cards 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 12d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/md_to_xhs_cards.py, scripts/publish_xhs.py, scripts/run_md_to_xhs_cards.sh), 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.

md-to-xhs-cards/SKILL.md · 172 lines

How it starts

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

Markdown To Xiaohongshu Cards

Overview

Convert markdown content into a multi-image card set suitable for Xiaohongshu posting. Keep source ordering and formatting cues (headings, paragraphs, lists, quotes, code, dividers, images) without rewriting the content.

Quick Start

  1. Resolve the markdown file path from the user request.
  2. Run:
scripts/run_md_to_xhs_cards.sh /absolute/or/relative/path/to/file.md
  1. Return output folder and generated card paths.

Default output folder: <markdown-dir>/<markdown-stem>-xhs-cards

Workflow

  1. Validate input:
  • Confirm markdown file exists.
  • Confirm referenced images are local files when possible (![...](...) or Obsidian ![[...]]).
  1. Execute deterministic rendering:
  • Run scripts/run_md_to_xhs_cards.sh.
  • Use --width and --height to match required aspect ratio.
  • Use --background, --text-color, and related flags for style adjustment.
  • Use --author (and optionally --title / --subtitle) for a dedicated cover card.
  1. Verify output:
  • Ensure at least one NN-card.png exists.
  • Check manifest.json for count and filenames.
  • If images are missing, report placeholders and list unresolved image paths.
  1. Optional publish to Xiaohongshu:
  • Add --publish-xhs to publish immediately after rendering.
  • Use --publish-title / --publish-desc overrides when needed.
  • For safe validation, run once with --publish-dry-run.
  1. Report clearly:
  • Provide absolute output directory.
  • Provide absolute paths for all generated cards.
  • Call out any missing/remote image limitations.

Quality Rules

  • Keep direct conversion behavior: do not rewrite the article content unless user asks.
  • Keep markdown block order stable.
  • Preserve image placement where possible (markdown and Obsidian image embeds).
  • Prefer 3:4 cards for Xiaohongshu (1080x1440 or 1242x1660).

Common Commands

Default:

scripts/run_md_to_xhs_cards.sh content/post.md

Set explicit output directory:

scripts/run_md_to_xhs_cards.sh content/post.md --output-dir exports/xhs-cards

Read the full file on GitHub · 172 lines

Files

What ships with it

5 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. 12d ago First seen · 172 lines · 72 tokens per session scan A 0bfcf37d1fb3

Subscribe to this mod's changes

md-to-xhs-cards is a skill published in the GitHub repository erafat/skills (16 stars, last pushed 2mo ago), licensed MIT. It adds 72 tokens to every session and 1,162 once invoked, about $0.0004 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-08-30.

Related

Other skills, from other repositories

pixel2motion

Turn a raster logo (PNG/JPG/WebP/screenshot) into a clean minimal SVG with edge smoothness as the primary hard gate and IoU optimized as high as reasonably possible without a fixed global threshold, then into a choreographed logo animation delivered as standalone JS-rendered HTML, applying Disney's 12 animation…

nolangz/pixel2motion · 163 tokens

regional-culture-poster

Convert Chinese provinces, municipalities, autonomous regions, cities, counties, ancient cities, and cultural regions into restrained contemporary posters led by one culturally transformed Chinese character. Supports direct one-shot final image generation and layered production. Use when the user asks for a…

dacnay816y62-hub/regional-culture-poster · 158 tokens

asset-review-agent

Independently review source-extracted quote, viewpoint, hook, and structure candidates. Image and shot assets are outside automatic review and enter only after explicit user interaction.

KristenPan/pickoo-your-favorites · 37 tokens

creator-content-ingest

Process, validate, repair, or resume an existing Pickoo source package after save-to-favorites or the shared task worker hands it off. Handles evidence-preserving capture, OCR, ASR, chaptering, analysis, and quality-gated assets inside that package. Do not use this skill as the intake route for an ordinary new link…

KristenPan/pickoo-your-favorites · 98 tokens

create-xiaohongshu-knowledge-carousel

Create complete Chinese Xiaohongshu educational carousel images from a topic, source document, notes, or an existing page concept. Use when Codex must plan every definition and meaning without compressing knowledge points, maintain a recurring character and visual system, directly render fully typeset 3:4 final pages…

Jaimo-so/xiaohongshu-knowledge-carousel-skill · 89 tokens

download-xhs-videos

A process for downloading a Xiaohongshu creator’s videos to a local folder. Xiaohongshu, also called RedNote, is a Chinese social-media platform.

YijiaDuan/download-xhs-videos · 181 tokens