SuperAPI AI Directory

lark-slides

Office & productivity

View repository

Updated 10-13 21:32

About this skill

slides (v1)

This skill document is relatively long. You must use the Read tool to read it twice, and you must read the entire text.

Authoritative Experience

Authoritative experience consists of global hard constraints and high-frequency error-prone points. You must keep them firmly in mind and strictly comply with them.

  • You have ample time to complete this PPT. Quality is always more important than speed.
  • The PPT size is 960x540. You must strictly ensure that the main content is within the page boundaries.
  • !!!Delivering output without images is prohibited!!! You must use a large number of images to enhance the visual effect!!! Reusing the same image is prohibited!!!
  • The main visual on the cover page must be <img>(from an image generation tool or image search tool). Do not use <shape> or <icon> to compose the cover visual.
  • It is prohibited to use <shape> and <line> to imitate specific objects. You must use <img>。
  • It is prohibited to place headline or title below rect or <line>。
  • It is prohibited to use meaningless decorative lines or color block strips inside any page. Do not use narrow edge-hugging strips on any side of the page.
  • The instruction parameters for the image generation tool must end with “不要出现任何文字和颜色色号” to avoid distracting text appearing on the generated images.
  • Using emoji icons is prohibited. They must not appear anywhere.
  • Font size must be explicitly set on the <content> of fontSize . Do not rely on the default font size fallback of textType . These fallback values are obviously too large.
  • For <content> with large numbers, large font sizes, or many characters, you must set the wrap="true" autoFit="normal-auto-fit" property for automatic line wrapping and indentation to avoid text overflow.
  • Text color must use the <content> of color property, not the fontColor property.
  • Text line spacing must set the <content> of lineSpacing="multiple:xx" or lineSpacing="fixed:xx" rather than lineSpacing="xx"。
  • Images must use <img> rather than <image>。
  • IconPark icons must be filled with color (set <fill><fillColor color="rgba(R,G,B,A)"/></fill>) and have sufficient contrast with the background.
  • When drawing charts, native charts (bar, horizontal bar, line, area, pie (donut), radar, combination charts) use <chart>. For others (funnel chart, pyramid chart, quadrant chart, matrix chart, etc.) use <shape> + <line> to simulate.
  • To hide the legend of <chart> , you can only do so by not writing or deleting <chartLegend> .<chartLegend> does not support position="none"。
  • For tables, prefer using rect and text to simulate. For others, use <table>. Without <shape type="table">。
  • You must set the <table> of width and height to fix the table size. At the same time, set the <col> of width and <tr> of heightfor columns or rows whose width or height needs to be preserved. The rest are allocated automatically.
  • <td> The direct child elements are only <fill>(background),<content>(text), and border configuration (generally not used). It cannot nest <shape>、<img>、<icon>。
  • <shape type="rect"> It is only a shape, not a container.<icon>、<img>、<shape type="text"> and other <shape> must be placed at the same level as it and stacked by coordinates.
  • Fill gradient colors must use <fill><fillColor color="linear-gradient(135deg, rgba(R,G,B,A) 0%, rgba(R,G,B,A) 100%)"/></fill>。
  • Before editing the page, you must read workflow/slides-editing.md。
  • Before drawing charts, you must read xml/slides_chart_demo.xml。
  • When the user requests a lossless retelling of the historical context, the above authoritative experience, required skill documents (which need to be re-read), and error-prone element syntax (especially <table> and <chart>)。

Doubao Design Principles

Scope of Application:

  • The design of ordinary content pages must take the Doubao Design Principles as the highest guideline, unless the user requests the use of a template or directly provides a design plan.
  • Not applicable to title-cover、section-divider、conclusion、quote-highlight and big-number。

Core Requirements:

  • A graphic card layout with extremely high information density must be adopted, pursuing a full, rich, and line-by-line readable layout; better dense and full than empty and sparse.
  • !!!Extremely high information density!!! Many images!!! Many cards!!! Many words!!!

