Agent Skillsphodal/routa › canvas

canvas

GitHub

用于生成 Routa Canvas 交互式可视化组件。通过读取 SDK 资源,创建符合规范的 TSX 文件,实现前端界面渲染与交互逻辑封装。

.agents/skills/canvas/SKILL.md phodal/routa

Trigger Scenarios

用户请求创建或更新 Routa Canvas 可视化内容 需要生成基于 Routa 会话的交互式前端组件

Install

npx skills add phodal/routa --skill canvas -g -y
More Options

Non-standard path

npx skills add https://github.com/phodal/routa/tree/main/.agents/skills/canvas -g -y

Use without installing

npx skills use phodal/routa@canvas

指定 Agent (Claude Code)

npx skills add phodal/routa --skill canvas -a claude-code -g -y

安装 repo 全部 skill

npx skills add phodal/routa --all -g -y

预览 repo 内 skill

npx skills add phodal/routa --list

SKILL.md

Frontmatter
{
    "name": "canvas",
    "metadata": {
        "short-description": "Create a Routa Canvas artifact"
    },
    "description": "Create or update a Routa Canvas artifact for the current task. Use when the user wants a live visual or interactive canvas generated from a Routa session."
}

Use Routa Canvas for this turn.

Canvas behavior:

  • Create or overwrite exactly one *.canvas.tsx file during the tool run.
  • The file content must be the TSX source itself, not markdown.
  • Prefer storing the file under the selected repository when appropriate.
  • Use a short descriptive file name ending in .canvas.tsx.
  • After the file is created, mention the created path briefly.

Source contract:

  • Create a Routa browser canvas as TSX source code.
  • Return only the TSX source.
  • Do not include markdown code fences.
  • Do not include explanations, notes, or prose before or after the code.
  • The source must export default function Canvas() or export default Canvas.
  • Prefer a self-contained component with inline styles.
  • If you import anything, you may only import from react, routa/canvas, routa/canvas/*, @canvas-sdk, or @canvas-sdk/*.
  • Do not use browser globals or side effects such as window, document, fetch, or localStorage.
  • Do not render fake shell chrome such as browser frames, global app shells, left sidebars, or chat panes unless the prompt explicitly asks for it.
  • Keep the composition flat, minimal, purposeful; avoid gradients, emojis, box shadows.

Canvas SDK access:

  • Prefer MCP tool read_canvas_sdk_resource with uri resource://routa/canvas-sdk/manifest.
  • If your provider supports native MCP resource reads, you may read that same URI directly instead.
  • That manifest is the authoritative Canvas SDK index for this session.
  • Then read only the defs resources you actually need from its definitionResources list, preferably through read_canvas_sdk_resource.
  • Import only from routa/canvas or react.
  • If a symbol or prop is not present in those resources, do not invent it.
  • Example definition resources:
  • resource://routa/canvas-sdk/defs/primitives
  • resource://routa/canvas-sdk/defs/hooks
  • resource://routa/canvas-sdk/defs/data-display
  • resource://routa/canvas-sdk/defs/containers
  • resource://routa/canvas-sdk/defs/controls
  • resource://routa/canvas-sdk/defs/charts
  • resource://routa/canvas-sdk/defs/diff-view
  • resource://routa/canvas-sdk/defs/dag-layout
  • If neither direct resource reads nor the helper tool are available, stay conservative and use only the symbols named in the manifest.

Version History

  • 73eb1ed Current 2026-07-25 10:20

Same Skill Collection

.agents/skills/agent-browser/SKILL.md
.agents/skills/dogfood/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/slack/SKILL.md
.claude/skills/evolution-architecture-review/SKILL.md
.claude/skills/issue-enricher/SKILL.md
.claude/skills/issue-garbage-collector/SKILL.md
.claude/skills/playwright-cli/SKILL.md
.claude/skills/pr-verify/SKILL.md
.claude/skills/release/SKILL.md
tools/office-skills/.agents/skills/docx/SKILL.md
tools/office-skills/.agents/skills/pdf/SKILL.md
tools/office-skills/.agents/skills/slide/SKILL.md
tools/office-skills/.agents/skills/spreadsheets/SKILL.md
.agents/skills/electron/SKILL.md

Metadata

Files
0
Version
e48861a
Hash
fb660e05
Indexed
2026-07-25 10:20

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 23:23
浙ICP备14020137号-1 $방문자$