twig-templating

Standardize Drupal Twig templates with naming conventions and BEM CSS patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes Twig templating in Drupal projects to reduce inconsistencies across themes and templates.

Core Features & Use Cases

  • Twig pattern usage: standard templates such as node templates, block templates, and page templates are consistently named and structured.
  • Theme hook integration: guidelines for implementing theme hooks and preprocess use-cases.
  • Component architecture: guidance for building front-end components with consistent structure.

Quick Start

Create a Drupal 10 Twig template using the described patterns and naming conventions.

Frequently Asked Questions about twig-templating

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

FAQPage Schema
How do I standardize Drupal Twig templating across different themes?▼

Standardizing Drupal Twig templating involves enforcing consistent template naming conventions, applying BEM-based CSS class patterns, and using defined Twig functions to reduce inconsistencies across node, block, and page templates.

What is the best way to structure front-end components in Drupal 10 themes?▼

Structuring front-end components in Drupal 10 involves using standardized Twig templates with BEM-based CSS class patterns and integrating theme hooks to ensure consistent component architecture across the project.

How do I apply theme hooks and preprocess functions in Drupal Twig templates?▼

Applying theme hooks in Drupal Twig templates involves following specific guidelines for integrating hooks and preprocess use-cases, ensuring that data is consistently structured before rendering in node or block templates.

Does this Twig templating approach work for Drupal 11 theme development?▼

Yes, this Twig templating approach is applicable to Drupal 11 theme development, providing standardized patterns for template naming, Twig functions, and BEM-based CSS class structures for front-end components.

Why are my Drupal Twig templates inconsistent across different themes?▼

Drupal Twig templates become inconsistent when developers lack standardized guidelines for template naming, theme hook integration, and BEM-based CSS class patterns, leading to fragmented front-end component architecture.