.agents/skills/canvas-workbench/SKILL.md
Use when work must be verified in local Canvas Workbench, or when the user asks to run, open, or check a component 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 balintbrews/canvas-starter 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": "./components",
"pagesDir": "./pages",
"aliasBaseDir": "src",
"globalCssPath": "./src/components/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.
Use Workbench as part of the normal implementation loop:
This skill is for starting and using Workbench, not for defining the Canvas component contract or detailed mock authoring rules.
canvas-component-definition when creating or validating the component
structure, component.yml, naming, or mock coverage expectations.canvas-component-definition/references/workbench-mocks.md when you need
to author or validate mocks.json.tools
Style Canvas components with Tailwind CSS 4 theme tokens and approved utility patterns. Use when (1) Creating a new component, (2) Adding colors or styling to components, (3) Working with Tailwind theme tokens, (4) Adding or updating design tokens in global.css, (5) Creating color/style props, (6) Any change where component props are added/removed/renamed/retyped and can affect rendered styles. Covers @theme variables, CVA variants, and cn() utility.
tools
Fetch and render Drupal content in Canvas components with JSON:API and SWR patterns. Use when building content lists, integrating with SWR, or querying related entities. Covers JsonApiClient, DrupalJsonApiParams, relationship handling, and filter patterns.
tools
Use utility components to render formatted text and media correctly. Use when (1) Rendering HTML text content from props, (2) Displaying images, (3) Working with formatted text or media. Covers FormattedText and Image utilities.
testing
Push validated Canvas component changes to Drupal Canvas and recover from common push failures. Use after component work is complete and validated. Handles dependency-related push failures that require retry.