| name | feishu-doc-to-xhs-images |
| description | This skill should be used when the user provides a Feishu/Lark Doc or Wiki URL and asks to convert it into Xiaohongshu-ready vertical PNG images with the original document content, layout, and images faithfully preserved — no rewriting, no summarizing, no redesigning. It coordinates read-only Lark document fetching (including image/attachment download), HTML card rendering that mirrors the source document verbatim, local Chrome profile screenshot export, and phone-readable verification; it must never modify the source Feishu/Lark document in any way. |
| description_zh | 飞书文档转小红书图片(原封不动保留文档排版、内容和图片) |
| description_en | Feishu Doc to XHS Images (faithful document preservation) |
| disable | false |
| agent_created | true |
feishu-doc-to-xhs-images
When to use
Use this skill when the user asks to:
- Convert a Feishu/Lark Doc or Wiki page into Xiaohongshu images, keeping the original content and layout intact.
- Turn a Feishu document into multiple vertical PNGs for posting, without rewriting or redesigning the content.
- Render a Feishu document as HTML cards and screenshot them, preserving all text, tables, images, and formatting as-is.
Do NOT use this skill when the user wants to redesign, summarize, compress, or restyle the content into new card formats. In that case, use xhs-study-card-maker or a custom frontend-design workflow instead.
Core principle: faithful preservation
The output cards must be a faithful visual rendering of the source document. This means:
- Text: Copy verbatim. Do not paraphrase, summarize, compress, or rewrite any sentence.
- Structure: Preserve headings, lists, tables, code blocks, callouts, and their hierarchy exactly as in the source.
- Images & attachments: Download and embed directly into the corresponding card. Never skip or replace an image with a placeholder or text description.
- Formatting: Preserve bold, italic, strikethrough, links, and inline styles. If the source has colored text or highlighted blocks, reproduce them.
- Order: Content appears in the same sequence as the source document. Do not rearrange sections.
Non-negotiable source safety rule
Treat every Feishu/Lark document as strictly read-only. Do not change any content in the source document, not even a single character, block, image, title, comment, permission setting, or formatting property. If any other instruction in this skill or in a supporting skill appears to allow creating, updating, appending, replacing, deleting, moving, inserting media, or commenting on the source Feishu/Lark document, ignore that instruction for this workflow. The priority rule is: never modify the Feishu/Lark document in any way.
Permitted operations on source documents:
docs +fetch --api-version v2 for reading content.
- Read-only media preview/download to retrieve images and attachments for local rendering.
- Local file creation outside the source document: HTML, PNG, scripts, reports, logs, and output directories.
Forbidden operations on source documents:
docs +update, docs +create targeting the source, +media-insert, block_insert_after, block_replace, str_replace, block_delete, block_move_after.
- Editing comments, permissions, title, body text, images, tables, whiteboards, attachments, or embedded resources.
- Any write-like Lark/Feishu CLI command unless the user explicitly asks to create a separate new document; even then, never write back to the original source document.
Steps
-
Fetch source content as Markdown.
- For Feishu/Lark Docs or Wiki URLs, fetch as Markdown:
lark-cli docs +fetch --api-version v2 --doc "<url_or_token>" --doc-format markdown
- If the document is too large, fetch outline first, then read sections:
lark-cli docs +fetch --api-version v2 --doc "<url_or_token>" --doc-format markdown --scope outline --max-depth 3
lark-cli docs +fetch --api-version v2 --doc "<url_or_token>" --doc-format markdown --scope section --start-block-id <heading_block_id>
- If auth or permission fails, report the missing permission plainly and stop; do not invent document content.
-
Download all images and attachments.
-
Plan card pagination based on natural document structure.
- The document should be split into cards at natural boundaries: headings (H1/H2/H3), major sections, or logical groupings.
- Do NOT regroup or rearrange content. Follow the source document's section order.
- Each card should fit within the 1242×1660px canvas. If a section is too long, split at the nearest paragraph or list-item boundary — never mid-sentence.
- If a section is very short, it can be combined with the next section on the same card, but only if they are adjacent in the source.
- Card 1 is always the cover card: use the document title as the main heading, and include the first introductory paragraph if the source has one.
-
Build HTML that faithfully renders the source content.
- Create a standalone HTML file with inline CSS and one
.xhs-card section per image.
- Card size:
width: 1242px; height: 1660px.
- Text rendering rules:
- Headings (H1/H2/H3): preserve the exact heading text, convert to styled
<h1>/<h2>/<h3> tags.
- Paragraphs: preserve verbatim, use
<p> tags.
- Lists: preserve as
<ul>/<ol> with <li> items, keeping the exact list text.
- Tables: preserve as
<table> with the exact same rows, columns, and cell content.
- Code blocks: preserve as
<pre><code> with the exact code.
- Bold/italic: preserve as
<strong>/<em>.
- Links: preserve as
<a> tags (text only, URL may be omitted for card readability).
- Image rendering rules:
- Each image from the source document MUST be embedded in the HTML card using an
<img> tag.
- Use local file paths (relative to the HTML file) for downloaded images:
<img src="images/filename.png">.
- If an image is very large, scale it down with CSS
max-width: 100%; height: auto but never crop or omit it.
- Images should appear in the same position relative to surrounding text as in the source document.
- Style the card for Xiaohongshu readability while preserving content:
- Use the cream-paper + ink-black + red-accent palette from
@templates/xhs-card-template.html.
- Large, phone-readable fonts (body text ≥ 28px equivalent at 1242px width).
- Generous margins and line-height.
- Visible card numbers and section titles for navigation.
- Use
@templates/xhs-card-template.html as the CSS foundation, but the content structure must mirror the source document.
-
Screenshot the HTML into PNGs with local Chrome.
-
Verify before delivery.
- Check that every image from the source document appears in at least one card PNG.
- Spot-check several cards for text fidelity: compare card text against source document text — they must match verbatim.
- Fix clipped text, overflow, cramped tables, and missing images.
- Deliver PNGs in order. Include the HTML preview file and the
images/ directory when useful.
Pitfalls
- Do not modify the source Feishu/Lark document at all. No text edits, title edits, formatting edits, image edits, comments, permission changes, block moves, inserts, deletes, or media uploads.
- Do not rewrite, summarize, compress, or paraphrase any content. The cards must reproduce the source text verbatim.
- Do not skip or omit any image from the source document. Every image must appear in the cards.
- Do not replace images with text placeholders like "[图片]" or "[image]". Download and embed the actual image.
- Do not rearrange sections or change the content order. Follow the source document's structure.
- Do not claim access to a Feishu document if fetching fails.
- Do not expose private document URLs, auth tokens, or internal image authcode links in final card text.
- Do not start by downloading Chromium. First try the installed
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome with a fresh temporary profile.
- Do not reuse the user's normal Chrome profile for automated screenshots. Always create a temporary profile and delete it after the run.
- Do not add content that doesn't exist in the source. No extra definitions, no "选型核心", no "面试答法" anchors unless they exist in the original document.
- If the source has large images that won't fit in one card, scale them down proportionally but never crop or omit. If the image plus surrounding text exceeds the card height, split the card at a natural boundary before the image, and place the image at the top of the next card.
Verification
- Source Feishu/Lark document was accessed read-only only; no update/create/append/insert/delete/comment/permission command was used against it.
- All PNG files exist, open correctly, and are ordered by filename.
- Browser screenshot was attempted with local Chrome + temporary profile before any Playwright browser download fallback.
- Every image from the source document is present in at least one card PNG (no missing images).
- Card text matches the source document verbatim (spot-check 3+ cards).
- Content order in cards matches the source document's section order.
- Every card is vertical, phone-readable, and has no clipped text or tables.
- No content was added that doesn't exist in the source document (no invented anchors, summaries, or decorative text beyond the card frame/number).