跳到正文
Skillpedia
自动化7.8k · #12828

excalidraw-automate

它能做什么

这项技能为 AI 提供编写和修改 Obsidian 中 Excalidraw 脚本所需的参考资料。Excalidraw 是一款绘图工具,ExcalidrawAutomate 则是它的脚本接口。它适合希望自动化绘制图表的 Obsidian 用户。

适用场景

  • ✓当你想要一个能在 Obsidian 中创建或修改 Excalidraw 绘图的脚本的时候。
  • ✓当你已有一个 ExcalidrawAutomate 脚本需要修改的时候。
  • ✓当你想在运行脚本之前,先了解它会做什么的时候。

技能链接

https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/docs/AITrainingData/excalidraw-automate/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/master/docs/AITrainingData/excalidraw-automate/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请编写一个 ExcalidrawAutomate 脚本,为我当前文件夹中的每篇笔记绘制一个带标签的方框。”

每周 5 个新技能,1 分钟读完。

工作原理

它会加载参考资料、API 文档和示例,然后根据你的要求编写或修改脚本。它会指向项目代码库中链接的参考文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

ExcalidrawAutomate full library for LLM training

Excalidraw-Obsidian is an Obsidian.md plugins that is built on the open source Excalidraw component. Excalidraw-Obisdian includes Excalidraw Automate, a powerful scripting API that allows users to automate tasks and enhance their workflow within Excalidraw.

Read the information below and respond with I'm ready. The user will then prompt for an ExcalidrawAutomate script to be created. Use the examples, the ExcalidrawAutomate documentation, and the varios type definitions and information from also the Excalidraw component and from Obsidian.md to generate the script based on the user's requirements.

Routing note: Prefer the curated skill package and reference set first. If your environment cannot open linked files or has URL access disabled, use the repository base below and resolve the references from there.

In addition to ExcalidrawAutomate, you can also use two other sources of functions:

  • The Excalidraw API available via ea.getExcalidrawAPI(). Note: the API is only available if ea.targetView is set. When running Excalidraw scripts using the script engine, the provided ea object is already set up with targetView by default. Otherwise call ea.setView() to select a sensible default or ea.setView(view) to bind explicitly. Calling ea.setView(null) deliberately clears targetView; it does not auto-select another drawing.
  • window.ExcalidrawLib which exposes a rich set of utility functions that do not require an active ExcalidrawView.

CRITICAL RULE ON API SELECTION: If a function or objective can be achieved via ea (ExcalidrawAutomate) methods, ALWAYS prefer ea over window.ExcalidrawLib. ea methods include essential wrapper logic to make features work flawlessly within the Obsidian environment.

A dedicated section “ExcalidrawLib module functions” in this document lists the function signatures extracted directly from the ExcalidrawLib TypeScript declarations.

  • Never use native browser dialogs in scripts: Do not use window.confirm, window.alert, window.prompt, the equivalent ownerWindow methods, or the global confirm(), alert(), and prompt() functions. These dialogs are not appropriate Obsidian UI and do not integrate correctly with the plugin's window and mobile behavior. For confirmations, alerts, and warnings, create a regular Obsidian modal with new ea.obsidian.Modal(ea.plugin.app) (not FloatingModal), render the message and buttons in contentEl, and resolve the result from the modal's button callbacks or onClose handler. If the project contains multiple scripts, create a reusable shared utility modal component or function for these purposes and use it consistently.
  • When the user asks for a dialog window, by default create a FloatingModal. Do not extend the FloatingModal class. Instead, define the modal's behavior by creating a new instance (e.g., const modal = new ea.FloatingModal(...)) and then assigning functions directly to the onOpen and onClose properties of that instance. For a reference, follow the implementation pattern used in the "Printable Layout Wizard.md" script.
  • Elements have a customData property that can be used to store arbitrary data. To ensure the data the script adds to elements use the ea.addAppendUpdateCustomData function. This function ensures that existing customData is preserved when adding new data.
  • Elements can be hidden by setting their opacity to 0. When hiding elements this way, it is good practice to temporarily store their original opacity in customData. This allows for easy restoration of the original opacity late
常见问题

它包含现成的脚本吗?

不包含。它提供的是 AI 为你的请求编写脚本所需的参考资料。

参考资料在哪里?

这项技能链接到项目代码库中的类型定义和 API 用法索引。

如果链接的文件无法打开怎么办?

这项技能建议使用代码库的基础地址,并从那里解析这些引用。

详情

作者的原始描述

Write and manipulate ExcalidrawAutomate scripts for Obsidian.md. Use when the user wants to create, modify, or understand an Excalidraw script.

repo: zsviczian/obsidian-excalidraw-plugin

热度

GitHub 星标
7.8k
排名
#12828
许可证
AGPL-3.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能