create-canvas
microsoft/vscode/extensions/copilot/assets/prompts/skills/create-canvas/SKILL.md
Create a project Copilot extension canvas for the current workspace.
- Reads credentials
What's in it
- Clarify only when needed
- Inspect first
- Implement
- Validate
---
name: create-canvas
description: 'Create a project Copilot extension canvas for the current workspace.'
argument-hint: What should the canvas show or let users do?
user-invocable: true
---
Create a working canvas extension in the current workspace. Do the implementation rather than only returning a sample.
Project extensions are shared with everyone who works in the repository, and any Copilot host may load them. Build only on the Copilot SDK contract described here; do not depend on environment variables, paths, APIs, or UI behavior specific to one host.
## Clarify only when needed
The extension scope is fixed: create a project extension under `.github/extensions/<name>/`.
If the requested canvas purpose is unclear, ask what it should display or let the user do. If durable state is required but its identity or lifetime is ambiguous, ask whether the state belongs in a workspace artifact or private extension storage.
## Inspect first
Before writing:
1. Check for existing `.github/extensions/` conventions and reusable UI/server helpers. Do not copy host-specific dependencies from them.
2. Choose a short kebab-case extension folder name and a stable kebab-case canvas ID. The canvas ID also names the extension's private data folder, which every repository on the machine shares, so make it distinctive: qualify generic names with the project or domain, for example `contoso-release-board` rather than `board`.
3. Identify the domain identity for durable state, such as a file path, document ID, or record ID. `instanceId` identifies a panel, not its data.
## Implement
Create `.github/extensions/<name>/extension.mjs`.
- Use ES modules and import `createCanvas`, `CanvasError`, and `joinSession` from `@github/copilot-sdk/extension`.
- Do not create a `package.json` or install `@github/copilot-sdk`; the runtime resolves it automatically.
- Never write to stdout with `console.log`. Use `session.log()` for diagnostics.
- Bind embedded HTTP servers to `127.0.0.1` on an ephemeral port.
- Return an HTTP URL from `open()`. Do not place credentials or private state in the URL.
- Treat `open()` as idempotent. Reopening the same `instanceId` must reuse or safely replace its live server and reload state from the stable domain identity.
- Store repo-owned artifacts at a sensible workspace path when the user expects them to be versioned or directly editable.
- Store private durable data outside the repository, in `extension-data/<canvas-id>/` under the Copilot home that every Copilot host shares: `process.env.COPILOT_HOME` exactly as given whenever it is non-empty, as the runtime uses it, otherwise `path.join(os.homedir(), '.copilot')`. Create directories on first use.
- Several sessions, workspaces, and hosts may run the extension at the same time, so:
- key records by their domain identity so workspaces do not overwrite each other's state;
- write each file atomically: write a uniquely named temporary file in the same directory, then rename it over the target;
- store a format marker and version with the data, validate them and the data's shape on every read, and report unrecognized or corrupt data instead of overwriting it;
- report storage failures from `open()` or actions with `CanvasError` instead of failing to load.
- Use semantic HTML, keyboard-accessible controls, visible focus, labels, and ARIA status text. The page is ordinary web content with no privileged host bridge; use same-origin HTTP endpoints or server-sent events.
- Escape untrusted values before inserting them into HTML and validate every HTTP and action input.
Declare the canvas with:
- a short single-sentence `description`;
- an optional `inputSchema`;
- agent-facing `actions[]`;
- an `open` handler;
- an `onClose` handler that stops instance-owned servers.
Rules:
- If the canvas takes no input, omit `inputSchema`. If it declares an object schema, callers must open it with an object such as `{}`, not `null`.
- Action names must not start with `canvas.`.
- Every action must have a handler and its own JSON Schema when it accepts input.
- Return raw action results. Throw `new CanvasError(code, message)` for expected failures.
- Do not rely on `onClose` when the user closes a canvas view; hosts may hide a presentation without closing its instance. Preserve the live instance so a later agent reopen can show the same state.
Keep `extension.mjs` focused on wiring. Put substantial HTML, CSS, client JavaScript, schemas, storage, and domain logic in sibling modules or asset files.
## Validate
1. Run `node --check .github/extensions/<name>/extension.mjs` and the smallest relevant extension tests.
2. Call `extensions_reload` after creating or modifying the extension. This stops and restarts all extension providers; previously open canvases are rehydrated after their providers reconnect.
3. After reload, do not claim success until the runtime confirms the canvas:
- call `list_canvas_capabilities` for the canvas ID;
- call `open_canvas` with a stable `instanceId` and schema-valid input;
- call at least one `invoke_canvas_action` when actions exist.
4. Call `open_canvas` again with the same `instanceId` and confirm the canvas shows the preserved state instead of starting over.
Summarize the files created, the canvas and action IDs, where state is stored, and the reload and runtime verification results.
More agent context in microsoft/vscode
89 other files this repository gives its agents, the first 60 shown.
AGENTS.md
- AGENTS.md
- extensions/copilot/assets/prompts/skills/agent-customization/references/agents.md
- extensions/copilot/src/extension/chatSessions/copilotcli/AGENTS.md
- extensions/copilot/src/platform/authentication/common/AGENTS.md
- src/vs/platform/agentHost/AGENTS.md
- src/vs/platform/agentHost/common/state/AGENTS.md
- src/vs/platform/agentHost/node/copilot/prompts/AGENTS.md
- src/vs/platform/agentHost/test/node/AGENTS.md
- src/vs/workbench/contrib/imageCarousel/AGENTS.md
Copilot instructions
Skill
- launch.agents/skills/launch/SKILL.md
- github-copilot-upgraderextensions/copilot/.agents/skills/github-copilot-upgrader/SKILL.md
- launchextensions/copilot/.agents/skills/launch/SKILL.md
- agent-customizationextensions/copilot/assets/prompts/skills/agent-customization/SKILL.md
- chronicleextensions/copilot/assets/prompts/skills/chronicle/SKILL.md
- create-agentextensions/copilot/assets/prompts/skills/create-agent/SKILL.md
- create-hookextensions/copilot/assets/prompts/skills/create-hook/SKILL.md
- create-instructionsextensions/copilot/assets/prompts/skills/create-instructions/SKILL.md
- create-promptextensions/copilot/assets/prompts/skills/create-prompt/SKILL.md
- create-skillextensions/copilot/assets/prompts/skills/create-skill/SKILL.md
- get-search-view-resultsextensions/copilot/assets/prompts/skills/get-search-view-results/SKILL.md
- initextensions/copilot/assets/prompts/skills/init/SKILL.md
- install-vscode-extensionextensions/copilot/assets/prompts/skills/install-vscode-extension/SKILL.md
- migrate-customizationsextensions/copilot/assets/prompts/skills/migrate-customizations/SKILL.md
- project-setup-info-context7extensions/copilot/assets/prompts/skills/project-setup-info-context7/SKILL.md
- project-setup-info-localextensions/copilot/assets/prompts/skills/project-setup-info-local/SKILL.md
- troubleshootextensions/copilot/assets/prompts/skills/troubleshoot/SKILL.md
- accessibility.github/skills/accessibility/SKILL.md
- agent-host-chat-contributions.github/skills/agent-host-chat-contributions/SKILL.md
- agent-host-e2e-tests.github/skills/agent-host-e2e-tests/SKILL.md
- agent-host-logs.github/skills/agent-host-logs/SKILL.md
- author-contributions.github/skills/author-contributions/SKILL.md
- auto-perf-optimize.github/skills/auto-perf-optimize/SKILL.md
- azure-pipelines.github/skills/azure-pipelines/SKILL.md
- build-champ-triage.github/skills/build-champ-triage/SKILL.md
- chat-customizations-editor.github/skills/chat-customizations-editor/SKILL.md
- chat-perf.github/skills/chat-perf/SKILL.md
- chat-pet-sprite-creation.github/skills/chat-pet-sprite-creation/SKILL.md
- ci-artifact-testing.github/skills/ci-artifact-testing/SKILL.md
- codenotify.github/skills/codenotify/SKILL.md
- code-oss-logs.github/skills/code-oss-logs/SKILL.md
- code-review.github/skills/code-review/SKILL.md
- component-fixtures.github/skills/component-fixtures/SKILL.md
- component.github/skills/component/SKILL.md
- cpu-profile-analysis.github/skills/cpu-profile-analysis/SKILL.md
- customizations-in-the-agent-host.github/skills/customizations-in-the-agent-host/SKILL.md
- design-philosophy.github/skills/design-philosophy/SKILL.md
- doc-comments.github/skills/doc-comments/SKILL.md
- experiments.github/skills/experiments/SKILL.md
- feature-tryouts.github/skills/feature-tryouts/SKILL.md
- feedback-learning.github/skills/feedback-learning/SKILL.md
- fix-ci-failures.github/skills/fix-ci-failures/SKILL.md
- fixissueno.github/skills/fixissueno/SKILL.md
- flaky-smoke-tests.github/skills/flaky-smoke-tests/SKILL.md
- heap-snapshot-analysis.github/skills/heap-snapshot-analysis/SKILL.md
- integrated-browser.github/skills/integrated-browser/SKILL.md
- integration-tests.github/skills/integration-tests/SKILL.md
- issue-grouping.github/skills/issue-grouping/SKILL.md
- memory-leak-audit.github/skills/memory-leak-audit/SKILL.md
Discussion
Evidence it works
Elsewhere, people who say they tested it. Read them for what they measured.
- Mar 23, 2017 · Hacker News · VS Code uses 13% CPU when idle due to blinking cursor rendering
Talked about elsewhere, linking to microsoft/vscode
- VS Code inserting 'Co-Authored-by Copilot' into commits regardless of usage
Hacker News · 1,513 points · 850 comments · May 2, 2026
- Get to know GitHub Copilot in VS Code and be productive IMMEDIATELY
YouTube · Visual Studio Code · 843,444 views · 167 comments · Feb 15, 2024
- Choose folders to be ignored during search in VS Code
Stack Overflow · 1,392 votes · Oct 29, 2015
- Decided to quit being hard headed and just do what everyone else is doing/has done.
Bluesky · @advanced-eschatonics.com · 12 likes and reposts · 1 replies · Jan 18, 2026
- Convert the codebase to modules
GitHub · microsoft/TypeScript · 1,287 reactions · 56 comments · Nov 2, 2022
- VS Code uses 13% CPU when idle due to blinking cursor rendering
Hacker News · 899 points · 760 comments · Mar 23, 2017
- Get started with Copilot Free in VS Code
YouTube · Visual Studio Code · 391,420 views · 190 comments · Dec 19, 2024
- How can I convert tabs to spaces and vice versa in an existing file?
Stack Overflow · 456 votes · May 29, 2016
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

