Home / All Skills / Design & Motion / card-xiaohongshu
Design & Motion · nexu-io/html-anything

card-xiaohongshu

Xiaohongshu (RED) style knowledge cards, arranged in multi-card sequences for swipeable browsing.

L1 Basic · Source registration onlyV1 Commit-PinnedDual-pass Audit
Author nexu-ioGitHub nexu-io/html-anything ↗Stars 8827License Apache-2.0(仓库根 LICENSE:Apache License Version 2.0, January 2004;GitHub API spdx_id=Apache-2.0)Commit 553ed98c28
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

The template itself contains no executable code: the loader reads the frontmatter and body from src/lib/templates/skills/<id>/SKILL.md, and returns the body along with example content as LoadedSkill.

next/src/lib/templates/loader.ts
const raw = safeRead(path.join(dir, "SKILL.md"));
What is happening here: SKILL.md is the sole source of behavior—frontmatter is used for selector rendering (zh_name/emoji/aspect_hint/tags/example_*, etc.), and the entire body serves as the prompt; the loader performs no semantic validation and dispatches exactly what the template defines.

The host assembles the prompt in a fixed sequence before dispatch: the template body is sandwiched between the shared design directives SHARED_DESIGN_DIRECTIVES and [Input Format] / [User Content].

next/src/lib/templates/shared.ts
Wrap a per-template instruction body with the shared design directives and
What is happening here: The template only defines 'what this specific deliverable looks like' (layout/rhythm/components), while shared directives enforce cross-template hard constraints—single-file HTML, prohibition of file tools, loading Tailwind and Google Fonts via CDN, content authenticity, and CJK spacing (Pangu spacing).

Shared directives translate hard constraints into explicit prohibitions for the agent and enforce content-driven quantity (numbers in the template serve only as baseline minimums).

next/src/lib/templates/shared.ts
**禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。
Further down in the same file lies another rule: the quantity of output slides / frames / cards / sections is determined entirely by the actual length and information structure of the [User Content]—explaining why templates of this type do not break as content grows longer: each section gets at least one card/segment, and the template merely provides a pool of layouts.

Actual execution is handled by the coding agent CLI already installed and authenticated on the user's local machine: the host spawns a child process, passes the prompt to it, and captures the HTML stream from stdout.

next/src/lib/agents/invoke.ts
import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";
What is happening here: The template skill provides only prompts; capabilities (including code generation and tool execution) come from the existing permissions of the host CLI; the skill directory itself contains no script entry points, so tier assessment considers only in-directory assets (host behaviors are not graded).

/api/convert is the execution path for templates: it combines skill.body with user content into a prompt and passes it to invokeAgent.

next/src/app/api/convert/route.ts
prompt = assemblePrompt({ body: skill.body, content, format });
Edit mode follows a separate buildEditPrompt path (minimal diff editing, disabling file tools, requiring direct streaming of the complete HTML), ensuring a stable deliverable form for this template category: single-file HTML, inline CSS/SVG, and external links limited strictly to fonts and charting libraries explicitly requested by specific templates.

The output is a vertical flex column of N identical-sized cards, sized at 1080×1440 (3:4) per card, supporting both full-length continuous screenshots and individual slide captures.

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
- 输出 N 张连续卡片, 每张 `w-[1080px] h-[1440px]`, 用 flex 纵向排列方便整体截图也方便单张截图。
What is happening here: The vertical layout simultaneously accommodates two use cases—a single long screenshot (multi-card stitch) or individual screenshot uploads; the example .deck uses display:flex + flex-direction:column + align-items:center.

Card count is determined by content density, with platform limits and rule-of-thumb ranges provided (up to 18 images, typically optimal within 9, starting at 3-6 cards for short content, with one core point per card).

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
N 由【用户内容】信息量决定: 短内容 3-6 张起步
What is happening here: The most common ambiguity of 'how many cards' is converted into deterministic rules, aligned with the content-driven quantity constraint of the shared directives (numbers in the template are floors, not ceilings).

The card sequence features a clear narrative structure: a cover card (massive title + 1-line subtitle + catchy badge), intermediate cards each covering one core point (emoji + short phrase + 1-2 examples), and a concluding card with summary + call to action.

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
- 最后一张是总结 + 行动号召 (关注 / 收藏 / 评论)。
The example generates 7 cards based on this: cover with a '⚡ Recommended to Save · Practical Guide' badge, 5 body cards each illustrating an AI usage habit, and a final card featuring a 'Follow / Save' CTA button style.

Mobile readability is enforced as a strict requirement: large font sizes, generous line heights, and high contrast, on the grounds that Xiaohongshu is read on mobile phones.

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
- 字号大、行距宽、对比强(小红书在手机上看, 小字根本看不清)。
This is a key differentiator between this template and card-twitter: a narrower and taller canvas (1080×1440 vs 1600×900) and higher information density, while still strictly prohibiting tiny text.

Each card includes a bottom-right watermark (author name / date), implemented in the example as @HTMLAnything + page number.

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
- 每张卡片右下角小水印 (作者名 / 日期)。
In the example, every card has a <div class="watermark">: the cover uses '@HTMLAnything · 5/11', inner pages use '@HTMLAnything', and the final card includes a subtitle 'Weekly AI workflow in practice'—the watermark serves as brand placement.

