Logo Sealos Canvas

Sealos Canvas

Tổ chức
labring
sealos-canvas

Run a local read-only HTML topology UI for a project already deployed by Sealos Skills and return a localhost URL. Use when the user asks to view, inspect, visualize, render, open, or run a local canvas for deployed Sealos resources, mentions ".sealos", Sealos deployment state, Kubernetes resources, topology, resource graph, localhost UI, or invokes "/sealos-canvas".

Tổng quan

Nhà phát hànhlabring
Kho mãsealos-skills
Tên kỹ năngsealos-canvas
Sao
80
Bản fork
19
Tệp đi kèm
4
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 4 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được labring công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Sealos Canvas trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/labring/sealos-skills/tree/main/skills/sealos-canvas
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/labring/sealos-skills.git /tmp/sealos-skills
mkdir -p .claude/skills
cp -r /tmp/sealos-skills/skills/sealos-canvas .claude/skills/sealos-canvas
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Sealos Canvas trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Sealos Canvas ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Sealos Canvas với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Sealos Canvas

Identity and Discovery

  • Owner: sealos-canvas (/sealos-canvas and deployed-resource view, inspect, visualize, topology, or localhost canvas requests).
  • Class: read-only-observation with no downstream mutation handoff.
  • Canaries: CANVAS-DEPLOYED, CANVAS-READONLY, CANVAS-REDACT, and CANVAS-SERVER-LIFETIME.

Scope and Boundaries

Require .sealos/state.json with last_deploy, ~/.sealos/kubeconfig, and live read access. Use only read commands such as kubectl get and kubectl config view; never deploy, update, restart, patch, delete, or apply. Render sanitized resource metadata into .sealos/canvas/index.html and return the exact local URL/cache and server-lifetime contract.

Risk and Confirmation

Keep the read-only boundary, Sealos kubeconfig scope, and Secret/ConfigMap sanitization visible before generator detail. Omit Secret.data and ConfigMap.data from every result. A missing state or kubeconfig stops the request without fallback generation. Never expose Secret data, complete ConfigMap contents, kubeconfig contents, or credentials.

Lifecycle Workflow

For each request, resolve the project, check deployed state and kubeconfig, run the single generator, open the loopback UI, and report sanitized counts. The temporary 127.0.0.1 server runs only for the current process and stops when the process ends or on SIGINT/SIGTERM; stop the server before closing the request.

Progressive Disclosure

Load scripts/generate-canvas.mjs and its owned template/reference paths only after the deployed-state and read-only canaries pass. Do not load or invoke deployment mutation helpers from this entry.

Output, Stop, and Error States

  • success: local_url, html_path, app URL, node count, edge count, sanitized HTML/model, and server-lifetime evidence.
  • stopped: not_deployed, kubeconfig_missing, kubectl_missing, or unavailable read access with the exact safe next action, server_lifetime.status: not_started, and no HTML/server fallback.
  • error: generation or server-start path, sanitized diagnostic category, server_lifetime, and recovery action with secrets and kubeconfig redacted.

Success with --no-serve returns local_url: null and server_lifetime.status: not_started; normal success returns local_url and server_lifetime.status: running with shutdown process exit or SIGINT/SIGTERM.

Handoffs

Canvas consumes the typed direct-result tuple with target: none, inputArtifact: .sealos/state.json last_deploy plus sanitized live summaries, allowedAction: serve a temporary read-only loopback view, failureReturn: sanitized read-only generation/server diagnostic, and responseOwner: sealos-canvas. A deploy response may include the returned link without granting Canvas mutation authority.

Verification

Use generate-canvas.mjs --no-serve, the Canvas contract tests, the canvas evals, and baseline cases canvas-positive-read-only-local-url and canvas-violating-missing-state-or-mutation. Verify 127.0.0.1, local_url, html_path, server_lifetime, read-only commands, sanitized output, and explicit "Stop the server" behavior.

Overview