Layout:

  • Card layout: Cards fill the page in a multi-row grid, with a symmetrical, balanced layout and no blank space. The number of grids and the image-text ratio vary according to the content, avoiding similarity on every page. Use more cards for segmented carrying, and avoid piling up large amounts of text in a single card (for example, 8 cards of 50 words are better than 2 cards of 200 words); multiple key points must be split into multiple sub-cards.
  • Card style: Square-corner cards + semi-transparent fill + no border + narrow strip attached to the card edge (optional); all cards must use the same color scheme (except for a small number of cards that need emphasis); rainbow cards must not appear on the same page (more than 3 card colors).
  • Card structure: Visual anchor (keyword, number, or IconPark icon) + title + content (including text, images, charts, sub-cards).
  • Text cards: Most pages must meet 6-8 text cards and 200-400 words; when the word count is insufficient, it must be expanded into long sentences or paragraphs; text cards must not leave blank space and must be full and substantial. Text cards are not short labels, but "title + complete explanation," like condensed analytical manuscripts. When the text content has to use lists, columns, keywords, or short sentences, clear hierarchy must be ensured, and splitting into multiple sub-cards is more recommended.
  • Image cards: Most pages must meet 1-3 image cards; when images are lacking, image generation tools must be used to supplement illustrations; image cards and text cards form a grid to ensure rich graphic content.
  • Chart cards: Data information must not be listed in text cards; it must be visualized in chart cards (including tables, charts, timelines, flowcharts, etc.); chart cards form a grid with other cards to demonstrate data-driven presentation.
  • Spacing requirements: All margins must be left-right symmetrical; the margins of the page and internal content must be at least 40px (content must not touch the edge); the margins of cards and internal text must be at least 5px (text must not touch the edge); cards must maintain 20-40px spacing between each other.
  • Text alignment: Body text is left-aligned by default; centered alignment is used only on covers, endings, or large-number scenarios; in tables, text is left-aligned, numbers are right-aligned, and only keywords or short sentences are center-aligned.

Visual Style:

  • Aesthetics: Clean, bright, refreshing but information-rich; rely on cards and aligned grids to maintain a sense of order under high density; the amount of text in cards in the same row should be similar to keep the look neat.
  • Font: The entire piece is mainly sans-serif (Source Han Sans); serif may be used sparingly on covers or for key emphasis.
  • Font size: Titles 28-36pt, body text 12-14pt, annotations 10-12pt; regular key indicators 16-32pt, core indicators use 36-52pt numbers, with 10-14pt labels and brief interpretations below; smaller font sizes are allowed when more text needs to be accommodated.
  • Icon: Use embedded IconPark icons (which can be replaced by keywords or numbers) as visual anchors, so that high-density text also has graphic rhythm instead of being a solid block of plain text.
  • Color scheme: Restrain the number of colors and ensure that all pages use only the same 1 background color (preferably light off-white), 1 primary color, 1 accent color, and 1 auxiliary color; prefer Morandi color schemes; rainbow color schemes are prohibited (for example, blue with orange).

Quick Reference

This table only identifies "scenario -> which command to use, which document to read." For parameters, refer to the corresponding document in "Must Do Before Execution" and lark-cli slides +<verb> --help . Do not fill in parameters from memory or by analogy with other commands.

User need Preferred action Key document / command
Create a new PPT Plan first slide_plan.json, then choose one-step or two-step creation according to the number of pages planning-layer.md、visual-planning.md、asset-planning.md、cli/lark-slides-create.md、slides +create、slides +add-slide、cli/lark-slides-add-slide.md(two-step creation adds pages one by one)
The user requires using a template, or provides a PPTX file and asks for modification or beautification Import the template as Slides, then edit workflow/template-editing.md
Edit a single title, text block, image, or local element Block-level replacement/insertion,only touch the named block; other elements on the same page are unaffected; do not change page order slides +replace-slide、cli/lark-slides-replace-slide.md
Many changes on one page (batch fonts/color scheme), need to change the page background, need to delete several elements Whole-page overwrite,slide_id and the page order remain unchanged; elements written back with the original id keep their id, while those without id will be inserted as new elements and get new ids;the cost is that elements not written into --content will be deleted, so do not use it to modify individual elements slides +update-slide、lark-slides-update-slide.md
Append or insert pages into an existing PPT One page at a time,--slide supports @file to bypass shell escaping slides +add-slide、cli/lark-slides-add-slide.md
Delete pages By slide_id single-page deletion; read back to confirm before deleting slides +delete-slide、cli/lark-slides-delete-slide.md
Read or analyze an existing PPT Parse slides/wiki token, use shortcut to read back the full text or single-page XML, save xml_presentation_id、slide_id、revision_id slides +xml-get(for a single page pass --slide-id or --slide-number)、cli/lark-slides-xml-presentations-get.md
View or roll back historical versions First use +history-list to find history_version_id, then +history-revert, and if necessary +history-revert-status poll cli/lark-slides-history.md
Get slide page screenshots By page number use --slide-number, by ID use --slide-id; for a single image use --output, for batch or full use --output-dir, execute serially with at most 10 pages per batch; the screenshot directory reuses the same task's deck/task identifier, and subsequent reads return the actual path slides +screenshot、cli/lark-slides-screenshot.md
Download image --output optional; when passed, specify a single file path; when not passed, automatically save to the default directory .lark-slides/media, and generate the path according to the response file name/type; after calling, read the returned path, do not guess the file name; when direct connection is rejected, automatically fall back to source file preview slides +media-download --file-token <file_token>
Upload or use an image First upload as file_token, direct http(s) external links are prohibited slides +media-upload、cli/lark-slides-media-upload.md, or +create --slides in the XML write <img src="@./path"> placeholder
Draw a chart Native charts (column, bar, line, area, pie (donut), radar, combo) use <chart>, others (funnel chart, pyramid chart, quadrant chart, matrix chart, etc.) use <shape> + <line> simulation xml/xml-schema-quick-ref.md、xml/slides_chart_demo.xml
Draw tables Prefer rect and text simulation, others use <table> xml/xml-schema-quick-ref.md
Use icons Do not blindly guess iconType; you must first search IconPark, then write <icon iconType="...">, icons must be filled with color and have sufficient contrast with the background; emoji icons are prohibited iconpark_tool.py search → resolve、xml/iconpark.md
Creation failure, blank page, 3350001, layout abnormality First read back the state, then fix according to the troubleshooting checklist; do not assume the original operation succeeded atomically workflow/error-handling.md、workflow/validation-xml.md

