Token导航 LogoToken导航

Agent Skill · AI 工具

agent-canvas(Agent 画布)

agent-canvas 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

agent-canvas 是AI 工具类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描已通过,按安装量在AI 工具类的 2,536 个 Skill 里排第 857。

总安装 1,835周安装 78GitHub Stars 17下载 643核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agent-canvas(Agent 画布)
来源仓库:https://github.com/whq25/agent-canvas
仓库路径:skills/agent-canvas
安装命令:
npx skills add https://github.com/whq25/agent-canvas --skill agent-canvas
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/whq25/agent-canvas --skill agent-canvas

这个 Skill 是做什么的

AI 工具类 Skill 用来扩展助手本身的能力,例如接模型、接检索、接外部服务。

CLI 工具用于与 Excalidraw 画布交互,支持图表和可视化创建。适用于需要快速绘制架构图或流程图的 AI 辅助设计场景。核心能力包括画布启动、绘图命令和端口配置管理。使用 bun add -g 或 npm install -g 全局安装,默认端口为 5173。

注意版本一致性,确保 CLI 版本为 0.13.0 以获得完整功能。

来源仓库内路径:skills/agent-canvas

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/whq25/agent-canvas --skill agent-canvas;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

agent-canvas 怎么安装?

在终端执行 npx skills add https://github.com/whq25/agent-canvas --skill agent-canvas。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

agent-canvas 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

agent-canvas 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

agent-canvas 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

agent-canvas 用的人多吗?

公开数据是累计安装 1,835 次,近一周安装 78 次,下载 643 次,GitHub 17 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

agent-canvas 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理AI 工具类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

AI 工具类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
executing-plans

执行计划 · Codex、Claude

1,515,336173,110只读MIT通过
verification-before-completion

完成前的验证 · Codex、Claude

1,319,472173,121权限未标注MIT通过
subagent-driven-development

子 Agent 驱动开发 · Codex、Claude

1,312,416173,138只读MIT通过
copy-editing

复制编辑 · Codex、Claude

1,209,57625,632只读MIT通过
paywall-upgrade-cro

付费专区升级 cro · Codex、Claude

1,030,17625,617只读MIT通过
agent-canvas

Agent 画布 · 本页

1,83517操作浏览器MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Agent Canvas

A CLI tool to interact with an Excalidraw canvas for creating diagrams and visualizations.

Installation

Before using, check if CLI is installed:

which agent-canvas && agent-canvas --version
  • If not installed: Ask the user which package manager they prefer (bun or npm), then install: bun add -g @agent-canvas/cli@0.13.0 # or npm install -g @agent-canvas/cli@0.13.0
  • If installed but version differs from 0.13.0: Upgrade using the same package manager:

- Path contains .bun → bun add -g @agent-canvas/cli@0.13.0 - Otherwise → npm install -g @agent-canvas/cli@0.13.0

  • After install/upgrade: Verify with agent-canvas --version to confirm version is 0.13.0

Quick Start

  1. Start the canvas (opens in browser): agent-canvas start &
  2. Use CLI commands to draw on the canvas.

Port Configuration

Default ports: 39820 (WebSocket), 39821 (HTTP). If ports conflict, configure via:

agent-canvas config set port 39820         # Set WebSocket port
agent-canvas config set http-port 39821    # Set HTTP port
agent-canvas config list                   # Show all config (value + source)
agent-canvas config get port               # Show current port
agent-canvas config reset port             # Reset to default

Config is saved to ~/.agent-canvas/config.json. One-time override via start:

agent-canvas start --port 8000 --http-port 8001 &

Priority: --port flag > env var AGENT_CANVAS_WS_PORT > config file > default.

Commands Reference

Start Canvas

agent-canvas start &                  # Start server in the background (will close automatically when no action for a while)

Load File

agent-canvas load file.excalidraw     # Load .excalidraw file into current canvas

When loading from file: Remember the file path and save back to it with agent-canvas save <original-file>.

Canvas Management

The canvas supports multiple canvases. Each canvas is stored independently and can be switched between.

