Index of every page on this site: llms.txt
All skills
grasmash avatar

/drupal-canvas-sdc

@19514f4
Run it yourself

Drupal Canvas SDC (Single Directory Components) with Twig templates. Use when creating, modifying, or troubleshooting Twig-based Canvas components in themes/modules, component.yml schemas, Canvas registration (props need title, required props need examples), canvas.component config entities, component versioning and outdated instances, config drift after a Canvas upgrade, Canvas preview issues, or page builder functionality. For React/JSX Code Components, see the upstream drupal-canvas/skills suite.

Use this Skill: https://skilld.dev/gh/grasmash/drupal-claude-skills/drupal-canvas-sdc

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesprops-and-slots.md

≈621 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Props, Validation and Slots

Prop types and their Canvas widgets, schema validation patterns, and slot composition for Twig SDCs.

Contents

Rich Text Props

content:
  type: string
  title: Rich Text Content
  contentMediaType: text/html
  x-formatting-context: block  # or 'inline'
  examples: ['<p>Formatted <strong>content</strong></p>']

Enum Labels (Human-Readable Dropdowns)

color:
  type: string
  enum: ['primary', 'secondary', 'danger']
  meta:enum:
    primary: "Primary Brand Color"
    secondary: "Secondary Accent"
    danger: "Warning/Error State"

Validation Patterns

Required Properties

props:
  type: object
  required:
    - title
    - url
  properties:
    title:
      type: string

Numeric Constraints

spacing:
  type: integer
  minimum: 0
  maximum: 100

heading_level:
  type: integer
  enum: [2, 3, 4, 5, 6]

Nullable Values

subtitle:
  type: ['string', 'null']
  title: Optional Subtitle

Array Constraints

tags:
  type: array
  items:
    type: string
  minItems: 1
  maxItems: 5

Slots for Composition

Slots accept arbitrary markup or nested components. Props handle typed data; slots handle content.

Define Slots

slots:
  header:
    title: Header Content
    description: Optional header area
  body:
    title: Body Content
  footer: {}  # Minimal definition

Render Slots in Twig

<article class="card">
  {% if header %}
    <header class="card__header">{{ header }}</header>
  {% endif %}
  <div class="card__body">{{ body }}</div>
  {% if footer %}
    <footer class="card__footer">{{ footer }}</footer>
  {% endif %}
</article>

Populate Slots with Embed

{% embed 'my_theme:card' with { heading: 'Featured Article' } only %}
  {% block body %}
    {{ content.field_image }}
    <p>{{ content.field_summary }}</p>
    {{ include('my_theme:button', { text: 'Read More', url: url }) }}
  {% endblock %}
{% endembed %}

Populate Slots from PHP

$build = [
  '#type' => 'component',
  '#component' => 'my_theme:card',
  '#props' => ['heading' => $title],
  '#slots' => [
    'body' => ['#markup' => $content],
    'footer' => $footer_render_array,
  ],
];

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides instructional documentation and utility scripts for Drupal developers using the Canvas module and Single Directory Components (SDC). No malicious patterns were detected.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 19514f4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago

README badge

README badge for grasmash/drupal-claude-skills/drupal-canvas-sdc