Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)48k · #4997

json-canvas

Skill này làm gì

Agent này giúp tạo và chỉnh sửa các file bản đồ trực quan có đuôi “.canvas”. Bạn có thể dùng nó để tạo sơ đồ, sơ đồ tư duy hoặc lưu đồ.

Khi nào nên dùng

  • ✓Khi bạn tạo một bản đồ trực quan mới.
  • ✓Khi bạn thêm hoặc kết nối các ý tưởng trên một bản đồ hiện có.
  • ✓Khi bạn sắp xếp thông tin một cách trực quan.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/json-canvas/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/json-canvas/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một sơ đồ tư duy với các ý sau: “Ý chính”, “Ý phụ 1”, “Ý phụ 2”, nối “Ý chính” với hai ý phụ.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Nó hoạt động bằng cách tạo và sửa một file văn bản đặc biệt (.canvas) mô tả các phần tử trực quan và kết nối giữa chúng. Agent đảm bảo mọi thứ được cấu trúc đúng trong file này.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

JSON Canvas Skill

When to Use

  • Use when creating or editing .canvas files for Obsidian.
  • Use for mind maps, flowcharts, visual note structures, or connected canvases.
  • Use when the user explicitly mentions JSON Canvas or Obsidian Canvas files.

File Structure

A canvas file (.canvas) contains two top-level arrays following the JSON Canvas Spec 1.0:

{
  "nodes": [],
  "edges": []
}
  • nodes (optional): Array of node objects
  • edges (optional): Array of edge objects connecting nodes

Common Workflows

1. Create a New Canvas

  1. Create a .canvas file with the base structure {"nodes": [], "edges": []}
  2. Generate unique 16-character hex IDs for each node (e.g., "6f0ad84f44ce9c17")
  3. Add nodes with required fields: id, type, x, y, width, height
  4. Add edges referencing valid node IDs via fromNode and toNode
  5. Validate: Parse the JSON to confirm it is valid. Verify all fromNode/toNode values exist in the nodes array

2. Add a Node to an Existing Canvas

  1. Read and parse the existing .canvas file
  2. Generate a unique ID that does not collide with existing node or edge IDs
  3. Choose position (x, y) that avoids overlapping existing nodes (leave 50-100px spacing)
  4. Append the new node object to the nodes array
  5. Optionally add edges connecting the new node to existing nodes
  6. Validate: Confirm all IDs are unique and all edge references resolve to existing nodes

3. Connect Two Nodes

  1. Identify the source and target node IDs
  2. Generate a unique edge ID
  3. Set fromNode and toNode to the source and target IDs
  4. Optionally set fromSide/toSide (top, right, bottom, left) for anchor points
  5. Optionally set label for descriptive text on the edge
  6. Append the edge to the edges array
  7. Validate: Confirm both fromNode and toNode reference existing node IDs

4. Edit an Existing Canvas

  1. Read and parse the .canvas file as JSON
  2. Locate the target node or edge by id
  3. Modify the desired attributes (text, position, color, etc.)
  4. Write the updated JSON back to the file
  5. Validate: Re-check all ID uniqueness and edge reference integrity after editing

Nodes

Nodes are objects placed on the canvas. Array order determines z-index: first node = bottom layer, last node = top layer.

Generic Node Attributes

Attribute Required Type Description
id Yes string Unique 16-char hex identifier
type Yes string text, file, link, or group
x Yes integer X position in pixels
y Yes integer Y position in pixels
width Yes integer Width in pixels
height Yes integer Height in pixels
color No canvasColor Preset "1"-"6" or hex (e.g., "#FF0000")

Text Nodes

Attribute Required Type Description
text Yes string Plain text with Markdown syntax
{
  "id": "6f0ad84f44ce9c17",
  "type": "text",
  "x": 0,
  "y": 0,
  "width": 400,
  "height": 200,
  "text": "# Hello World\n\nThis is **Markdown** content."
}

Newline pitfall: Use \n for line breaks in JSON strings. Do not use the literal \\n -- Obsidian renders that as the characters \ and n.

File Nodes

Attribute Required Type Description
file Yes string Path to file within the system
subpath No string Link to heading or block (starts with #)
{
  "id": "a1b2c3d4e5f67890",
  "type": "file",
  "x": 500,
  "y": 0,
  "width": 400,
  "height": 300,
  "file": "Attachments/diagram.png"
}

Link Nodes

Attribute Required Type Description
url Yes string External URL
{
  "id": "c3d4e5f678901234",
  "type": "link",
  "x": 1000,
  "y": 0,
  "width": 400,
  "height": 200,
  "url": "https://obsidian.md"
}

Group Nodes

Groups are visual containers for organizing other nodes. Position child nodes inside the group's bounds.

Attribute Required Type Description
label No string Text label for the group
background No string Path to background image
backgroundStyle No string cover, ratio, or repeat
{

…
Câu hỏi thường gặp

File .canvas là gì?

Đó là file văn bản mô tả một bản đồ trực quan, như lưu đồ hoặc sơ đồ tư duy, bằng định dạng gọi là JSON Canvas.

Các ý tưởng được kết nối với nhau như thế nào?

Các kết nối được tạo bằng “edges” (cạnh), nối các định danh duy nhất của từng ý tưởng (node).

Tôi có thể dùng màu sắc không?

Có, bạn có thể đặt màu cho các phần tử bằng số định sẵn hoặc mã màu thập lục phân.

Chi tiết

Mô tả gốc của tác giả

Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4997
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự