lark-whiteboard

SkillCommunityTranslated from Chinese

This skill enables AI agents to interact with Lark Whiteboards for creating, querying, and updating diagrams. It supports various formats including Mermaid, PlantUML, and raw JSON structures to facilitate automated visual documentation.

Install:
npx skills add open.feishu.cn/lark-whiteboard

[!IMPORTANT]

  • Run lark-cli --version to confirm availability, no need to ask the user.
  • Run npx -y @larksuite/whiteboard-cli@^0.2.11 -v to confirm availability, no need to ask the user.

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


Quick Decision

User RequirementAction
View whiteboard content / Export as image+query --output_as image
Get Mermaid/PlantUML code of the whiteboard+query --output_as code
Check if the whiteboard was drawn by code+query --output_as code
Modify node text/color (simple changes)+query --output_as raw → Manually edit JSON → +update --input_format raw
User has already provided Mermaid/PlantUML code, or explicitly specified the formatGenerate/use code yourself → +update --input_format mermaid/plantuml
Draw complex charts (architecture/flow/org, etc.)§ Creation Workflow
Modify/redraw existing complex whiteboard§ Modification Workflow

Shortcuts

ShortcutDescription
+queryQuery whiteboard, export as preview image, code, or raw node structure
+updateUpdate whiteboard, supports PlantUML, Mermaid, or OpenAPI native format

Creation Workflow

This workflow is used for creating a whiteboard independently. When creating multiple whiteboards in batches within a document, lark-doc is responsible for scheduling. See references/lark-doc-whiteboard.md in the lark-doc skill.

Step 1: Get board_token

What the user providedHow to obtain
Provided whiteboard token (wbcnXXX) directlyUse directly
Document URL or doc_id, whiteboard already exists in doclark-cli docs +fetch --api-version v2 --doc <URL> --as user, extract from the returned <whiteboard token="xxx"/>
Document URL or doc_id, need to create a new whiteboardlark-cli docs +update --api-version v2 --doc <doc_id> --command append --content '<whiteboard type="blank"></whiteboard>' --as user, obtain from the response data.new_blocks[0].block_token (the one where block_type == "whiteboard"; see lark-doc SKILL.md for parameter details)

Step 2: Render & Write

→ Proceed to the § Render & Write Whiteboard section, and return the result to the user directly after completing the process.


Modification Workflow

Step 1: Get board_token (Same as Creation Workflow Step 1)

Step 2: Determine modification strategy

+query --output_as code
  ├─ Returns Mermaid/PlantUML code
  │   → Modify the original code → +update --input_format mermaid/plantuml
  ├─ No code (Whiteboard drawn via DSL or other methods)
  │   ├─ Only change text/color → +query --output_as raw → Manually edit JSON → +update --input_format raw
  │   └─ Redraw/Structural adjustment → +query --output_as image → View image then proceed to [§ Render & Write Whiteboard]
  └─ User has explicit requirements → Prioritize user requirements

Render & Write Whiteboard

Rendering Routing

State your identity first: Based on the training source, which family do you belong to? Claude / Gemini / GPT / GLM / Doubao or Seed / Other. Your identity determines the SVG / DSL routing (different families have uneven capabilities for these two expression languages), do not skip this step.

Then select the path based on chart type × identity, read the corresponding file and execute according to its complete workflow (including reading scene guides, generating content, rendering review, and delivery):

Chart TypeIdentityPath
Mind map, flowchart, sequence diagram, class diagram, pie chart, Gantt chartAny identityroutes/mermaid.md
Other chartsClaude / Gemini / GPT / GLMroutes/svg.md
Other chartsDoubao / Seed / Otherroutes/dsl.md

⚠️ SVG path failure fallback: When following routes/svg.md, if one of the following occurs → Discard current SVG, switch to reading routes/dsl.md and redraw from scratch, do not patch line by line:

  • Rendering command throws an error directly (syntax-level crash, not a --check warn/error)
  • Two rounds of rewriting still fail to eliminate the --check text-overflow error
  • Visual inspection shows severe PNG distortion (large areas of text overflow, elements overlapping and obscuring key information, overall layout collapse)

SVG source patching often introduces new bugs, switching to DSL and redrawing from scratch is usually more stable. This is a hard fallback for SVG path freedom, do not intrude into the creation process of routes/svg.md.

Artifact Specifications

Artifact directory: ./diagrams/YYYY-MM-DDTHHMMSS/ (local time, without colons or timezone suffix). If the user specifies a path, follow the user's preference.

Fixed filenames within the directory:

diagram.svg           ← SVG source (SVG path)
diagram.mmd           ← Mermaid source (Mermaid path)
diagram.json          ← DSL source file (DSL path) / OpenAPI JSON (exported from diagram.svg for SVG path)
diagram.gen.cjs       ← Coordinate calculation script (only for DSL script construction method)
diagram.png           ← Rendering result

Write to Whiteboard

Regarding --overwrite In the whiteboard update command, if the --overwrite flag is not included, it performs an incremental update. If the whiteboard already contains content, the new content might overlap with existing content, causing issues. Therefore, if you need to update the entire whiteboard content, you must include the --overwrite flag for an overwrite update.

npx -y @larksuite/whiteboard-cli@^0.2.11 -i <artifact file> --to openapi --format json \
  | lark-cli whiteboard +update \
    --whiteboard-token <Token> \
    --source - --input_format raw \
    --idempotent-token <10+ character unique string> \
    --as user \
    --overwrite

--idempotent-token must be at least 10 characters. It is recommended to use a timestamp + identifier (e.g., 1744800000-board-1) to avoid duplicate writes due to retries. If you need to upload with bot identity, replace --as user with --as bot.

Share:
Details:
  • Installs


    201,617
  • First seen


    Jun 10, 2026
View Repository

Auto-fetched from GitHub .

Stats via skills.sh.

Skills similar to lark-whiteboard:

 

 
 
  • Installs


 

 
 
  • Installs


 

 
 
  • Installs