본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)11k · #11714

canvas

하는 일

이 스킬은 Mac 앱이나 휴대폰 같은 연결된 화면에 웹 콘텐츠를 보여 줍니다. 브라우저를 열지 않고 기기에서 시각적이거나 대화형인 페이지를 보여 주고 싶은 사람들을 위한 스킬입니다.

사용하는 경우

  • ✓연결된 기기에 대시보드나 시각화를 보여 주고 싶을 때.
  • ✓생성된 대화형 데모나 게임을 화면에 띄우고 싶을 때.
  • ✓Brigade와 짝지어진 휴대폰이나 Mac에 HTML 콘텐츠를 보여 주고 싶을 때.

스킬 링크

https://github.com/spinabot/brigade/blob/main/skills/canvas/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/spinabot/brigade/blob/main/skills/canvas/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“연결된 Mac에 주간 매출의 간단한 차트를 전체 화면 페이지로 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 로컬 웹 서버를 통해 콘텐츠를 제공한 뒤, 연결된 기기에 웹 뷰로 보여 주라고 알립니다. 기기는 연결되어 있고 캔버스 콘텐츠를 표시할 수 있어야 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Canvas Skill

Display HTML content on connected Brigade nodes (Mac app, iOS, Android).

Overview

The canvas tool lets you present web content on any connected node's canvas view. Great for:

  • Displaying games, visualizations, dashboards
  • Showing generated HTML content
  • Interactive demos

How It Works

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────┐
│  Canvas Host    │────▶│   Node Bridge    │────▶│  Node App   │
│  (HTTP Server)  │     │  (TCP Server)    │     │ (Mac/iOS/   │
│  Port 18793     │     │  Port 18790      │     │  Android)   │
└─────────────────┘     └──────────────────┘     └─────────────┘
  1. Canvas Host Server: Serves static HTML/CSS/JS files from canvasHost.root directory
  2. Node Bridge: Communicates canvas URLs to connected nodes
  3. Node Apps: Render the content in a WebView

Tailscale Integration

The canvas host server binds based on gateway.bind setting:

Bind Mode Server Binds To Canvas URL Uses
loopback 127.0.0.1 localhost (local only)
lan LAN interface LAN IP address
tailnet Tailscale interface Tailscale hostname
auto Best available Tailscale > LAN > loopback

Key insight: The canvasHostHostForBridge is derived from bridgeHost. When bound to Tailscale, nodes receive URLs like:

http://<tailscale-hostname>:18793/__brigade__/canvas/<file>.html

This is why localhost URLs don't work - the node receives the Tailscale hostname from the bridge!

Actions

Action Description
present Show canvas with optional target URL
hide Hide the canvas
navigate Navigate to a new URL
eval Execute JavaScript in the canvas
snapshot Capture screenshot of canvas

Configuration

In the active Brigade config file ($BRIGADE_CONFIG_PATH, default ~/.brigade/brigade.json):

{
  "canvasHost": {
    "enabled": true,
    "port": 18793,
    "root": "/Users/you/brigade/canvas",
    "liveReload": true
  },
  "gateway": {
    "bind": "auto"
  }
}

Live Reload

When liveReload: true (default), the canvas host:

  • Watches the root directory for changes (via chokidar)
  • Injects a WebSocket client into HTML files
  • Automatically reloads connected canvases when files change

Great for development!

Workflow

1. Create HTML content

Place files in the canvas root directory (default ~/brigade/canvas/):

cat > ~/brigade/canvas/my-game.html << 'HTML'
<!DOCTYPE html>
<html>
<head><title>My Game</title></head>
<body>
  <h1>Hello Canvas!</h1>
</body>
</html>
HTML

2. Find your canvas host URL

Check how your gateway is bound:

CONFIG_PATH="${BRIGADE_CONFIG_PATH:-${BRIGADE_STATE_DIR:-$HOME/.brigade}/brigade.json}"
cat "$CONFIG_PATH" | jq '.gateway.bind'

Then construct the URL:

  • loopback: http://127.0.0.1:18793/__brigade__/canvas/<file>.html
  • lan/tailnet/auto: http://<hostname>:18793/__brigade__/canvas/<file>.html

Find your Tailscale hostname:

tailscale status --json | jq -r '.Self.DNSName' | sed 's/\.$//'

3. Find connected nodes

brigade nodes list

Look for Mac/iOS/Android nodes with canvas capability.

4. Present content

canvas action:present node:<node-id> target:<full-url>

Example:

canvas action:present node:mac-63599bc4-b54d-4392-9048-b97abd58343a target:http://peters-mac-studio-1.sheep-coho.ts.net:18793/__brigade__/canvas/snake.html

5. Navigate, snapshot, or hide

canvas action:navigate node:<node-id> url:<new-url>
canvas action:snapshot node:<node-id>
canvas action:hide node:<node-id>

Debugging

White screen / content not loading

Cause: URL mismatch between server bind and node expectation.

Debug steps:

  1. Check server bind: CONFIG_PATH="${BRIGADE_CONFIG_PATH:-${BRIGADE_STATE_DIR:-$HOME/.brigade}/brigade.json}"; cat "$CONFIG_PATH" | jq '.gateway.bind'
  2. Check what port canvas is on: lsof -i :18793
  3. Test URL directly: curl http://<hostname>:18793/__brigade__/canvas/<file>.html

Solution: Use the full hostname matching your bind mode, not localhost.

"node required" error

Always specify `node:<node-id

자주 묻는 질문

어떤 기기에서 콘텐츠를 볼 수 있나요?

스킬은 Mac 앱, iOS, Android 같은 연결된 Brigade 기기에서 작동합니다.

네트워크 설정이 중요한가요?

네. 기기가 사용하는 주소는 로컬 네트워크나 Tailscale 등 게이트웨이를 어떻게 설정했는지에 따라 달라집니다.

게임도 보여 줄 수 있나요?

네. HTML로 만든 게임, 시각화, 대화형 데모를 표시할 수 있습니다.

상세 정보

작성자의 원본 설명

Display HTML content — games, visualizations, dashboards, generated HTML, interactive demos — on a connected canvas-capable display surface. Use when you need to present visual or interactive web content on a screen.

repo: spinabot/brigade

인기도

GitHub 스타
11k
순위
#11714
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