skills/canvas-workbench/SKILL.md
Use when work must be verified in local Canvas Workbench, or when the user asks to run, open, check, or author component mocks or page previews in Workbench. Verifies that Canvas Workbench is available through the project's package runner, starts the local Workbench dev server, and keeps Workbench verification as part of the implementation workflow.
npx skillsauth add drupal-canvas/skills canvas-workbenchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before trying to use Workbench, detect the project's package manager and use its
executable runner for @drupal-canvas/workbench.
Preferred commands:
npx @drupal-canvas/workbenchpnpm dlx @drupal-canvas/workbenchbunx @drupal-canvas/workbenchyarn dlx @drupal-canvas/workbenchChoose the command that matches the repository's package manager. Use lockfiles and existing project conventions to decide.
If the package runner or @drupal-canvas/workbench is not available, stop and
tell the user that Canvas Workbench is not available in the current environment.
Ask whether they want you to install it. If they say yes, install
@drupal-canvas/workbench as a dev dependency with the matching package
manager:
npm install --save-dev @drupal-canvas/workbenchpnpm add --save-dev @drupal-canvas/workbenchbun add --dev @drupal-canvas/workbenchyarn add --dev @drupal-canvas/workbenchAfter installation completes, use the matching runner command and continue with Workbench verification. If the user says no, stop and do not guess alternate startup commands.
Workbench does not require a canvas.config.json file when the project uses the
default Canvas layout.
Before starting Workbench, check whether the project appears to use the default paths:
componentDir: project rootpagesDir: ./pagesaliasBaseDir: srcglobalCssPath: ./src/components/global.cssIf the project uses those defaults and canvas.config.json is missing, proceed
without creating one.
If the project uses different component paths, pages paths, @/ import
resolution, or global CSS entrypoints, add or update canvas.config.json in the
project root before starting Workbench. Set only the options the project needs.
Example:
{
"componentDir": "./src/components",
"pagesDir": "./pages",
"aliasBaseDir": "src",
"globalCssPath": "./src/global.css"
}
When Workbench verification is needed and the package-runner command is available:
If a Workbench server is already running for the current project, reuse it instead of starting a second instance.
Workbench is the runtime surface for local preview verification. When verification is iterative, reuse the same Workbench server and preview route across fix/review loops.
Use Workbench as part of the normal implementation loop:
This skill is for starting and using Workbench and for coordinating page/mock authoring. It is not the source of truth for the Canvas component contract.
canvas-component-definition when creating or validating the component
structure, component.yml, naming, or mock coverage expectations.canvas-page-definition when creating or validating page JSON files, page
structure, or page schema requirements.canvas-component-definition/references/component-mocks.md when you need
to author or validate mocks.json.references/components.md when you need the Workbench-specific component
review flow and where component preview files live.references/pages.md when you need the Workbench-specific page preview
flow and configured page location.testing
Use for any task touching site chrome — header, footer, sidebar, or global navigation that repeats across pages — and for any region-spec work (create, modify, review, validate region JSON, or the project-level layout component). Also load when a task creates or edits multiple pages that share chrome, or asks for a "site" or "navigation between pages"; shared chrome belongs in regions, never inlined into page JSON.
content-media
Create and modify content templates that map Drupal content entities to Canvas component layouts. Use when asked to (1) Create a new content template, (2) Modify an existing content template, (3) Add or change entity field mappings in a template, (4) Compose components in a content template via slots. Content templates live in the configured `contentTemplatesDir` (default `content-templates/`) and define how Drupal entity types, bundles, and view modes render as Canvas component trees.
tools
Plans and builds Drupal Canvas navigation UI (main nav, footer links, sidebar nav, mobile drawers, breadcrumbs) using design decomposition for structure and props/slots, then JSON:API menu or page-context patterns from canvas-data-fetching. Use when the user asks for navigation, header or footer links, menus, menu_items, mobile nav, or breadcrumb trails. Run after canvas-design-decomposition for layout and API sketches; follow canvas-data-fetching for SWR, JsonApiClient, sortMenu, and menu fallbacks.
development
Plans structure for a component library with props/slots and right-sized component granularity. Run before building or adding Canvas components (new `src/components/` folders, component.yml, React), or for plan-only / breakdown-only work, whenever UI must map to a coherent tree. Mandatory for every new Figma frame or greenfield screen—repository drafts do not replace phases A–G.