Uh oh!
There was an error while loading. Please reload this page.
Add create-canvas skill for cloud agent canvas extension authoring - #42147
Conversation
Adds .github/skills/create-canvas/SKILL.md with the full canvas/extension authoring reference needed by GitHub Copilot cloud agents. Cloud agents lack the local SDK docs and create-canvas skill context that local sessions receive, so this skill embeds: - Complete authoring workflow (scaffold → edit → reload → verify → drive) - Extension shape and discovery rules - Full canvas API (createCanvas, CanvasOptions, CanvasAction, CanvasError) - Loopback server pattern with lifecycle cleanup - ID model (canvasId vs extensionId vs instanceId) - Agent-side canvas tools (open_canvas, list_canvas_capabilities, invoke_canvas_action) - Instruction injection (additionalContext hooks vs systemMessage) - State model (instanceId vs documentId, storage scopes) - App theme CSS tokens - Validation checklist and debugging steps - Gist sharing format - Common pitfalls Also registers the skill in AGENTS.md lazy-skill routing table. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new lazily-loadable create-canvas skill to provide cloud agents with a self-contained reference for authoring and debugging Copilot app canvas extensions, and wires it into the repository’s skill-routing guidance.
Changes:
- Add
.github/skills/create-canvas/SKILL.mdwith canvas extension authoring/debugging guidance, API snippets, and validation steps. - Update
AGENTS.mdto route canvas/extension work to the newcreate-canvasskill.
Show a summary per file
| File | Description |
|---|---|
AGENTS.md | Adds a new “use by intent” routing entry for canvas extension work → create-canvas skill. |
.github/skills/create-canvas/SKILL.md | Introduces a comprehensive canvas extension authoring reference for cloud agents (workflow, API, lifecycle, state, theme tokens, validation/debugging). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 6
- Review effort level: Low
| 2. **Scaffold via tool, don't hand-write the skeleton.** | ||
| ``` | ||
| extensions_manage({ operation: "scaffold", kind: "canvas", name: "<name>", location: "project" | "user" | "session" }) | ||
| ``` | ||
| The canvas scaffold produces an `extension.mjs` with `joinSession({ canvases: [createCanvas({...})] })`, a working loopback HTTP server per instance, an example action, and `onClose` cleanup. Edit from there. |
| ``` | ||
| // Open a canvas panel | ||
| open_canvas({ canvasId: "my-canvas", instanceId: "my-canvas-1", input?: {...} }) |
| list_canvas_capabilities({ canvasId: "my-canvas" }) | ||
| // Invoke an action on an open panel | ||
| invoke_canvas_action({ instanceId: "my-canvas-1", actionName: "do_thing", input?: {...} }) |
| 2. **Open** — call `open_canvas({ canvasId, input? })`. Confirm you receive `{ instanceId, url? }` and no error. | ||
| 3. **Action** — call `invoke_canvas_action({ instanceId, actionName, input? })` and confirm correct response payload. | ||
| 4. **Input validation** — call `open_canvas` with input that fails `inputSchema`. Expect `canvas_input_invalid`. | ||
| 5. **Reserved verb rejection** — call `invoke_canvas_action(instanceId, "canvas.open", ...)`. Expect `canvas_reserved_action_name`. |
| await session.log("message", { level?: "info"|"warning"|"error", ephemeral?: boolean }); | ||
| await session.send({ prompt: "...", attachments?: [{ type: "file", path: "..." }] }); |
| // session.sessionId — current session ID | ||
| ``` | ||
| Key event types: `assistant.message`, `tool.execution_start`, `tool.execution_complete`, `user.message`, `session.idle`, `session.error`, `permission.requested`, `session.shutdown`. |
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
Uh oh!
There was an error while loading. Please reload this page.
Covers the week's highlights including: - Copilot Canvas extension for agentic workflow operations (PR #42137) - create-canvas skill (PR #42147) - sandbox.agent.sudo: false coverage hits 80% (PR #42119) - Code Scanning Fixer expanded to all severity levels (PR #42139) - mcpg v0.3.32 + firewall v0.27.13 bump (PR #42146) - Agent of the Week: agent-persona-explorer Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🎉 This pull request is included in a new release. Release: |
Summary
Adds a new
create-canvasskill for authoring, validating, and debugging canvas extensions in the GitHub Copilot app. UpdatesAGENTS.mdwith a routing entry for the new skill.Changes
.github/skills/create-canvas/SKILL.md(new, 259 lines)New skill covering the full canvas extension lifecycle:
extensions_manage, editextension.mjs, reload withextensions_reload, verify withextensions_manage list/inspect, exercise vialist_canvas_capabilities/open_canvas/invoke_canvas_action.extension.mjs(ES modules; TS not supported);@github/copilot-sdkauto-resolved by CLI;stdoutreserved for JSON-RPC; tool names globally unique.createCanvassignature:id,displayName,description,inputSchema,actions[](each requiringhandler),open(idempotent), optionalonClose. Runtime rules:canvas.*action names reserved; Ajv input schema validation; context field isctx.canvasId, notctx.id.createServerbound to127.0.0.1with OS-assigned port;onClosecleanup; SSE/eventsfor iframe push updates.canvasId(type),extensionId(auto-derived${source}:${name}),instanceId(caller-supplied, max 128 chars, regex-validated).open_canvas,list_canvas_capabilities,invoke_canvas_action.additionalContextpath vssystemMessage(append/customizemodes);replacemode explicitly prohibited (discards safety guardrails).instanceId; storage scopes: session workspace, user global, per-artifact, in-repo, per-panel ephemeral.data-*attributes mirrored by runtime onto the canvas document.extensions_manage inspectsurfaces log path and tail; alwaysextensions_reloadafter edits.share_extension/install_extension; flat gist format withcopilot-extension.jsonmanifest.console.logcorrupts JSON-RPC; missing handlers; non-loopback server binding; non-idempotentopen; wrong context field; tool name collisions.session.log,session.send,session.sendAndWait,session.on, key event types.AGENTS.md(+1 line)Added routing entry in the lazy skill loading table for canvas extension tasks pointing to
.github/skills/create-canvas/SKILL.md.File inventory
.github/skills/create-canvas/SKILL.mdAGENTS.mdNotes
create-canvasskill is now discoverable via the lazy skill routing mechanism inAGENTS.md.