agent-canvas list                     # List all canvases ([U]=User active, [A]=Agent active, [F]=Folder)
agent-canvas new -n "Name" [--use]    # Create new canvas, optionally switch to it
agent-canvas use "Name"               # Switch to canvas by name
agent-canvas rename "New Name"        # Rename current canvas

Folder Management — Organize canvases into folders:

agent-canvas create-folder -n "Name"              # Create a new folder
agent-canvas delete-folder "Name"                  # Delete folder (canvases become ungrouped)
agent-canvas move-to-folder "Canvas" "Folder"      # Move canvas into a folder
agent-canvas move-to-folder "Canvas" --ungrouped   # Remove canvas from its folder

Notes:

  • Canvas names are case-insensitive and must be unique
  • Delete canvases via UI (hover over canvas in sidebar, click "..." menu)
  • Each canvas has its own scene data; switching automatically saves current canvas
  • Deleting a folder does NOT delete the canvases inside it — they become ungrouped

Add Text

agent-canvas add-text -t "<text>" --ax <x> --ay <y> [options]
  • Options: --font-size <size>, --text-align <left|center|right>, -a/--anchor <anchor>, --stroke-color <hex>, -n/--note <text>
  • Font sizes: S=16, M=20 (default), L=28, XL=36
  • Anchor (-a): Since text size is unknown until rendered, anchor gives you precise positioning control by specifying which point of the text bounding box aligns to (--ax, --ay). Default: bottomLeft. Anchor Common Text Types topLeft Badge, Tag, Icon label topCenter Subtitle, Description below shape topRight Timestamp, Version, Status leftCenter Side annotation (right of shape) center Centered title, Main label rightCenter Side annotation (left of shape) bottomLeft Footnote, Note bottomCenter Title, Header above shape bottomRight Footnote, Signature
  • Returns: Text created (id: <id>, x: <x>, y: <y>, <width>x<height>) — actual top-left position and dimensions for precise layout

Add Drawing Elements