CRITICAL — Before starting, you MUST first use the Read tool to read ../lark-shared/SKILL.md; authentication, permissions, and global parameters are all subject to lark-shared.

CRITICAL — Before viewing or rolling back historical versions, you MUST first read cli/lark-slides-history.md. The rollback interface only accepts history_version_id; do not pass revision_id directly to +history-revert。

CRITICAL — Before generating any XML, you MUST first use the Read tool to read xml/xml-schema-quick-ref.md; do not guess the XML structure from memory.

CRITICAL — When creating a new presentation or substantially rewriting pages, you MUST first generate .lark-slides/plan/<deck-or-task-id>/slide_plan.json, then generate the XML. First create the corresponding directory; for planning-layer rules and intermediate artifact lifecycle, see planning-layer.md. Small edits to existing pages, such as replacing a single title or inserting a single block, may be exempt.

CRITICAL — When creating a new presentation or substantially rewriting pages, before generating XML you MUST read visual-planning.md, to ensure layout_type、visual_focus、text_density actually changes the page geometry, key visual, and text volume.

CRITICAL — When creating a new presentation or substantially rewriting pages, planning asset_need MUST follow asset-planning.md: only do metadata planning, there MUST be fallback_if_missing, and it must not require real searching, downloading, or uploading of assets.

CRITICAL — Before submitting the complete <slide> XML to slides +create、slides +add-slide or slides +update-slide , you MUST first save the XML to be submitted to a local file and run the sole layout gatekeeper entrance scripts/xml_lint.py;summary.error_count must be 0 before calling the interface.

CRITICAL — After creation, substantial rewriting, or full-page write-back, you MUST perform explicit verification according to workflow/validation-xml.md : read back the full XML text, verify the page count and key elements, and use scripts/xml_lint.py to uniformly check XML, out-of-bounds, overlap, blank pages, and content sparsity risks.

CRITICAL — During pre-creation self-check or failure troubleshooting, you MUST check XML escaping, structure, shell truncation, image tokens, 3350001, and layout risks according to workflow/error-handling.md .

Edit an existing slide page: For a single title, text block, image, or local element, prefer +replace-slide(block-level replacement/insertion, without changing page order); when there are many changes on one page (for example, batch font replacement), the background needs to be changed, or several elements need to be deleted, use +update-slide full-page overwrite (slide_id and page order remain unchanged, but elements not written into --content will be deleted);For major changes across multiple pages, run +update-slideonce for each page. For choosing the action and the complete read-modify-write process, see workflow/slides-editing.md。

The user requires using a template: handle according to workflow/template-editing.md .

Identity selection

Feishu slides are usually the user's own content resources.By default, explicitly use --as user(user identity) to perform slides-related operations, always specify the identity explicitly.

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

