360 Secure SkillHub
360 安全技能中心

Excalidraw Architect

该 Skill 通过浏览器工具打开 Excalidraw 页面,借助页面运行时 API 写入矩形、文本和箭头,按自然语言需求生成或重写软件架构图、数据管道与流程图,并提供 Python 脚本把 JSON spec 转为 Excalidraw 元素 JSON,支持按用户反馈迭代重绘。

energypantry
energypantry
热度 45.48
最近更新 2026-05-11 17:36:54
分类:创作依赖:联网浏览搜索 / 代码执行 / 读写文件应用场景:工作流 / UI 原型

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add excalidraw-architect
Metadata
name
excalidraw-architect
description
Build or revise architecture diagrams directly in excalidraw.com from natural-language requirements. Use when the user asks to draw, update, clean up, or restructure system diagrams/flowcharts in Excalidraw, especially for software architecture, data pipelines, multi-tenant designs, or workflow maps.

Excalidraw Architect

Overview

Generate structured architecture diagrams in Excalidraw by scripting scene elements (rectangles, text, arrows) through the page runtime API, then iterating quickly based on user feedback.

Workflow

1) Open and verify the Excalidraw tab

Open https://excalidraw.com/ in the browser tool and keep using the same targetId for all edits.

If the user already has a board open, reuse that tab instead of creating a new one.

2) Get Excalidraw runtime API from the page

Use an evaluate action to locate excalidrawAPI from the React fiber tree.

If API lookup fails, refresh once and retry.

Use this lookup logic (or equivalent):

  • find .excalidraw root
  • read __reactFiber$*
  • traverse child/sibling fibers
  • pick node where memoizedProps.excalidrawAPI.updateScene exists

3) Build scene elements from the requested architecture

Translate the user’s request into:

  • container blocks (rectangles)
  • section labels and body text
  • directional arrows between blocks

Prefer clear readable layout:

  • title at top
  • left-to-right data flow unless user requests otherwise
  • enough spacing to avoid overlap

4) Write scene to canvas

Call api.updateScene({ elements, appState }) and then api.scrollToContent(elements, { fitToContent: true }).

When user requests changes, rewrite the scene deterministically (do not partially patch random elements unless user asks for tiny edits).

5) Confirm result

Send a short completion message and mention what changed.

Editing Rules

  • Preserve user’s scope boundaries (example: “only draw to Raw Data Pool”).
  • Keep language concise and business-readable.
  • Prefer complete labels over abbreviations.
  • If text is too dense, split into multiple lines.
  • If user asks for “only one layer”, remove downstream blocks explicitly.

Reusable Resources

scripts/

  • scripts/generate_excalidraw_scene.py: convert a JSON spec into Excalidraw element JSON.

references/

  • references/excalidraw-api-snippets.md: tested API discovery and update snippets for browser evaluate calls.

Use scripts/resources when diagrams are large or need repeatable generation.