Agents Directory
SkillsRankingsAgents
CategoriesModelsBenchmarksCompareAgent LeaderboardSkillsRankingsAgentsAbout

lark-slides

SkillCommunityTranslated from Chinese

This skill enables AI agents to create and edit Lark Slides presentations. It supports managing slide pages, including creation, deletion, and content replacement, while handling media uploads and template-based generation.

Compatibility:
Claude Code logoClaude CodeCodex logoCodexHermes logoHermesOpenClaw logoOpenClaw
Visit lark-slides
Install:
npx skills add open.feishu.cn/lark-slides
View on skills.sh

slides (v1)

Quick Reference

User RequirementPriority ActionKey Document / Command
Create new PPTPlan with slide_plan.json first, then choose one-step or two-step creation based on complexityplanning-layer.md, visual-planning.md, asset-planning.md, slides +create
Major page rewriteRead existing XML first, write new plan, then replace or rebuild relevant pagesxml_presentations.get, +replace-slide, lark-slides-edit-workflows.md
Edit single title, text block, image, or local elementPrioritize block-level replacement/insertion, do not change page orderslides +replace-slide, lark-slides-replace-slide.md
Read or analyze existing PPTParse slides/wiki token, read full text or single-page XML, save xml_presentation_id, slide_id, revision_idxml_presentations.get, xml_presentation.slide.get
Get slide page screenshotSpecify page using slide_id or page numberslides +screenshot, lark-slides-screenshot.md
Upload or use imagesUpload as file_token first, http(s) external links are prohibitedslides +media-upload, or @./path placeholder in +create --slides
Draw charts with data series (bar/column/line/area/radar/pie) in slideUse native <chart> elementxml-schema-quick-ref.md
Draw flowcharts, sequence diagrams, architecture diagrams, scatter plots, funnel charts, or decorative patterns in slideMust read reference document with Read tool first, then generate <whiteboard> elementlark-slides-whiteboard.md
Use semantic iconsSearch IconPark first, then write <icon iconType="...">iconpark_tool.py search → resolve, iconpark.md
User mentions templates, themes, layoutsSearch templates first, then summarize, crop skeleton if necessarytemplate_tool.py search → summarize → extract
Creation failure, blank page, 3350001, layout anomalyRead status first, then fix according to troubleshooting checklist, do not assume original operation was atomictroubleshooting.md, validation-checklist.md

CRITICAL, Before starting, you MUST use the Read tool to read ../lark-shared/SKILL.md. Authentication, permissions, and global parameters are all governed by lark-shared.

CRITICAL, Before generating any XML, you MUST use the Read tool to read xml-schema-quick-ref.md. Guessing XML structure from memory is prohibited.

CRITICAL, When creating a new presentation or performing a major page rewrite, you MUST first generate .lark-slides/plan/<deck-or-task-id>/slide_plan.json before generating XML. Create the corresponding directory first. See planning-layer.md for planning layer rules and intermediate artifact lifecycles. Small edits like replacing a single title or inserting a block are exempt.

CRITICAL, When creating a new presentation or performing a major page rewrite, you MUST read visual-planning.md before generating XML to ensure layout_type, visual_focus, and text_density actually change the page geometry, main visual, and text volume.

CRITICAL, When creating a new presentation or performing a major page rewrite, planning asset_need MUST follow asset-planning.md: perform metadata planning only, must include fallback_if_missing, and must not require real searching, downloading, or uploading of assets.

CRITICAL, After creation or major rewrite, you MUST perform explicit validation according to validation-checklist.md: read back full XML, verify page count and key elements, check for blank/broken pages, obvious overflows, and layout risks. For XML syntax and text overlap static checks, prioritize using scripts/xml_text_overlap_lint.py.

CRITICAL, During pre-creation self-checks or troubleshooting, you MUST check XML escaping, structure, shell truncation, image tokens, 3350001, and layout risks according to troubleshooting.md.

CRITICAL, If the user mentions "template", "apply template", "reference a certain theme/style/layout", or if the user requirement clearly falls into an existing scenario template (e.g., work report, product introduction, business plan, training, promotion report, etc.), you MUST first perform template search using scripts/template_tool.py search. By default, provide 2-3 best-matching template candidates for the user to choose from. After locking a template, use summarize to obtain theme and layout summaries. Only use extract to crop target page-type XML when a layout skeleton is needed. Do not read the full template XML directly.