Execution rules:

  1. For creating, reading, adding/deleting slides, and continuing to edit an existing PPT based on a link provided by the user, by default first use --as user。
  2. If insufficient permissions occur, first check whether the bot identity was mistakenly used; do not fall back to bot by default.
  3. Only switch to --as bot。

Must do before execution

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

High-frequency read-only:

Before calling related commands, you must read the relevant documentation to understand how to use the commands:

Workflow

Design Ideas

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

Before starting to write XML, first determine the deck-level visual strategy in slide_plan.json :

  • Themed color scheme: The color scheme must serve this topic, industry, and audience; do not default to a blue business style. If the same set of colors still works when switched to another completely different topic, the color scheme is not specific enough.
  • Primary-secondary ratio: Choose 1 primary color to carry about 60-70% of the visual weight, 1 secondary color for structure and zoning, and 1 accent color only for key numbers, conclusions, or action points. Do not let all colors have the same weight.
  • Background consistency: First determine the background strategy for the entire deck, and by default keep the same light/dark tone and base color system; whether light or dark, ensure sufficient contrast between content and background.
  • Unified motif: Choose one reusable visual motif that runs through the whole document, such as numbered nodes, card treatment, semi-bleed image areas, titles, or footers. 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, or large number. A text box itself does not count as the main visual.

Common page forms:

  • Two-column structure: text on the left and image on the right, or image on the left and text on the right; the visual area occupies 35-45% of the width.
  • Icon row: the icon is in a color block or circular background, with a short title and one sentence of explanation on the right.
  • Grid: suitable for capabilities, modules, risks, and action items, with each cell keeping the same hierarchy level.
  • Half-bleed visuals: the image occupies the left/right half of the screen, with text overlaid or aligned to the edge.
  • Large number cards: use large numbers for core metrics, with labels and brief interpretations below.
  • Comparison columns: before/after, option A/B, and problem/solution are placed side by side, with headings and baselines strictly aligned.
  • Timeline/flowchart: express steps with nodes and arrows, and the flow direction must be visible at a glance.

Common mistakes must be avoided:

  • Do not reuse the same title + three bullets layout on all pages.
  • Do not use low-contrast text or low-contrast icons, such as light gray text on a light background.
  • Do not let decorative lines cross through text, or let the footer, source, or numbering squeeze the main content.
  • Do not present missing assets as blank image frames; you must follow fallback_if_missing to generate a replacement image.
  • Do not use emoji icons in any position.

Generation process

Step 1: 需求分析 & 读取知识
  - 分析主题、受众、页数、风格;
  - 若用户要求使用模板,按 workflow/template-editing.md 处理
  - 读取 xml/xml-schema-quick-ref.md;新建 / 大幅改写时还要读取 planning-layer.md、visual-planning.md、asset-planning.md
  - 涉及图表读取 xml/slides_chart_demo.xml

Step 2: 生成大纲 → 写入 slide_plan.json
  - 生成结构化大纲
  - 新建 / 大幅改写必须先创建目录并写入 `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` 生成替代图片,不要留空
  - 读 cli/lark-slides-create.md 定一步创建还是两步创建,并据此构造 `slides +create`;两步创建再读 cli/lark-slides-add-slide.md 用 `+add-slide` 逐页添加
  - 图片按 cli/lark-slides-media-upload.md 处理;复杂 XML、转义和 3350001 排查按 workflow/error-handling.md 执行

Step 4: 审查 & 交付
  - 创建完成后,必须用 `slides +xml-get --presentation <xml_presentation_id>` 读取全文 XML,并按 workflow/validation-xml.md 做显式验证记录,包括 XML 文本重叠检查
  - 失败或部分成功按 workflow/error-handling.md 处理;局部问题优先用 `+replace-slide` 修正
  - 没问题 → 交付:使用 NotifyHuman 工具交付 PPT 链接

Gradients must use the rgba() format with percentage stops, such as 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 fall back to white.

Outline template

Use the following format when generating an outline:

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

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

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

Core concepts

URL formats and tokens

URL formats Examples Token types Handling method
/slides/ https://example.larkoffice.com/slides/xxxxxxxxxxxxx xml_presentation_id The token in the URL path is directly used as the xml_presentation_id usage
/wiki/ https://xxx.feishu.cn/wiki/wikcn_EXAMPLE_NODE_TOKEN_123456 wiki_token ⚠️ Cannot be used directly; you need to query first to obtain the real obj_token

With --presentation slides shortcuts will automatically resolve the above two URL types.

Special handling for Wiki links (critical!)