Color palette and element styles are restricted to soft Morandi/pastel tones, rounded elements, and generous whitespace; the example implements this using a coordinated set of gradient backgrounds.

next/src/lib/templates/skills/card-xiaohongshu/SKILL.md
- 配色: 选择柔和的莫兰迪色或粉色系; 元素圆润, 大量留白。
The example .card sets border-radius:32px, and each card uses linear-gradient(160deg,…) to vary color gradations, creating a cohesive series feel rather than a repetitive single color.

2Core Capabilities

01Multi-card vertical layout output: N cards in a 1080×1440 (3:4) vertical flex column
02Cover card structure: massive title + 1-line subtitle + catchy badge/tag
03Body card structure: one point per card + emoji + short phrase + 1-2 examples
04Ending card: summary + call to action (follow / bookmark / comment)
05Card count rules: driven by content density (starts at 3-6 cards for short content; platform maximum 18, typically optimal at ≤9)
06Mobile readability constraints (large font size, wide line-height, high contrast)
07Watermark placement on each card (author name/date)

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Can be auto-loaded
For Administrators
Register source and version
Evidence & Triggers (File Paths & Excerpts)
  • SKILL.md: Pure prompt directives and rule text, without script execution or external impact
Audit Notes: . Rating is based exclusively on the skill's own directory (only three files: SKILL.md + example.html + example.md, with no scripts/, no embedded CLI, no credential reading, and no disk-write operations): no script entry points, no embedded CLI, no credential access, and no disk write instructions; the SKILL.md body does not request pulling from any external endpoints at runtime (specifying only canvas size, card count rules, color scheme, and font size requirements). No outbound requests occur during execution. The only endpoints appearing in the directory are cdn.tailwindcss.com and fonts.googleapis.com in example.html:6-7, which under Batch 4 final criteria qualify as **artifact-time references** (the generated HTML fetches CDN/fonts when opened in a browser; the skill itself does not fetch, report, or transmit assets during execution), and thus carry no risk rating, listed here for endpoint transparency only; host wrapper behaviors (loader → assemblePrompt → local agent CLI spawn, preview iframe sandbox) belong to host actions and are recorded under verdict.risks.

5Second-Pass Verification

  • [ok] 张数一致性(输入分节 ↔ 输出卡数) — example.html 中 class="card" 出现 7 次,与 example.md 的封面 + 5 个观点卡 + 总结一致;SKILL.md 的「3-6 张起步 / 通常 9 张以内最佳」是区间指导,示例 7 张落在区间内。
  • [ok] 封面徽标与结尾 CTA 是否落实 — 封面卡含「⚡ 建议收藏 · 干货预警」标签(对应吸引人的标签),末卡含「关注」「收藏」按钮样式(对应行动号召),均可逐字定位。
  • [ok] 水印要求落地 — 7 张卡各有一个 .watermark 元素;封面带页码「@HTMLAnything · 5/11」,符合水印位(作者名 / 日期页码)设计。
  • [ok] 端点与判级 — 目录内 http(s) 仅 cdn.tailwindcss.com 与 fonts.googleapis.com(产物期引用);SKILL.md 正文无端点要求,执行期零外发,维持 green。
  • [ok] license / stars / commit 元数据 — GitHub API(api.github.com/repos/nexu-io/html-anything):spdx_id=Apache-2.0、stargazers_count=8827、pushed_at=2026-09-15T03:36:24Z;工作副本 git HEAD = 553ed98c283f9c0f489902d035416a972d6a9699(与任务表 pin 553ed98c283f 同源)。
  • [ok] skill.path 与目录资产面 — pin 目录内该路径存在且含 SKILL.md;目录内文件清单已用 glob 全量核对(含隐藏文件),无 scripts/、无 references/、无二进制资产(competitive-teardown 的 assets/ 为纯 HTML,另行记录)。

6Verdict & Scenarios

  • Turns 'how many cards to publish' into executable rules (content-driven + platform maximum of 18 + typically optimal at ≤9 + one point per card), preventing long content from being compressed into too few cards.
  • The three-stage narrative structure (cover / body / summary + CTA) naturally adapts the output to platform reading habits, with verifiable elements in each segment.
  • Mobile readability is explicitly constrained (large font size / wide line-height / high contrast) with clear rationale (small text is illegible on phones), preventing desktop layouts from being squeezed into a 3:4 canvas.
  • The example provides a complete, publication-ready deck (7 cards, including cover badge, card-by-card gradients, watermarks, and final card CTA), establishing an input-to-output pattern in example.md.
  • Best for: Ideal for turning practical tips, tutorials, or checklists into Xiaohongshu carousel posts: knowledge explainers, tool tricks, curated lists, and product notes; the example (5 AI editor habits) is a representative practical card set using short phrases + emojis + examples.
    Not for: Not suitable for single punchy quotes (should use card-twitter's 1600×900 single card); not suitable for long-form prose (should use blog-post/article-*); not suitable for content requiring data charts (the template does not integrate charting libraries).
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload card-xiaohongshu.tar.gz
    sha256: f54e465c136dc217…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 553ed98c28.