SuperAPI AI Directory

lark-whiteboard

Coding & development

View repository

Updated 10-16 09:28

About this skill

whiteboard (v1)

CRITICAL — Before starting, you MUST first use the Read tool to read ../lark-shared/SKILL.md, which contains authentication and permission handling

Core Concepts

Whiteboard Token

The whiteboard token is the unique identifier of a whiteboard. Feishu whiteboards are embedded in cloud documents and can be obtained from the cloud document's docs +fetch results (<whiteboard token="xxx"/> tag), or from the docs +update field after creating a new whiteboard with data.board_tokens .

Quick Decision

When you need to insert a chart:

  1. Can Feishu Whiteboard be used?
    • Yes → Use the whiteboard path (recommended! editable and collaborative)
    • No → Use the image path
User Need Recommended Shortcut
"View the content of this whiteboard" +query --output_as image
"Export the whiteboard as an image" +query --output_as image
"Get the PlantUML/Mermaid code of the whiteboard" +query --output_as code
"Check whether the whiteboard consists of PlantUML/Mermaid code blocks" +query --output_as code
"Modify the color or text of a node in the whiteboard" +query --output_as raw after +update
"Draw a whiteboard with PlantUML" +update --input_format plantuml
"Draw a whiteboard with Mermaid" +update --input_format mermaid
"Draw a complex chart on the whiteboard" +update --input_format raw, you need to use the whiteboard-cli tool, see lark-whiteboard-cli

Shortcuts

Shortcut Description
+query Query a whiteboard and export it as a preview image, code, or raw node structure
+update Update whiteboard content, supporting PlantUML, Mermaid, or OpenAPI native format input

Workflow

Scenario 1: Create a whiteboard

  1. Determine the whiteboard Token to create (obtained from the user request or the corresponding document) and the content to create
  2. Refer to lark-whiteboard-cli to generate whiteboard content
  3. Use the +update shortcut to update whiteboard content

Scenario 2: Modify or optimize a whiteboard

  1. Determine the whiteboard Token to modify (obtained from the user request or the corresponding document)
  2. Use the +query --output_as code shortcut to export the whiteboard code and confirm whether the whiteboard is drawn with Mermaid or PlantUML
    1. If +query --output_as code returns Mermaid / PlantUML code blocks, optimize and modify based on this code
    2. If no code blocks are returned, use +query --output_as image to get the whiteboard preview image, and refer to the image content lark-whiteboard-cli to redraw and optimize
    3. If the user only needs to simply modify the text content/color of a node, you can use the +query --output_as raw shortcut to export the whiteboard's native OpenAPI format and modify it based on that.
    4. If the user has explicit requirements, the user's requirements take priority.
  3. Use the +update shortcut to create new whiteboard content. Depending on the user's needs, you may need to use docs +update to create a new whiteboard, or use +update --overwrite to overwrite-update the original whiteboard.

Usage with lark-doc

Scenario 1: Get the whiteboard token from a document

  1. Use lark-doc of +fetch to get the document content
  2. Parse the <whiteboard token="xxx"/> tag from the returned markdown, and record the whiteboard token
  3. Use this skill's +query or +update to read or operate the whiteboard

Scenario 2: Create a new whiteboard and edit it (complete workflow)

This is the most common usage scenario,the following steps must be fully executed:

  1. Use lark-doc of +update to create a blank whiteboard

    • Pass in the markdown <whiteboard type="blank"></whiteboard>
    • Note that this XML tag should not be escaped
    • When multiple whiteboards are needed, repeat multiple whiteboard tags
  2. From the response's data.board_tokens , get the token list of the newly created whiteboards

    • Record the chart type and position corresponding to each token
  3. Based on the document topic, design the corresponding content for each whiteboard

    • Refer to the "Common Chart Templates and Reference Guide" below to choose the appropriate syntax
    • Use Mermaid (recommended), PlantUML, or lark-whiteboard-cli to generate content
  4. Update the whiteboards one by one: Use this skill's +update shortcut to edit the content of each whiteboard

    • Do not miss any whiteboard token
    • Ensure that each whiteboard has actual content, not blank

Common Chart Templates and Reference Guide

Chart Type Recommended Syntax Detailed Reference Guide
Architecture Diagram whiteboard-cli DSL lark-whiteboard-cli/scenes/architecture.md
Flowchart whiteboard-cli DSL lark-whiteboard-cli/scenes/flowchart.md
Organizational Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/organization.md
Milestone/Timeline whiteboard-cli DSL lark-whiteboard-cli/scenes/milestone.md
Fishbone Diagram whiteboard-cli DSL lark-whiteboard-cli/scenes/fishbone.md
Comparison Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/comparison.md
Flywheel Diagram whiteboard-cli DSL lark-whiteboard-cli/scenes/flywheel.md
Pyramid Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/pyramid.md
Mind Map/Pie Chart/Sequence Diagram/Class Diagram Mermaid lark-whiteboard-cli/scenes/mermaid.md
Bar Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/bar-chart.md
Line Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/line-chart.md
Tree Diagram whiteboard-cli DSL lark-whiteboard-cli/scenes/treemap.md
Funnel Chart whiteboard-cli DSL lark-whiteboard-cli/scenes/funnel.md
Swimlane Diagram whiteboard-cli DSL lark-whiteboard-cli/scenes/swimlane.md