All drawing commands share common style options:

  • Stroke: --stroke-color <hex> (default: #1e1e1e), --stroke-width <1-4> (default: 2), --stroke-style <solid|dashed|dotted> (default: solid)
  • Fill (shapes only): --background-color <hex> (default: transparent), --fill-style <solid|hachure|cross-hatch> (default: solid)
  • Meta: -n/--note <text> - semantic description for the element. Use liberally - notes help understand diagram intent when reading back later.
  • Animated: --animated - auto-scroll viewport to show the newly added element. Small elements zoom in, large elements zoom out, normal elements scroll minimally.

Recommended Colors (from Excalidraw palette):

ColorStroke (dark)Background (light)
Red#e03131#ffc9c9
Blue#1971c2#a5d8ff
Green#2f9e44#b2f2bb
Yellow#f08c00#ffec99
Cyan#0c8599#99e9f2
Violet#6741d9#b197fc
Gray#495057#dee2e6
Shapes
agent-canvas add-shape -t <type> -x <x> -y <y> [-w <width>] [-h <height>] [-l <label>]
  • Types: rectangle, ellipse, diamond
  • Use -l/--label to add text inside the shape (fontSize: 16 by default), --label-font-size <n> to adjust
  • Label color inherits from --stroke-color by default; use --label-stroke-color <hex> to override
  • Returns: Shape created (id: <id> x=<x> y=<y> w=<width> h=<height>) — actual dimensions after auto-sizing for labels

⚠️ Label Sizing - CRITICAL: Calculate BEFORE drawing

If shape size is too small, Excalidraw auto-expands, breaking arrow coordinates. You MUST:

  1. Calculate minimum dimensions using the formulas below
  2. Use the calculated values directly — NEVER estimate or use smaller values
Step 1: Calculate text dimensions (fontSize=16 by default)
  textWidth = charCount × fontSize × 0.6  (English/numbers)
  textWidth = charCount × fontSize        (CJK characters)
  textHeight = lineCount × fontSize × 1.35

Step 2: Calculate minimum shape size (use these values, not smaller!)
  rectangle: width = textWidth + 50,  height = textHeight + 50
  ellipse:   width = textWidth × 1.42 + 55,  height = textHeight × 1.42 + 55
  diamond:   width = textWidth × 2 + 60,  height = textHeight × 2 + 60

Example: Label "Message Queue" (13 chars) in ellipse

textWidth = 13 × 16 × 0.6 = 124.8
textHeight = 1 × 16 × 1.35 = 21.6
ellipse width = 124.8 × 1.42 + 55 = 232
ellipse height = 21.6 × 1.42 + 55 = 86
→ Use: -w 232 -h 86 (or round up to -w 240 -h 90)

Tip: For long labels, insert \n manually, then recalculate with updated lineCount.

Lines & Arrows
agent-canvas add-line -x <x1> -y <y1> --end-x <x2> --end-y <y2>
agent-canvas add-arrow -x <x1> -y <y1> --end-x <x2> --end-y <y2>
  • Arrow-specific: --start-arrowhead, --end-arrowhead (arrow, bar, dot, triangle, diamond, none)

Arrow Types (--arrow-type):

TypeDescriptionUse Case
sharpStraight line (default)Direct connections
roundCurved line with control pointOrganic flows, avoiding overlaps
elbowRight-angle turns (90°)Flowcharts, circuit diagrams

Intermediate Points (--via): Use --via to specify intermediate points as absolute coordinates in format "x1,y1;x2,y2;...":

# Round arrow: one control point determines curve direction
# Vertical arrow curving left (control point at x=50, left of the line)
agent-canvas add-arrow -x 100 -y 100 --end-x 100 --end-y 300 --arrow-type round --via "50,200"

# Elbow arrow: multiple points for 90° turns
# Loop back pattern: down → left → up (for flowchart iterations)
agent-canvas add-arrow -x 175 -y 520 --end-x 175 --end-y 280 --arrow-type elbow --via "120,520;120,280"

Tips:

  • For round: curve bends toward the control point (offset from straight path)
  • For elbow: points define the corners of the 90° path
Polygon
agent-canvas add-polygon -p '[{"x":0,"y":0},{"x":100,"y":0},{"x":50,"y":100}]'
Image
agent-canvas add-image -f <path> -x <x> -y <y> [-w <width>] [-h <height>] [-n <note>]
  • Supported formats: PNG, JPEG, GIF, SVG, WebP
  • Width/height default to original image dimensions; specify one to scale proportionally
  • Image data is embedded as base64 in the canvas (stored in browser IndexedDB)
  • Returns: Image added (id: <id>, x: <x>, y: <y>, <width>x<height>)

Manipulate Elements

agent-canvas delete-elements -i <id1>,<id2>,...
agent-canvas rotate-elements -i <id1>,<id2>,... -a <degrees>
agent-canvas move-elements -i <id1>,<id2>,... --delta-x <dx> --delta-y <dy>
agent-canvas resize-elements -i <id1>,<id2>,... [--top <n>] [--bottom <n>] [--left <n>] [--right <n>]
agent-canvas group-elements -i <id1>,<id2>,...
agent-canvas ungroup-element -i <id>

Resize Elements (resize-elements): Expand or contract element edges (rectangle, ellipse, diamond, image). Values are in element's local coordinate system (respects rotation).

Examples:

# Expand bottom edge by 50px (increase height)
agent-canvas resize-elements -i abc123 --bottom 50

# Expand both right and bottom (like dragging bottom-right corner)
agent-canvas resize-elements -i abc123 --right 50 --bottom 30

# Contract left edge by 20px (decrease width)
agent-canvas resize-elements -i abc123 --left -20

# Expand all sides uniformly
agent-canvas resize-elements -i abc123 --top 25 --bottom 25 --left 25 --right 25

Read Scene

agent-canvas read                # TOON format (compact, ~7% of JSON size)
agent-canvas read --with-style   # Include stroke/bg colors
agent-canvas read --json         # Raw Excalidraw scene JSON

TOON output structure:

shapes[N]{id,type,x,y,w,h,angle,labelId,note}       # rectangle, ellipse, diamond, polygon
lines[N]{id,type,x,y,endX,endY,via,angle,note}      # line, arrow
labels[N]{id,containerId,content,x,y,w,h}           # text bound to shapes (via labelId)
texts[N]{id,content,x,y,w,h,angle,note}              # standalone text elements
groups[N]{id,elementIds}                             # element groupings
  • labelId in shapes links to id in labels
  • via shows intermediate points in same format as --via input ("x1,y1;x2,y2" or null if none)
  • --with-style adds stroke, bg fields
  • --json returns full Excalidraw format (use with jq to query specific elements)

Save, Export and Clear

agent-canvas save file.excalidraw
agent-canvas export -o out.png [--scale 2] [--dark] [--no-background]
agent-canvas clear                # Clear all elements from the canvas, use with caution!

Note: Before running clear, ask the user if they want to save or export the current canvas first. ⚠️ALWAYS prefer agent-canvas new over agent-canvas clear only use clear when user has confirmed!⚠️

Design Philosophy

You are a perfectionist. If it looks slightly off, it IS off. Fix it.

Core principle: Consistency reflects meaning.

  • Same relationship → Same alignment & spacing

- Elements with the same relationship should share identical alignment - Gaps between same-level elements should be equal throughout - Snap to grid (e.g., 10px units) for precision

  • Same type → Same color & size

- Same-type nodes share identical dimensions - Same color = same meaning; max 3-4 colors; less is more - Important elements = larger size

  • Details matter

- Arrows connect precisely to shape edges - Review via export and fix any imperfections

IMPERATIVE GUIDE

  1. Coordinates: Origin (0,0) is top-left. X→right, Y→down. Colors in hex (#FF5733) or transparent.
  2. Workflow: Read canvas → Plan layout → Draw shapes → Add arrows/lines(if necessary) → Adjust.

- IMPORTANT: Canvas content is auto-saved to browser localStorage. Always run agent-canvas read first to check for existing content before drawing. - If old content exists, ask the user whether to: (a) continue editing, (b) clear and start fresh, or (c) save/export first then clear. - Shapes define the layout and provide exact coordinates - Arrow endpoints depend on shape positions — drawing arrows first leads to misalignment - Adjust: After initial draft, run read and export to review. Check against Design Philosophy: - Alignment issues? → move-elements to snap to grid - Inconsistent spacing? → move-elements to equalize gaps - Overlapping elements? → move-elements or delete-elements and redraw - Wrong sizes? → delete-elements and redraw - Misaligned arrows? → delete-elements and redraw with correct endpoints - Container size issue? → resize-elements to adjust to perfect size

  1. Progressive Canvas Reading:

- read - Start here. Compact TOON format (~7% of JSON size) - read --with-style - Add color info when styling matters - export -o canvas.png + view image - For visual/spatial understanding - read --json | jq '.elements[] | select(.id=="<id>")' - Query specific element details

  1. Batch Commands: Chain with && for efficiency. DO NOT WRITE BASH COMMENT IN DRAWING COMMANDS agent-canvas add-shape -t rectangle -x 100 -y 100 -l "A" && \ agent-canvas add-shape -t rectangle -x 300 -y 100 -l "B" && \ agent-canvas add-arrow -x 220 -y 130 --end-x 300 --end-y 130

Drawing Tutorials

Before drawing, identify the diagram type and check for tutorials:

  1. Determine what type of diagram the user wants (flowchart, architecture, mindmap, UI mockup, etc.)
  2. Read references/REFERENCE.md — this is the tutorial index listing all available diagram tutorials
  3. If a matching tutorial exists: Read the specific tutorial FIRST before drawing — tutorials contain type-specific rules, layout patterns, and best practices
  4. Apply the tutorial guidelines while drawing

平台分布

Claude Code

30.22%
按下载量换算194

OpenCode

25.64%
按下载量换算165

Gemini CLI

17.11%
按下载量换算110

Codex

14.34%
按下载量换算92

Antigravity

7.76%
按下载量换算50

Cursor

3.67%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills