画布应用创建
create-canvas-app
使用原生 create-canvas 技能和 Microsoft Canvas Toolkit 创建画布应用。包括计数器和只读 Azure 资源组入门模板。
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 10
- Forks
- 3
01 前言 Front Matter
- name
- create-canvas-app
- description
- Create a canvas app with the native create-canvas skill and Microsoft Canvas Toolkit. Includes counter and read-only Azure resource-group starters.
02 资源文件 24
- 参考文档references/toolkit.md4.7 KB
- 参考文档references/toolkit/auth.md26.5 KB
- 脚本references/toolkit/examples/custom-fetch-client.mjs2.2 KB
- 参考文档references/toolkit/examples/README.md3.7 KB
- 脚本references/toolkit/examples/resource-groups.mjs1.2 KB
- 脚本references/toolkit/examples/run-read-only.mjs1.7 KB
- 脚本references/toolkit/examples/sdk-client.mjs2.5 KB
- 许可证references/toolkit/LICENSE1.1 KB
- 参考文档references/toolkit/provenance.json1023 B
- 参考文档references/toolkit/quickstart.md5.7 KB
- 参考文档references/toolkit/README.md67.8 KB
- 参考文档references/toolkit/ui-components.md31.2 KB
- 脚本scripts/setup-toolkit.mjs37.9 KB
- 参考文档templates/azure-resource-groups/package.json602 B
- 参考文档templates/azure-resource-groups/README.md2.7 KB
- 脚本templates/azure-resource-groups/scripts/check-entry.mjs3.0 KB
- 脚本templates/azure-resource-groups/scripts/smoke.mjs4.6 KB
- 其他templates/azure-resource-groups/src/browser/app.css397 B
- 脚本templates/azure-resource-groups/src/browser/app.mjs5.0 KB
- 参考文档templates/azure-resource-groups/src/browser/index.html1.3 KB
- 脚本templates/azure-resource-groups/src/canvas.mjs4.1 KB
- 脚本templates/azure-resource-groups/src/domain.mjs6.3 KB
- 脚本templates/azure-resource-groups/src/fixture.mjs2.2 KB
- 脚本templates/azure-resource-groups/tests/app.test.mjs7.9 KB
03 SKILL.md 正文
Canvas toolkit companion
First action: invoke the host's installed create-canvas skill with
skill({ skill: "create-canvas" }). If already active, continue that invocation.
It is the source of truth for native scaffolding, SDK registration, lifecycle,
scope and activation. Follow its workflow, including its native scaffold step.
Apply this companion at the customization/build step, then return to that
workflow for verification. If unavailable, report that the required app skill
is missing; do not invent a replacement host workflow.
1. Choose the starter and package
For Azure requests, use --template azure-resource-groups. It already includes
auth, explicit subscription selection, a bounded reader, cancellation, shared
UI/agent state and the subscription picker. Do not generate a counter and
rebuild this wiring. Omit the template option for a generic counter.
Confirm one compatible toolkit source: an exact published npm version with
/build, or a local npm-pack tarball. Do not invent a published version, use
tags/ranges, publish a package, or switch sources after a failed installation.
Use the host-created canvas ID and extension.mjs. Its directory must contain
only that file. Choose a separate, new source-app directory under an existing
parent. Resolve symlinks in input/output paths first; setup rejects them and
does not merge existing projects.
2. Generate the source app
From this installed skill's directory, replace the placeholders:
node scripts/setup-toolkit.mjs --name my-canvas \
--scaffold "<native-scaffold>/extension.mjs" \
--output "<existing-parent>/my-canvas-source" \
--toolkit-version "<exact-version>" \
--template azure-resource-groups
Alternatively, replace --toolkit-version with
--toolkit-tarball "<toolkit-package>.tgz". Choose exactly one.
Setup copies the native entry unchanged and creates the app's package, source,
assets and build checks. It performs no install, sign-in or resource read.
It refuses any existing destination, including identical output. Registry mode
is offline until npm install; an incompatible installed package fails build.
The Azure template requires the full exported plugin, including bundled guides.
3. Connect and build
Follow the generated README to import attachToolkit into the copied
src/extension.mjs and wrap the existing createCanvas options. Preserve native
metadata and session wiring. The adapter replaces scaffold demo callbacks and
chains close handling; custom callbacks or shutdown handlers need explicit
integration. Do not create a second provider.
npm install
npm run build
npm test
For Azure, also run npm run smoke with installed Chrome or CANVAS_BROWSER.
Do not download a browser automatically. Keep checks scoped to the generated
app during iteration, and retain its lockfile for later npm ci.
Source generation alone is NOT READY. Build checks the emitted host entry's
registration and toolkit connection using a test SDK adapter. This executes
trusted code; it is not native-host activation. Return to the host skill to
install the whole dist/, reload the provider and verify the actual panel.
4. Customize without changing the contracts
- UI and agent calls use the same validated actions and state. No raw prompt forwarding or separate chat-only Azure implementation.
- Azure mode is lazy: no profile read, login, default subscription selection, resource query or cloud write on open. Each panel owns its scope and results.
- Keep credentials server-side, cancel obsolete work and reject stale results. Empty success, missing scope, errors and cancellation must remain distinct.
- Use labelled
{"mode":"fixture"}data for tests. Do not report it as live Azure. - Use toolkit controls (
ui/dom, withui/styles.cssthenui/base.css) and host type tokens for new UI. Keep body text normal weight and headings modest; avoid hand-styled buttons. The Azure starter adds no product telemetry. - Keep the generated build's dependencies and asset layout. Check decoded images as well as controls; do not replace missing assets with SVG rewrites.
- State is ephemeral. Follow the host skill for persistence and shutdown. A panel refresh is not a provider reload; check the displayed build ID.
When adding product telemetry
Do not add telemetry by default to generated apps. If requested, use the shared toolkit collector and follow Product-usage telemetry. Update Usage data in the public and packaged README, link to the shared disable instructions, and review the emitted notice. Test opt-out behavior, not README phrases.
Use the integration reference for adapter/build details and the Azure quickstart for customization. Toolkit guide links are assembled in the exported plugin, not maintained as copies in the source tree. Installation, publication and cloud mutations remain separate user decisions.
04 同仓库更多 Skills
本地容器状态查看与管理
containers
打开 Containers 画布以查看现有的本地 Docker 或 Podman 容器、Compose 应用和镜像:哪些在运行、已停止或正在重启;容器日志或组合的 Compose 日志;CPU、内存、端口、文件;生命周期控制;镜像层和来源。Compose 应用会被自动发现并分组。不用于编写 Dockerfile 或 Compose 文件、部署 Compose 应用、注册表或云容器服务,或从未生成容器的构建失败。
Azure 存储资源管理
azure-storage
首先打开 Azure Storage 画布以浏览存储账户、容器、blob、队列、表和文件共享,运行带实时进度显示的批量传输,通过统计信息筛选,生成 SAS 链接,并规划账户到账户的复制。不用于预配存储账户或基础设施即代码。
Azure SRE 事件调查画布
azure-sre-agent-canvas
打开 SRE Agent Canvas 以查看失败的 Azure 应用、ICM/S360 工单、关联的调查跟进、证据、假设、阻碍和事件交接。也可操作 SRE 事件、任务、连接器和记忆。不用于插件开发/测试、基础设施实施或不相关的 KQL 编写。
Azure 资源清单查询
azure-resources-query
仅用于明确请求以列出、查找或浏览现有 Azure 资源清单作为答案,明确请求打开 Azure Resources Query,或明确引用其当前结果的进一步细化。不用于其他工作流中的附带发现、单个资源详情、计数、纯文本答案、编写/解释 KQL、代码/文档/路由讨论、遥测、创建、部署、配置、访问变更或登录。
Azure Functions 迁移升级
azure-functions-update
仅当用户明确要求使用或恢复 azure-functions-update 时才使用。通过已批准的场景迁移 Azure Functions 编程模型和配置。当前场景包括:C# 进程内(in-process)迁移到 .NET 独立工作进程(isolated worker)、Python 编程模型 v1 到 v2、Python Blob SDK 类型绑定、Python HTTP 流式传输、扩展捆绑包(extension bundles)v1-v3 到 v4,以及 Durable Functions 扩展 v1 或 v2 迁移到当前版本。语言版本和托管计划更新属于单独的交接事项。不要从一般性更新请求,或问题、引文、文件、审查中出现的名称来选择此工作流。
Azure Functions 开发环境搭建
azure-functions-setup
验证前置条件并搭建 Azure Functions 开发环境。