drupal-twig

Community

Twig templates best practices for Drupal theming.

Authoredutrul
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Drupal theming often suffers from inconsistent Twig templates, unsafe output, and scattered best practices. This skill provides a concise, actionable guide to keep Twig templates secure, translatable, and maintainable within Drupal, including library attachment and SDC usage.

Core Features & Use Cases

  • Auto-escaping and safe output rules to prevent XSS.
  • Translation blocks using {% trans %} for all user-facing strings.
  • Attaching libraries with {{ attach_library() }} and leveraging Single Directory Components (SDC) for reusable templates.
  • Debugging support and template suggestion patterns to improve theme consistency across view modes.

Quick Start

Apply these Twig guidelines when editing Drupal templates to ensure safe, maintainable theming.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: drupal-twig
Download link: https://github.com/edutrul/drupal-ai/archive/main.zip#drupal-twig

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.