Knowledge base links (/wiki/TOKEN) cannot be directly used as xml_presentation_id. When using the Slides shortcut, pass in the link directly, and the CLI will query the node, validate data.obj_type == "slides" , and use data.obj_token。

lark-cli wiki +node-get --node-token 'https://xxx.feishu.cn/wiki/wikcn_EXAMPLE_NODE_TOKEN_123456' --as user --format json

Node resolution must use the same identity as subsequent Slides operations; when downstream explicitly uses --as bot , change this to --as bot。

With --presentation slides shortcuts will automatically resolve /wiki/ URLs and validate obj_type。

Resource relationships

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

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

Shortcuts

Slides-related operations use shortcuts (lark-cli slides +<verb> [flags])。

Shortcut Description
+create Create a PPT, optionally adding pages in one step
+add-slide Append or insert into an existing presentationone page(--before-slide-id controls position), XML supports @file / stdin,<img src="@./path"> placeholders for automatic upload
+delete-slide Delete by slide_id one pageone page
+xml-get Read the full text or single-page XML; use --presentation to specify the presentation, pass --slide-id or --slide-number; use --output to save the XML to a local file (must be a relative path within CWD, such as .lark-slides/plan/<deck>/readback.xml)
+screenshot Save a screenshot of the slide page as a local image; use --slide-number to specify the page number (starting from 1; pass multiple times for multiple pages) or use --slide-id to specify the page; for a single image use --output .lark-slides/screenshots/<deck-or-task-id>/page-01, for batch use --output-dir .lark-slides/screenshots/<deck-or-task-id>(at most 10 pages at a time); subsequently you must read the returned output / screenshots[].path
+media-upload Upload a local image to the specified presentation, returning file_token(used as <img src="...">), maximum 20 MB
+media-download Based on the Slides image file_token download a local image;--output optional; if not passed, use --output-dir default value .lark-slides/media and automatically generate the file name; after calling, use the returned path, do not guess the actual path; when direct download has no permission, automatically fall back to the source file preview
+replace-slide Perform block-level replacement/insertion on an existing slide page (block_replace / block_insert), automatically inject id and <content/>, without changing the page order
+update-slide Hand an entire page of XML to an existing page, and the page becomes as described by --content ; can modify styles/insert/delete/notes/background in one go,slide_id and the page order remain unchanged.Elements not written into --content will be deleted

Slides operations already covered by this skill must use the shortcuts in the table above; before execution, read the corresponding reference and execute according to its parameters and constraints.

Core rules

  1. Plan before writing XML: when creating a new presentation or substantially rewriting pages, you must first write .lark-slides/plan/<deck-or-task-id>/slide_plan.json; templates, styles, and outlines can only serve as planning input and must not bypass the planning layer
  2. Creation process: for creating a new presentation use slides +create, whether to create in one step or two steps is determined by cli/lark-slides-create.md determine
  3. <slide> direct child elements are only <style>、<data>、<note>: text and graphics must be placed inside <data> inside
  4. Text is expressed through <content> expressed: must use <content><p>...</p></content>, do not write text directly inside a shape; do not confuse the XML element <content> and --parts JSON field: when writing --parts ,block_replace load XML using the standard field replacement,block_insert use insertion
  5. Save key IDs: subsequent operations require xml_presentation_id、slide_id、revision_id
  6. Delete with caution: deletion is irreversible; before deleting, read back to confirm slide_id
  7. For editing existing pages, prioritize updating via the original link: to modify a single shape/img use +replace-slide(block_replace / block_insert), do not rebuild the entire page; if a page has many changes or the background needs to be changed use +update-slide full-page overwrite (preserving slide_id and page order); for multi-page full-page rebuilds, run +update-slideonce for each page; do not use slides +create to create an entire new PPT; to append/insert a single page use +add-slide, to delete a single page use +delete-slide
  8. <img src> can only use file_tokenuploaded to Feishu drive; using http(s) external link URLs is prohibited: the Feishu slides rendering side will not proxy external link images; external link src usually does not display in PPT or displays a broken image. The process must be "first save the image locally → use slides +media-upload upload, or in +create --slides XML write <img src="@./path"> placeholder to auto-upload → get file_token write into <img src>". If the user provides an online image link, first curl/download to CWD and then go through the upload process; do not directly put the external link URL into src。Images maximum 20 MB(media upload does not support chunking).

Note: if the md content is inconsistent with xml/slides_xml_schema_definition.xml , the latter shall prevail.