Create canvas

From posit-dev/positron · View interactive version

Create canvas is an AI agent skill from the GitHub repository posit-dev/positron. Create a project Copilot extension canvas for the current workspace.

How to use this skill

Skill file

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.

Declare the canvas with:

Rules:

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:
  1. 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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.