Agent Skills
› phodal/routa
› canvas
canvas
GitHub用于生成 Routa Canvas 交互式可视化组件的 Skill。通过创建 .canvas.tsx 文件,利用 SDK 资源构建自包含的 TSX 源码,支持图表、布局等展示,避免副作用和冗余样式。
Trigger Scenarios
用户需要创建或更新 Routa Canvas 可视化界面
用户希望从会话中生成实时交互式画布
Install
npx skills add phodal/routa --skill canvas -g -y
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.tsxfile 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()orexport 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, orlocalStorage. - Do not render fake shell chrome such as
browser frames,global app shells,left sidebars, orchat panesunless 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_resourcewith uriresource://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
definitionResourceslist, preferably throughread_canvas_sdk_resource. - Import only from
routa/canvasorreact. - If a symbol or prop is not present in those resources, do not invent it.
- Example definition resources:
resource://routa/canvas-sdk/defs/primitivesresource://routa/canvas-sdk/defs/hooksresource://routa/canvas-sdk/defs/data-displayresource://routa/canvas-sdk/defs/containersresource://routa/canvas-sdk/defs/controlsresource://routa/canvas-sdk/defs/chartsresource://routa/canvas-sdk/defs/diff-viewresource://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