Render the current repository's deployed Sealos resources as a locally hosted HTML canvas. This skill is view-only: it reads .sealos/state.json and Kubernetes resources, starts a temporary 127.0.0.1 UI server, and returns the local URL to the user.

Hard Rules

  1. Do not deploy, update, restart, patch, delete, or apply resources.
  2. Only use read commands such as kubectl get and kubectl config view.
  3. Use the Sealos kubeconfig at ~/.sealos/kubeconfig.
  4. Do not display Secret data or full ConfigMap contents.
  5. If the project has no .sealos/state.json with last_deploy, stop and tell the user to deploy first with /sealos-deploy.
  6. If kubeconfig or live resource access is unavailable, report the script message and stop.

Workflow

1. Resolve the project

Use the current working directory unless the user provides a local path:

bash
WORK_DIR="$(pwd)"

Confirm this is the intended repository before generating output.

2. Start the local canvas UI

Run:

bash
node "<SKILL_DIR>/scripts/generate-canvas.mjs" --work-dir "$WORK_DIR"

Keep this process running while the user is viewing the canvas. The script writes JSON to stdout after the local server starts.

If ok is false, show the message to the user and end the flow. Do not run fallback discovery, do not deploy, and do not create any other artifact.

If ok is true, use local_url as the primary output.

3. Open the local URL

Open the returned URL with the browser:

text
http://127.0.0.1:<port>/index.html

Then summarize:

  • local UI URL
  • app URL
  • node count
  • edge count

Stop the server process when the user is done viewing the page or when the current task ends.

Output Contract

Success:

json
{
  "ok": true,
  "local_url": "http://127.0.0.1:63220/index.html",
  "html_path": "/abs/path/.sealos/canvas/index.html",
  "node_count": 5,
  "edge_count": 4,
  "app_url": "https://example.sealos.run"
}

Stop condition:

json
{
  "ok": false,
  "reason": "not_deployed",
  "message": "This project has not been deployed by Sealos Skills yet. Run /sealos-deploy first, then run /sealos-canvas again."
}

Visual Target

The locally hosted UI should feel like a topology canvas, not a table:

  1. Top bar with app name, namespace, deployed app URL, generated time, and local UI status.
  2. Dark dotted-grid canvas with deterministic resource-card layout.
  3. Resource cards for app, ingress, services, pods, config, secrets, and volumes.
  4. Dashed or solid SVG connector lines between related resources.
  5. PVC/volume references attached as strips on the related card when possible.
  6. Detail panel for the selected resource.
  7. Events panel with recent related Kubernetes events.
  8. Status colors for ready, sleeping, warning, and failed states.
  9. Lightweight pan, zoom, fit, and reset controls.

Theme extraction is best effort. Reuse the user's repo accent color, font, and radius when easy to detect, but preserve operational readability.

Script

scripts/generate-canvas.mjs is the deterministic entrypoint. It:

  1. Reads .sealos/state.json.
  2. Verifies ~/.sealos/kubeconfig and kubectl.
  3. Reads live namespace resources with kubectl get.
  4. Builds a sanitized canvasModel with app, nodes, edges, events, and theme.
  5. Renders assets/canvas-template.html into an internal .sealos/canvas/index.html cache.
  6. Starts a temporary local HTTP server and prints local_url.

Use --no-serve only for tests or CI checks that should generate HTML without keeping a server process alive.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

Kỹ năng AI Sealos Canvas làm được gì?

Run a local read-only HTML topology UI for a project already deployed by Sealos Skills and return a localhost URL. Use when the user asks to view, inspect, visualize, render, open, or run a local canvas for deployed Sealos resources, mentions ".sealos", Sealos deployment state, Kubernetes resources, topology, resource graph, localhost UI, or invokes "/sealos-canvas".

Vì sao nên dùng Sealos Canvas trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Sealos Canvas là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Sealos Canvas trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/labring/sealos-skills/tree/main/skills/sealos-canvas. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Sealos Canvas?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Sealos Canvas với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Sealos Canvas với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Sealos Canvas có miễn phí không?

Kỹ năng này được labring phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