[!NOTE] scripts/template_tool.py requires Python 3. references/template-index.json is a script cache/lightweight routing index, not a document for the agent to read by default. assets/templates/*.xml are machine resources and should only be accessed via script summary or extraction; do not read them in full.

CRITICAL, When using templates to generate or rewrite pages, you MUST summarize the target page type first; only extract when a specific layout skeleton is needed.

Editing existing slide pages: Prioritize using +replace-slide (block-level replacement/insertion, do not change page order). See lark-slides-edit-workflows.md for action selection and the full read-modify-write process.

Identity Selection

Feishu slides are typically the user's own content resources. By default, you should prioritize explicitly using --as user to perform slides-related operations, and always specify the identity explicitly.

  • --as user (Recommended): Create, read, and manage presentations as the currently logged-in user. Complete user authorization before execution:
lark-cli auth login --domain slides
  • --as bot: Use only when the user explicitly requests operation as an application, or when the bot needs to hold/create resources. When using bot identity, additionally confirm whether the bot actually has access permissions to the target presentation.

Execution Rules:

  1. Creating, reading, adding/deleting slides, and continuing to edit an existing PPT based on a user-provided link should all default to --as user.
  2. If permission is denied, first check if the bot identity was used by mistake; do not default to the bot.
  3. Only switch to --as bot when the user explicitly requests "operate as application/bot identity" or when the current workflow involves the bot creating resources followed by collaboration authorization.

Pre-execution Checklist

Important: references/slides_xml_schema_definition.xml is the only correct source for this skill's XML protocol; other md files are only summaries of it and the CLI schema.

High-frequency read:

  • xml-schema-quick-ref.md
  • planning-layer.md (New / Major rewrite)
  • visual-planning.md (New / Major rewrite)
  • asset-planning.md (New / Major rewrite)
  • validation-checklist.md (After creation / Major rewrite)

Read on demand:

  • Creation: lark-slides-create.md
  • Editing: lark-slides-edit-workflows.md, lark-slides-replace-slide.md
  • Screenshot: lark-slides-screenshot.md
  • Images: lark-slides-media-upload.md
  • Flowcharts / Sequence diagrams / Architecture diagrams / Decorative patterns: lark-slides-whiteboard.md
  • Icons: iconpark.md, scripts/iconpark_tool.py
  • Templates: template-catalog.md, scripts/template_tool.py
  • Troubleshooting: troubleshooting.md
  • Full protocol: slides_xml_schema_definition.xml

Workflow

This is a presentation, not a document. Each slide is an independent visual frame; information density should be low, and layout should include whitespace.

Design Ideas

Do not generate slides without a sense of design. A plain white background + title + bullets can only serve as a minimalist temporary draft, not a formal delivery.

Before writing XML, determine the deck-level visual strategy in slide_plan.json:

  • Thematic Color Palette: Colors must serve the theme, industry, and audience; do not default to blue business style. If the same set of colors works for another completely different theme, the color scheme is not specific enough.
  • Primary/Secondary Ratio: Choose 1 primary color to carry about 60-70% of visual weight, 1-2 auxiliary colors for structure and partitioning, and 1 accent color used only for key numbers, conclusions, or action points. Do not give all colors the same weight.
  • Background Consistency: Determine the background strategy for the entire deck first; keep the same brightness tone and base color system by default. Only section breaks, transitions, or emphasis pages should intentionally change the background, and changes must be made to look like part of the same design through the same primary color, texture, sidebar, or motif. Regardless of light or dark, ensure sufficient contrast for body text, icons, and lines.
  • Unified Motif: Choose a reusable visual motif to run through the entire document, such as a thick sidebar, circular icon base, semi-bleed image area, numbered nodes, card top-left color blocks, or large numbers. Do not change the decorative language on every page.

Each page must have at least one visual element: image, icon, chart, table, process, comparison structure, large number, schematic, or abstract visual composed of shapes. Text boxes themselves do not count as main visuals.

Prioritize these page forms:

  • Two-column structure: Text on left/image on right or vice versa, visual area occupies 35-45% width.
  • Icon row: Icon on a color block or circular base, with a short title and one sentence of explanation on the right.
  • 2x2 / 2x3 grid: Suitable for capabilities, modules, risks, action items; keep content in each cell at the same level.
  • Semi-bleed visual: Image or abstract shape occupies the left/right half-screen, with text overlaid or aligned to the edge.
  • Large number card: Use 60-72pt numbers for key metrics, accompanied by 10-14pt labels below.
  • Comparison columns: Use side-by-side layout for before/after, plan A/B, problem/solution, with titles and baselines strictly aligned.
  • Timeline/Flowchart: Use nodes and arrows to express steps; the flow direction must be visible at a glance.

Font and spacing suggestions:

  • Titles 36-44pt, key conclusions can be larger; body text 14-18pt; notes 10-12pt.
  • Body text defaults to left-aligned; use center-aligned only for covers, endings, or large number scenarios.
  • Page margins at least 40px; keep 24-40px spacing between content blocks, and maintain consistency within the same deck.
  • Card padding must leave real space; do not let text touch the edges. Consider text box padding when aligning shapes and text.

Common errors to avoid:

  • Do not reuse the same title + three bullets layout for all pages.
  • Do not use low-contrast text or icons, such as light gray text on a light background.
  • Do not let decorative lines cross through text, or let footers, sources, or numbering crowd the main content.
  • Do not represent missing assets as blank image boxes; must generate XML-native visuals according to fallback_if_missing.
  • Do not leave template placeholder text, example company names, example dates, or original template content unrelated to the user's theme.

Creation Method Selection

ScenarioRecommended Method
Simple XML (1-3 pages, simple structure, almost no complex Chinese or special characters)One-step creation with slides +create --slides '[...]'
Complex XML (multi-page, contains Chinese, long text, complex layout, nested quotes, many special characters)Two-step creation: Create blank PPT with slides +create first, then add page by page using xml_presentation.slide create
Appending or inserting pages into existing PPTUse xml_presentation.slide create, combined with before_slide_id if necessary

[!WARNING] The risk of --slides '[...]' lies mainly in shell parameter passing, not just page count. Even for 1 page, if the XML is complex enough, two-step creation is recommended.

[!IMPORTANT] slides +create --slides creates page by page at the underlying level; it is not an atomic operation. If it fails midway, record the xml_presentation_id, read back to confirm current status, then continue to fix or append.

Template and Script Priority Workflow

See template-catalog.md for template details. Main workflow: search first, summarize after locking, extract only when a skeleton is needed; do not read full template XML directly or copy placeholder text.

python3 skills/lark-slides/scripts/template_tool.py search --query "<User requirement original text>" --limit 3
python3 skills/lark-slides/scripts/template_tool.py summarize --template <template-id> --label <Cover|Table of Contents|Section|Content|Ending>
python3 skills/lark-slides/scripts/template_tool.py extract --template <template-id> --label <Page type> --out /tmp/template-slice.xml
Step 1: Requirement clarification & Knowledge reading
  - Clarify theme, audience, page count, style; handle template requirements according to "Template and Script Priority Workflow"
  - Read xml-schema-quick-ref.md; also read planning-layer.md, visual-planning.md, asset-planning.md for new/major rewrites

Step 2: Generate outline → User confirmation → Write slide_plan.json
  - Generate structured outline for user confirmation; if using a template, indicate which template it is based on
  - New/major rewrites must first create directory and write to `.lark-slides/plan/<deck-or-task-id>/slide_plan.json`
  - Execute plan fields, path naming, template boundaries, and `asset_need` structure according to planning-layer.md / asset-planning.md

Step 3: Generate XML according to slide_plan.json → Create
  - Consume plan page by page: key_message for main conclusion, layout_type for geometry, visual_focus for main visual, text_density for text volume
  - When real assets are missing, must use `fallback_if_missing` to generate XML-native fallback visuals; do not leave blank
  - Determine creation method according to "Creation Method Selection"; handle images, complex XML, escaping, and 3350001 troubleshooting according to lark-slides-create.md, media-upload.md, troubleshooting.md

Step 4: Review & Delivery
  - After creation, must use xml_presentations.get to read full XML and perform explicit validation according to validation-checklist.md, including XML text overlap check
  - Handle failures or partial successes according to troubleshooting.md; use `+replace-slide` for local issues
  - If no issues → Delivery: Inform user of presentation ID and access method

jq Command Template (for editing existing PPT)

+create --slides is recommended for new PPTs. The following jq template is suitable for appending pages to an existing presentation, avoiding manual escaping of double quotes:

# Append to the end
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
  <style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
  <data>
    Place elements like shape, line, table, chart, whiteboard here
  </data>
</slide>' '{slide:{content:$content}}')"

# Insert before a specific page: before_slide_id must be in the --data body, at the same level as slide
# ⚠️ Do not put before_slide_id into --params, CLI will silently send it as an unknown query parameter, the server will ignore it, and the new page will go to the end
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide ...>...</slide>' --arg before 'TARGET_SLIDE_ID' \
    '{slide:{content:$content}, before_slide_id:$before}')"

Gradients must use rgba() format with percentage stops, e.g., linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%). Using rgb() or omitting stops will cause the server to fallback to white.

Outline Template

Use the following format when generating an outline for user confirmation:

[PPT Title], [Positioning description], for [Target audience]

Template: [No template used / <category>/<template>.xml (Reason for recommendation)]

Page structure (N pages):
1. Cover page: [Title text]
2. [Page theme]: [Point 1], [Point 2], [Point 3]
3. [Page theme]: [Point description]
...
N. Ending page: [Ending text]

Style: [Color scheme], [Layout style]

Core Concepts

URL Format and Tokens

URL FormatExampleToken TypeHandling Method
/slides/https://example.larkoffice.com/slides/xxxxxxxxxxxxxxml_presentation_idToken in URL path is used directly as xml_presentation_id
/wiki/https://example.larkoffice.com/wiki/wikcnxxxxxxxxxwiki_token⚠️ Cannot be used directly, must query to get the real obj_token first

+replace-slide and +media-upload shortcuts automatically parse the above two URL types; when calling native APIs directly, you still need to parse wiki links manually.

Wiki Link Special Handling (Critical!)

Knowledge base links (/wiki/TOKEN) cannot be used directly as xml_presentation_id. Before calling native APIs directly, query the wiki node first, confirm node.obj_type == "slides", then use node.obj_token as the real presentation ID.

lark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'

Shortcuts +replace-slide and +media-upload automatically parse /wiki/ URLs; you only need to perform this step manually when calling xml_presentations.* / xml_presentation.slide.*.

Resource Relationship

Wiki Space
└── Wiki Node (Knowledge base node, obj_type: slides)
    └── obj_token → xml_presentation_id

Slides (Presentation)
├── xml_presentation_id (Unique presentation identifier)
├── revision_id (Version number)
└── Slide (Slide page)
    └── slide_id (Unique page identifier)

Shortcuts and APIs

Shortcuts are high-level wrappers for common operations (lark-cli slides +<verb> [flags]). Use shortcuts when available.

ShortcutDescription
+createCreate PPT (optional --slides to add pages in one step, supports <img src="@./local.png"> placeholder for automatic upload)
+media-uploadUpload local image to specified presentation, returns file_token (used as <img src="...">), max 20 MB
+replace-slidePerform block-level replacement/insertion (block_replace / block_insert) on existing slide page, automatically injects id and <content/>, does not change page order

Use native APIs when no shortcut covers the operation. High-frequency resources: xml_presentations.get to read full text; xml_presentation.slide.create/delete/get/replace to manage single pages.

lark-cli schema slides.<resource>.<method>   # Must check parameter structure before calling API
lark-cli slides <resource> <method> [flags] # Call API

Important: When using native APIs, you must run schema first to view the --data / --params parameter structure; do not guess field formats.

Core Rules

  1. Plan before writing XML: When creating a new presentation or performing a major page rewrite, you must write to .lark-slides/plan/<deck-or-task-id>/slide_plan.json first; templates, styles, and outlines can only serve as planning input and cannot bypass the planning layer.
  2. Creation process: Simple short XML (1-3 pages, simple structure, few special characters) can be created in one step using slides +create --slides '[...]'; for complex content, images/long Chinese text/nested quotes/many special characters, or more than 10 pages, default to creating a blank PPT with slides +create first, then add page by page using xml_presentation.slide.create.
  3. <slide> direct children are only <style>, <data>, <note>: Text and graphics must be placed inside <data>.
  4. Text expressed via <content>: Must use <content><p>...</p></content>; text cannot be written directly inside a shape.
  5. Save key IDs: Subsequent operations require xml_presentation_id, slide_id, and revision_id.
  6. Delete with caution: Deletion is irreversible, and at least one slide must remain.
  7. Prioritize block-level replacement for editing existing pages: Use +replace-slide (block_replace / block_insert) to modify a single shape/img; do not rebuild the entire page. Only use slide.delete + slide.create when the entire page structure needs to be replaced.
  8. <img src> can only use file_token uploaded to Feishu Drive; http(s) external links are prohibited: The Feishu slides renderer does not proxy external images; external src usually does not display or shows a broken image in PPT. The process must be: "Save image locally → Upload using slides +media-upload or @./path placeholder in +create --slides → Use file_token in <img src>". If the user provides a web image link, curl/download it to CWD first before the upload process; do not put external URLs directly into src. Images max 20 MB (slides upload API does not support chunked upload).

Note: If md content is inconsistent with slides_xml_schema_definition.xml or the output of lark-cli schema slides.<resource>.<method>, the latter two take precedence.

slides (v1)

Quick Reference

用户需求优先动作关键文档 / 命令
新建 PPT先规划 slide_plan.json,再按复杂度选择一步或两步创建planning-layer.md、visual-planning.md、asset-planning.md、slides +create
大幅改写页面先回读现有 XML,写入新 plan,再替换或重建相关页面xml_presentations.get、+replace-slide、lark-slides-edit-workflows.md
编辑单个标题、文本块、图片或局部元素优先块级替换/插入,不改页序slides +replace-slide、lark-slides-replace-slide.md
读取或分析已有 PPT解析 slides/wiki token,回读全文或单页 XML,保存 xml_presentation_id、slide_id、revision_idxml_presentations.get、xml_presentation.slide.get
获取幻灯片页面截图用 slide_id 或页号指定页面slides +screenshot、lark-slides-screenshot.md
上传或使用图片先上传为 file_token,禁止直接写 http(s) 外链slides +media-upload,或 +create --slides 的 @./path 占位符
在 slide 中绘制柱/条/折线/面积/雷达/饼等有数据序列的图表使用原生 <chart> 元素xml-schema-quick-ref.md
在 slide 中绘制流程图、时序图、架构图、散点图、漏斗图或装饰图案必须先用 Read 工具读取参考文档,再生成 <whiteboard> 元素lark-slides-whiteboard.md
使用语义图标先检索 IconPark,再写 <icon iconType="...">iconpark_tool.py search → resolve、iconpark.md
用户提到模板、主题、版式先检索模板,再摘要,必要时裁切骨架template_tool.py search → summarize → extract
创建失败、空白页、3350001、布局异常先回读状态,再按排障清单修复,不假设原操作原子成功troubleshooting.md、validation-checklist.md

CRITICAL — 开始前 MUST 先用 Read 工具读取 ../lark-shared/SKILL.md,认证、权限和全局参数均以 lark-shared 为准。

CRITICAL — 生成任何 XML 之前,MUST 先用 Read 工具读取 xml-schema-quick-ref.md,禁止凭记忆猜测 XML 结构。

CRITICAL — 新建演示文稿或大幅改写页面时,MUST 先生成 .lark-slides/plan/<deck-or-task-id>/slide_plan.json,再生成 XML。先创建对应目录,规划层规则和中间产物生命周期见 planning-layer.md。仅替换一个标题、插入一个块等小型已有页编辑可豁免。

CRITICAL — 新建演示文稿或大幅改写页面时,生成 XML 前 MUST 读取 visual-planning.md,确保 layout_type、visual_focus、text_density 实际改变页面几何、主视觉和文本量。

CRITICAL — 新建演示文稿或大幅改写页面时,规划 asset_need MUST 遵循 asset-planning.md:只做元数据规划,必须有 fallback_if_missing,不得要求真实搜索、下载或上传素材。

CRITICAL — 创建或大幅改写后,MUST 按 validation-checklist.md 做显式验证:回读全文 XML、核对页数和关键元素、检查空白/破损页、明显溢出、布局风险;XML 语法和文本重叠静态检查优先使用 scripts/xml_text_overlap_lint.py。

CRITICAL — 创建前自检或失败排障时,MUST 按 troubleshooting.md 检查 XML 转义、结构、shell 截断、图片 token、3350001 和布局风险。

CRITICAL — 如果用户提到“模板”“套用模板”“参考某种主题/风格/版式”,或用户需求明显落在已有场景模板内(如工作汇报、产品介绍、商业计划书、培训、晋升汇报等),MUST 先用 scripts/template_tool.py 的 search 做模板检索;默认给出 2-3 个最匹配模板候选供用户选择。锁定模板后用 summarize 获取主题和布局摘要;只有需要布局骨架时才用 extract 裁切目标页型 XML。不要直接读取完整模板 XML。

[!NOTE] scripts/template_tool.py 需要 Python 3。references/template-index.json 是脚本缓存/轻量路由索引,不是默认给 agent 阅读的文档;assets/templates/*.xml 是机器资源,只应通过脚本摘要或裁切,不要全文读取。

CRITICAL — 使用模板生成或改写页面时,MUST 先 summarize 目标页型;只有需要具体布局骨架时才 extract。

编辑已有幻灯片页面:优先用 +replace-slide(块级替换/插入,不动页序);选择 action 和完整读-改-写流程见 lark-slides-edit-workflows.md。

身份选择

飞书幻灯片通常是用户自己的内容资源。默认应优先显式使用 --as user(用户身份)执行 slides 相关操作,始终显式指定身份。

  • --as user(推荐):以当前登录用户身份创建、读取、管理演示文稿。执行前先完成用户授权:
lark-cli auth login --domain slides
  • --as bot:仅在用户明确要求以应用身份操作,或需要让 bot 持有/创建资源时使用。使用 bot 身份时,要额外确认 bot 是否真的有目标演示文稿的访问权限。

执行规则:

  1. 创建、读取、增删 slide、按用户给出的链接继续编辑已有 PPT,默认都先用 --as user。
  2. 如果出现权限不足,先检查当前是否误用了 bot 身份;不要默认回退到 bot。
  3. 只有在用户明确要求"用应用身份 / bot 身份操作",或当前工作流就是 bot 创建资源后再做协作授权时,才切换到 --as bot。

执行前必做

重要:references/slides_xml_schema_definition.xml 是此 skill 唯一正确的 XML 协议来源;其他 md 仅是对它和 CLI schema 的摘要。

高频只读:

  • xml-schema-quick-ref.md
  • planning-layer.md(新建 / 大幅改写)
  • visual-planning.md(新建 / 大幅改写)
  • asset-planning.md(新建 / 大幅改写)
  • validation-checklist.md(创建 / 大幅改写后)

按需再读:

  • 创建:lark-slides-create.md
  • 编辑:lark-slides-edit-workflows.md、lark-slides-replace-slide.md
  • 截图:lark-slides-screenshot.md
  • 图片:lark-slides-media-upload.md
  • 流程图 / 时序图 / 架构图 / 装饰图案:lark-slides-whiteboard.md
  • 图标:iconpark.md、scripts/iconpark_tool.py
  • 模板:template-catalog.md、scripts/template_tool.py
  • 排障:troubleshooting.md
  • 完整协议:slides_xml_schema_definition.xml

Workflow

这是演示文稿,不是文档。 每页 slide 是独立的视觉画面,信息密度要低,排版要留白。

Design Ideas

不要生成无设计感的幻灯片。纯白背景 + 标题 + bullets 只能作为极简临时稿,不能作为正式交付。

开始写 XML 前,先在 slide_plan.json 里确定 deck 级视觉策略:

  • 主题化配色:配色必须服务本次主题、行业和受众,不要默认蓝色商务风。如果把同一套颜色换到另一个完全不同主题仍然成立,说明配色不够具体。
  • 主次比例:选择 1 个主色承担约 60-70% 视觉权重,1-2 个辅助色承担结构和分区,1 个强调色只用于关键数字、结论或行动点。不要让所有颜色权重相同。
  • 背景一致性:先确定全 deck 的背景策略,默认保持同一明暗基调和底色体系;只有分节、转场或强调页才有意改变背景,并必须通过相同主色、纹理、边栏或 motif 让变化看起来属于同一套设计。无论深浅,都要保证正文、图标和线条对比充足。
  • 统一 motif:选择一个可复用视觉母题贯穿全文,例如粗侧边栏、圆形图标底、半出血图片区、编号节点、卡片左上角色块或大号数字。不要每页换一套装饰语言。

每页至少要有一个视觉元素:图片、图标、图表、表格、流程、对比结构、大号数字、示意图或由 shape 组成的抽象视觉。文本框本身不算主视觉。

可优先考虑这些页面形态:

  • 双栏结构:左文右图或左图右文,视觉区域占 35-45% 宽度。
  • 图标行:图标在色块或圆形底中,右侧是短标题和一句解释。
  • 2x2 / 2x3 网格:适合能力、模块、风险、行动项,每格内容保持同等层级。
  • 半出血视觉:图片或抽象形状占据左/右半屏,文字覆盖或贴边排布。
  • 大数字卡片:关键指标用 60-72pt 数字,下面配 10-14pt 标签。
  • 对比列:before/after、方案 A/B、问题/解法用左右并列,标题和基线严格对齐。
  • 时间线/流程图:步骤用节点和箭头表达,流程方向必须一眼可见。

字体和间距建议:

  • 标题 36-44pt,关键结论可更大;正文 14-18pt;注释 10-12pt。
  • 正文默认左对齐;只在封面、结尾或大号数字场景中使用居中。
  • 页面边距至少 40px;内容块之间保持 24-40px 间距,并在同一 deck 内保持一致。
  • 卡片内边距要真实留出空间,不要让文字贴边;对齐 shape 和文字时要考虑文本框 padding。

常见错误必须避免:

  • 不要所有页面复用同一种标题 + 三 bullets 版式。
  • 不要用低对比文字或低对比图标,例如浅灰字压在浅色背景上。
  • 不要让装饰线穿过文字,或让页脚、来源、编号挤压主体内容。
  • 不要把素材缺失表现为空白图片框;必须按 fallback_if_missing 生成 XML-native 视觉。
  • 不要留下模板占位文案、示例公司名、示例日期或与用户主题无关的原模板内容。

创建方式选择

场景推荐方式
简单 XML(1-3 页、结构简单、几乎无复杂中文和特殊字符)slides +create --slides '[...]' 一步创建
复杂 XML(多页、含中文、大段文本、复杂布局、嵌套引号、特殊字符较多)两步创建:先 slides +create 创建空白 PPT,再用 xml_presentation.slide create 逐页添加
已有 PPT 继续追加或插入页面使用 xml_presentation.slide create,必要时配合 before_slide_id

[!WARNING] --slides '[...]' 的风险点主要在 shell 参数传递,而不是单纯页数。即使只有 1 页,只要 XML 足够复杂,也建议使用两步创建法。

[!IMPORTANT] slides +create --slides 底层会逐页创建,不是原子操作。中途失败时先记录 xml_presentation_id,回读确认当前状态,再继续修复或追加。

模板与脚本优先流程

模板细则见 template-catalog.md。主流程只记住:先 search,锁定后 summarize,需要骨架时才 extract;不要直接读取完整模板 XML 或照搬占位文案。

python3 skills/lark-slides/scripts/template_tool.py search --query "<用户需求原文>" --limit 3
python3 skills/lark-slides/scripts/template_tool.py summarize --template <template-id> --label <封面|目录|分节|内容|结尾>
python3 skills/lark-slides/scripts/template_tool.py extract --template <template-id> --label <页型> --out /tmp/template-slice.xml
Step 1: 需求澄清 & 读取知识
  - 澄清主题、受众、页数、风格;模板需求按“模板与脚本优先流程”处理
  - 读取 xml-schema-quick-ref.md;新建 / 大幅改写时还要读取 planning-layer.md、visual-planning.md、asset-planning.md

Step 2: 生成大纲 → 用户确认 → 写入 slide_plan.json
  - 生成结构化大纲供用户确认;如使用模板,标明基于哪个模板改写
  - 新建 / 大幅改写必须先创建目录并写入 `.lark-slides/plan/<deck-or-task-id>/slide_plan.json`
  - plan 字段、路径命名、模板边界和 `asset_need` 结构按 planning-layer.md / asset-planning.md 执行

Step 3: 按 slide_plan.json 生成 XML → 创建
  - 逐页消费 plan:key_message 定主结论,layout_type 定几何,visual_focus 定主视觉,text_density 定文本量
  - 缺少真实素材时必须用 `fallback_if_missing` 生成 XML-native 兜底视觉;不要留空
  - 创建方式按“创建方式选择”判断;图片、复杂 XML、转义和 3350001 排查按 lark-slides-create.md、media-upload.md、troubleshooting.md 执行

Step 4: 审查 & 交付
  - 创建完成后,必须用 xml_presentations.get 读取全文 XML,并按 validation-checklist.md 做显式验证记录,包括 XML 文本重叠检查
  - 失败或部分成功按 troubleshooting.md 处理;局部问题优先用 `+replace-slide` 修正
  - 没问题 → 交付:告知用户演示文稿 ID 和访问方式

jq 命令模板(编辑已有 PPT 时使用)

新建 PPT 推荐用 +create --slides。以下 jq 模板适用于向已有演示文稿追加页面的场景,可以避免手动转义双引号:

# 追加到末尾
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
  <style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
  <data>
    在这里放置 shape、line、table、chart、whiteboard 等元素
  </data>
</slide>' '{slide:{content:$content}}')"

# 插到指定页之前:before_slide_id 必须在 --data body 里,与 slide 同级
# ⚠️ 不要把 before_slide_id 写进 --params —— CLI 会当未知 query 参数静默下发,服务端忽略,新页跑到末尾
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide ...>...</slide>' --arg before 'TARGET_SLIDE_ID' \
    '{slide:{content:$content}, before_slide_id:$before}')"

渐变色必须使用 rgba() 格式并带百分比停靠点,如 linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)。使用 rgb() 或省略停靠点会导致服务端回退为白色。

大纲模板

生成大纲时使用以下格式,交给用户确认:

[PPT 标题] — [定位描述],面向 [目标受众]

模板:[未使用模板 / <category>/<template>.xml(推荐原因)]

页面结构(N 页):
1. 封面页:[标题文案]
2. [页面主题]:[要点1]、[要点2]、[要点3]
3. [页面主题]:[要点描述]
...
N. 结尾页:[结尾文案]

风格:[配色方案],[排版风格]

核心概念

URL 格式与 Token

URL 格式示例Token 类型处理方式
/slides/https://example.larkoffice.com/slides/xxxxxxxxxxxxxxml_presentation_idURL 路径中的 token 直接作为 xml_presentation_id 使用
/wiki/https://example.larkoffice.com/wiki/wikcnxxxxxxxxxwiki_token⚠️ 不能直接使用,需要先查询获取真实的 obj_token

+replace-slide 和 +media-upload shortcut 会自动解析以上两种 URL;直接调用原生 API 时仍需手动解析 wiki 链接。

Wiki 链接特殊处理(关键!)

知识库链接(/wiki/TOKEN)不能直接当 xml_presentation_id。直接调用原生 API 前,先查询 wiki 节点,确认 node.obj_type == "slides",再用 node.obj_token 作为真实 presentation ID。

lark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'

Shortcut +replace-slide 和 +media-upload 会自动解析 /wiki/ URL;手动调用 xml_presentations.* / xml_presentation.slide.* 时才需要自己做这一步。

资源关系

Wiki Space (知识空间)
└── Wiki Node (知识库节点, obj_type: slides)
    └── obj_token → xml_presentation_id

Slides (演示文稿)
├── xml_presentation_id (演示文稿唯一标识)
├── revision_id (版本号)
└── Slide (幻灯片页面)
    └── slide_id (页面唯一标识)

Shortcuts 与 API

Shortcut 是对常用操作的高级封装(lark-cli slides +<verb> [flags])。有 Shortcut 的操作优先使用。

Shortcut说明
+create创建 PPT(可选 --slides 一步添加页面,支持 <img src="@./local.png"> 占位符自动上传)
+media-upload上传本地图片到指定演示文稿,返回 file_token(用作 <img src="...">),最大 20 MB
+replace-slide对已有幻灯片页面进行块级替换/插入(block_replace / block_insert),自动注入 id 和 <content/>,不改变页序

没有 Shortcut 覆盖时使用原生 API。高频资源:xml_presentations.get 读取全文;xml_presentation.slide.create/delete/get/replace 管理单页。

lark-cli schema slides.<resource>.<method>   # 调用 API 前必须先查看参数结构
lark-cli slides <resource> <method> [flags] # 调用 API

重要:使用原生 API 时,必须先运行 schema 查看 --data / --params 参数结构,不要猜测字段格式。

核心规则

  1. 先规划再写 XML:新建演示文稿或大幅改写页面时,必须先写入 .lark-slides/plan/<deck-or-task-id>/slide_plan.json;模板、风格和大纲只能作为规划输入,不能绕过规划层
  2. 创建流程:简单短 XML(1-3 页、结构简单、特殊字符少)可用 slides +create --slides '[...]' 一步创建;复杂内容、含图片/中文大段文本/嵌套引号/较多特殊字符,或超过 10 页时,默认先 slides +create 创建空白 PPT,再用 xml_presentation.slide.create 逐页添加
  3. <slide> 直接子元素只有 <style>、<data>、<note>:文本和图形必须放在 <data> 内
  4. 文本通过 <content> 表达:必须用 <content><p>...</p></content>,不能把文字直接写在 shape 内
  5. 保存关键 ID:后续操作需要 xml_presentation_id、slide_id、revision_id
  6. 删除谨慎:删除操作不可逆,且至少保留一页幻灯片
  7. 编辑已有页面优先块级替换:修改单个 shape/img 用 +replace-slide(block_replace / block_insert),不要整页重建;只有需要替换整页结构时才用 slide.delete + slide.create
  8. <img src> 只能用上传到飞书 drive 的 file_token,禁止使用 http(s) 外链 URL:飞书 slides 渲染端不会代理外链图片,外链 src 在 PPT 里通常不显示或显示破图。流程必须是「先把图存到本地 → 用 slides +media-upload 上传或 +create --slides 的 @./path 占位符自动上传 → 拿 file_token 写进 <img src>」。如果用户给了网图链接,先 curl/下载到 CWD 内再走上传流程,不要直接把外链 URL 塞进 src。图片最大 20 MB(slides upload API 不支持分片上传)。

注意:如果 md 内容与 slides_xml_schema_definition.xml 或 lark-cli schema slides.<resource>.<method> 输出不一致,以后两者为准。

Categories:
Document ProcessingProductivity
Share:
Details:
  • Installs


    275,467
  • First seen


    Jun 10, 2026
View Repository

Auto-fetched from GitHub 10 hours ago.

Stats via skills.sh.

Skills similar to lark-slides:

Website favicon

 

 
 
  • Installs


Website favicon

 

 
 
  • Installs


Website favicon

 

 
 
  • Installs


Browse:SkillsRankingsModelsBenchmarksProvidersAgentsAgent LeaderboardCompareCategories
Quick Links:AboutBlog

© 2026 Agents Directory

Skills similar to lark-slides:

lark-drive

Skill
The lark-drive skill enables AI agents to manage files and folders within Lark Drive. It supports operations such as uploading, downloading, moving, deleting, and renaming files, as well as managing document permissions, comments, and version history.
Productivity
Manage files, folders, and document interactions within Lark Drive.
  • Installs


    263,979

lark-doc

Skill
The lark-doc skill enables AI agents to interact with Feishu/Lark Docx documents using the v2 API. It supports creating, reading, editing, summarizing, and translating document content, as well as managing embedded media and whiteboards.
Document ProcessingProductivity
Manage Feishu and Lark Docx documents with full read, write, and edit capabilities.
  • Installs


    275,841

lark-sheets

Skill
This skill enables AI agents to interact with Lark (Feishu) online spreadsheets. It supports creating and managing spreadsheets, manipulating sheet structures, reading and writing cell data, performing batch operations, and managing objects like charts, pivot tables, and conditional formatting.
Document ProcessingProductivity
Manage and manipulate Lark online spreadsheets.
  • Installs


    275,586