npx skills add ...
npx skills add zc277584121/marketing-skills --skill md-to-feishu
Convert local Markdown files to Feishu (Lark) documents with automatic image uploading. Uses the feishu-docx CLI tool.
npx skills add zc277584121/marketing-skills --skill md-to-feishu
Convert a local Markdown file into a Feishu document, with automatic image upload.
The user only needs to provide a Markdown file path. Title is optional — if not provided, extract it automatically (see below).
# heading — use that as the title.# heading exists, scan the content and generate a concise, descriptive title based on the topic.Try each option in order. Use the first one that works.
If uvx is available, the run command is:
If uvx runs with Python < 3.11, add --python 3.11:
If found, check Python version:
If Python >= 3.11, the run command is:
If neither uvx nor feishu-docx is found, tell the user:
feishu-docxrequires Python >= 3.11. Install with one of:Feishu credentials must be configured first:
Then stop and wait for the user to set up the environment.
The feishu-docx tool cannot handle Mermaid code blocks. Before uploading, check if the Markdown contains any ```mermaid blocks and convert them to images first.
Read the Markdown file and check if it contains any ```mermaid fenced code blocks. If none are found, skip to Step 4.
Copy the original Markdown file to a temp file in the same directory (so relative image paths still work):
For example: blog_post.md → blog_post.feishu-tmp.md
All subsequent modifications happen on this temp copy. The original file is never modified.
For each ```mermaid ... ``` block in the temp file, render it to a PNG image using the mermaid.ink API:
Important: The User-Agent header is required — mermaid.ink returns 403 without it.
Save rendered images to the same directory as the Markdown file, using descriptive filenames based on diagram content:
mermaid-architecture-overview.png, mermaid-data-flow.pngmermaid-1.png, diagram.pngIn the temp copy, replace each ```mermaid ... ``` block with a Markdown image reference:
Use relative paths from the temp file to the rendered images.
From this point, the temp file becomes the <MARKDOWN_FILE_PATH> used in Step 4.
If a temp file was created in Step 3:
*.feishu-tmp.md)Show the user:
If it fails with authentication errors, remind the user to configure credentials:
which feishu-docxpython3 --versionfeishu-docx create "<TITLE>" -f <MARKDOWN_FILE_PATH>