canvas-component-definition

Validate React component packages against the Canvas component contract.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/AJV009/drupal-devkit --skill canvas-component-definition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canvas-component-definition
Source: https://github.com/AJV009/drupal-devkit/tree/main/plugins/migrate-drupal-canvas/reference/canvas-starter/canvas-component-definition
Command: npx skills add https://github.com/AJV009/drupal-devkit --skill canvas-component-definition

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Canvas projects often diverge in component structure and metadata, causing integration and maintenance overhead. This skill standardizes the component contract to ensure consistency across repos.

Core Features & Use Cases

  • Defines required artifacts for a Canvas component: index.jsx, component.yml, and story conventions.
  • Validates folder naming, machineName alignment, and story placement to guarantee Canvas compatibility.
  • Use cases include creating new Canvas-ready components, migrating legacy components, and auditing existing components for conformance.

Quick Start

Review your repository to ensure all Canvas component contract requirements are present and aligned with the guidelines.

Frequently Asked Questions about canvas-component-definition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a React component for Canvas compatibility?

To validate a React component for Canvas compatibility, verify that index.jsx, component.yml, and stories align with Canvas metadata standards. This ensures proper folder structure, machineName alignment, and story placement for seamless integration.

What files are required for a Drupal Canvas component definition?

A Drupal Canvas component definition requires index.jsx, component.yml, and story files. These artifacts enforce the Canvas component contract, standardizing folder structure and metadata to prevent integration overhead across repositories.

How do I migrate legacy React components to Canvas component standards?

Migrating legacy React components to Canvas standards requires auditing existing structures against the Canvas component contract. You must align folder naming, ensure machineName alignment, and validate story placement to guarantee compatibility.

Does Canvas component validation work with Storybook stories?

Canvas component validation works with Storybook stories by checking story conventions and placement within the repository. It ensures story files align with the Canvas component contract alongside index.jsx and component.yml metadata.

Why does my Canvas component fail the metadata contract check?

Your Canvas component fails the metadata contract check when folder naming, machineName alignment, or story placement diverge from Canvas standards. The validation enforces required files like index.jsx and component.yml to maintain structural consistency.