원클릭으로
feishu-wiki-to-xhs
从飞书Wiki/文档下载PDF并按逻辑内容块切分为小红书友好格式的竖版图片。触发场景:用户要把飞书文档发小红书、切图、做学习卡片、把文档拆成图片。当用户说'发小红书''切图''把文档切成图片''学习卡片'或提供飞书链接要求切分时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
从飞书Wiki/文档下载PDF并按逻辑内容块切分为小红书友好格式的竖版图片。触发场景:用户要把飞书文档发小红书、切图、做学习卡片、把文档拆成图片。当用户说'发小红书''切图''把文档切成图片''学习卡片'或提供飞书链接要求切分时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when creating PPTX slide decks for Junhao Zhang that should follow his preferred warm research dossier visual language adapted for slides: paper-warm background, Noto Serif SC headings, IBM Plex Sans body, numbered section plates with hard offset shadow, red/teal/ochre/green/cobalt semantic accents, carbon-header matrix tables, formula boxes, callout strips, and editorial typography. This is the slide counterpart of junhao-frontend-style.
Use when creating, redesigning, or QA-reviewing PowerPoint/PPTX decks for Junhao Zhang that should carry the Aiforce-style research dossier visual language from junhao-frontend-style: warm paper background, editorial Chinese serif headings, carbon briefing boards, red/teal/ochre/green/cobalt semantic accents, numbered section plates, matrix tables, SOP timelines, architecture diagrams, and PM-facing research readability. Trigger for requests such as PPT, slides, deck, presentation, 转成PPT, 做一个风格一致的PPT, Aiforce PPT风格, 俊豪PPT风格, or migrating the Junhao frontend dossier style into presentation work.
Use when converting research papers, arXiv PDFs, method notes, or literature summaries into architecture diagrams, architecture-diagram SOPs, or Junhao-style research dossier HTML/report artifacts. Trigger for requests like 论文转架构图, paper to architecture diagram, 架构图 SOP, 论文机制可视化, 模块拆解, 输入输出关键组件关键实现, or when a paper needs to become a PM-readable system blueprint with Junhao frontend style.
Judge whether a research paper, arXiv preprint, proposal, method, or idea has a real innovation point. Use when Codex needs to assess novelty, contribution strength, research taste, prior-work collisions, latest arXiv related work, literature-tree position, challenge-insight coverage, or whether an idea is already covered by recent papers.
This skill should be used when creating or redesigning HTML pages, reports, dashboards, research SOPs, or frontend artifacts for Junhao Zhang. It captures the user's preferred Aiforce-style research dossier visual language: warm paper background, fixed left table of contents, editorial serif Chinese headings, carbon-black briefing panels, red/teal/ochre accents, numbered section blocks, matrix tables, sprint timelines, and practical PM-facing readability.
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.
| name | feishu-wiki-to-xhs |
| description | 从飞书Wiki/文档下载PDF并按逻辑内容块切分为小红书友好格式的竖版图片。触发场景:用户要把飞书文档发小红书、切图、做学习卡片、把文档拆成图片。当用户说'发小红书''切图''把文档切成图片''学习卡片'或提供飞书链接要求切分时使用。 |
| description_zh | 飞书文档→小红书切图 |
| description_en | Feishu doc to XHS images |
| disable | false |
| agent_created | true |
用户要把飞书 Wiki/云文档转成小红书风格的竖版切图。触发词:
lark-cli auth status)/usr/bin/python3 -c "import fitz; import PIL")
/usr/bin/python3 -m pip install PyMuPDF Pillow~/.workbuddy/binaries/python/),原生 .so/.dylib 因 Team ID 签名不匹配会 ImportError,必须用系统 Python /usr/bin/python3Wiki 链接不能直接当 document token 用,必须先 inspect:
lark-cli drive +inspect "<wiki_url>"
从输出中获取 obj_token 和 obj_type(通常是 docx 或 sheet)。
lark-cli doc +export --token <obj_token> --type pdf
等待导出完成,记录返回的 ticket 或 file_token。
cd <目标目录> # 通常是 ~/Downloads
lark-cli doc +export-download --token <obj_token> --type pdf --output-dir '.'
⚠️ +export-download 不接受绝对路径,必须先 cd 再用 --output-dir '.'。
在运行切图脚本前,先用系统 Python 快速查看 PDF 内容结构,确认能正确识别章节标题:
/usr/bin/python3 -c "
import fitz
doc = fitz.open('<pdf_path>')
print(f'Pages: {len(doc)}, Size: {doc[0].rect.width:.0f}x{doc[0].rect.height:.0f}pt')
for i in range(len(doc)):
page = doc[i]
td = page.get_text('dict')
for b in td.get('blocks', []):
if b.get('type') != 0: continue
for line in b.get('lines', []):
spans = line.get('spans', [])
if not spans: continue
max_fs = max(s.get('size', 0) for s in spans)
text = ''.join(s.get('text','') for s in spans).strip()
if max_fs >= 14 and text:
print(f' p{i+1} y={line[\"bbox\"][1]:.0f} fs={max_fs:.1f} | {text}')
"
fs >= 14 的行被视为章节标题/分割点--min-split-font 参数/usr/bin/python3 ~/.workbuddy/skills/feishu-wiki-to-xhs/scripts/split_pdf_for_xhs.py \
"<pdf_path>" \
"<output_dir>" \
--dpi 200 \
--min-split-font 14
参数说明:
pdf_path: Step 3 下载的 PDF 文件路径output_dir: 输出目录(可选,默认在 PDF 同目录下创建 <文件名>_xhs/)--dpi: 渲染分辨率,200 适合小红书(默认 200)--min-split-font: 最小标题字号,>=此值的行作为分块起点(默认 14)ls -lh "<output_dir>/"
确认:
脚本会自动检测章节标题并分块。如果自动分块效果不理想(如标题字号太小未被识别、某些块太大或太小),可以:
--min-split-font:识别更多分割点(适合字号较小的文档)clip 参数精确指定 y 坐标手动分块模板(见 @references/manual-split-template.py):
import fitz
from PIL import Image
from pathlib import Path
pdf_path = Path('<pdf_path>')
out_dir = Path('<output_dir>')
out_dir.mkdir(parents=True, exist_ok=True)
doc = fitz.open(str(pdf_path))
dpi = 200
scale = dpi / 72
page_w = doc[0].rect.width
# Define logical blocks: (label, [(page_idx, y_top, y_bottom), ...])
blocks = [
("01_封面", [(0, 0, 633)]),
("02_第一章", [(0, 640, 842), (1, 0, 600)]), # cross-page
# ... add more
]
for label, segments in blocks:
segment_images = []
for page_idx, y_top, y_bot in segments:
page = doc[page_idx]
clip = fitz.Rect(0, y_top, page_w, y_bot)
mat = fitz.Matrix(scale, scale)
pix = page.get_pixmap(matrix=mat, clip=clip, alpha=False)
img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples)
segment_images.append(img)
total_w = max(img.width for img in segment_images)
total_h = sum(img.height for img in segment_images)
combined = Image.new("RGB", (total_w, total_h), (255, 255, 255))
y_offset = 0
for img in segment_images:
combined.paste(img, (0, y_offset))
y_offset += img.height
out_path = out_dir / f"{label}.png"
combined.save(str(out_path), optimize=True)
~/.workbuddy/binaries/python/ 下 PyMuPDF/pypdfium2 的 .so 因 Team ID 不匹配会 ImportError,必须用 /usr/bin/python3+export-download 的 --output-dir 只接受相对路径,先 cd 到目标目录+inspect 解包,不能直接用 Wiki URL 里的 token--min-split-fontsips 或 file 检查图片尺寸:sips -g pixelWidth -g pixelHeight <img>