.agents/skills/canvas-component-push/SKILL.md
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.
npx skillsauth add balintbrews/canvas-starter canvas-component-pushInstall 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 pushing, confirm the user has Drupal Canvas CLI installed and configured for their target site.
Before running any push command:
.env file exists in the project root..env exists, verify these values are set:
CANVAS_SITE_URLCANVAS_CLIENT_IDCANVAS_CLIENT_SECRET.env is missing, or any required value is missing, stop and ask the
user to complete setup first.When component work is complete and validated, ask the user if they would like
to push the current Canvas changes to Canvas. canvas push --yes will push all
current changes; it does not support selecting specific components. If there are
unrelated or unvalidated Canvas changes in the working tree, stop and ask the
user how they want to proceed. Make sure to use the right package manager. For
example, if using npm, run the following command:
npx canvas push --yes
Default behavior: always retry failed pushes unless the error is clearly a connection/setup failure.
Retry pushes when the failure indicates the Canvas app connection is already working (for example, dependency/order-related component errors). Do not retry connection/setup failures.
If push fails with authentication, authorization, or network/connection errors, stop and ask the user to complete or verify setup first. This includes errors like invalid credentials, unauthorized/forbidden responses, DNS issues, connection refused, host unreachable, request timeout before reaching Canvas, or TLS/SSL handshake/certificate failures.
Point the user to the official setup docs:
Ask them to verify and update .env values (CANVAS_SITE_URL,
CANVAS_CLIENT_ID, CANVAS_CLIENT_SECRET) and OAuth/CLI setup, then retry the
push only after they confirm setup updates are complete.
When pushing multiple new components where one component depends on another
(e.g., hero imports heading), the push may fail with a message indicating
that a component doesn't exist. This happens when a component that includes
another gets pushed before its dependency.
This is expected behavior. Simply retry the push command. On subsequent attempts, the dependencies that were successfully pushed in the previous run will already exist, allowing the dependent components to push successfully.
Example scenario:
hero fails because heading doesn't exist yet, but
heading pushes successfully.hero now succeeds because heading exists.If pushes continue to fail after multiple retries, check that all required dependency components are part of the current local changes or already exist in Canvas.
development
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.
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.