drupal-frontend
БесплатноЗапускает вложенные скриптыНе проверенDrupal Front End Specialist skill for theme development, Twig templates, and rendering system (Drupal 8-11+). Use when working with Drupal themes, Twig…
Об этом скилле
Drupal Front End Development
Overview
Enable expert-level Drupal front end development capabilities. Provide comprehensive guidance for theme development, Twig templating, preprocessing, responsive design, and asset management for Drupal 8, 9, 10, and 11+.
When to Use This Skill
Invoke this skill when working with:
- Theme development: Creating or customizing Drupal themes
- Twig templates: Writing or modifying .twig template files
- Preprocessing: Implementing preprocess functions for templates
- Template suggestions: Adding custom template naming patterns
- CSS/JS libraries: Managing theme assets and dependencies
- Responsive design: Implementing breakpoints and mobile-first design
- Rendering system: Understanding Drupal's rendering pipeline
- Theme hooks: Implementing theme-related hooks and alterations
Core Capabilities
1. Theme Development
Build complete, standards-compliant Drupal themes with proper structure:
Quick start workflow:
- Use theme template from
assets/theme-template/as starting point - Replace
THEMENAMEwith your theme's machine name - Replace
THEMELABELwith human-readable name - Customize templates, CSS, JS, and libraries
- Enable theme and configure via Appearance UI
Theme components:
.info.yml- Theme metadata and configuration.libraries.yml- CSS/JS library definitions.theme- Preprocess functions and theme logic.breakpoints.yml- Responsive breakpointstemplates/- Twig template filescss/- Stylesheetsjs/- JavaScript files
Reference documentation:
references/theming.md- Complete theming guide with examples
2. Twig Template System
Master Twig syntax and Drupal-specific extensions:
Twig fundamentals:
{{ variable }}- Print variables{% if/for/set %}- Control structures and logic{# comment #}- Comments and documentation{{ var|filter }}- Apply filters to variables{% extends %}- Template inheritance{% block %}- Define overridable sections
Drupal-specific Twig:
{{ 'Text'|t }}- Translate strings{{ attach_library('theme/library') }}- Load CSS/JS{{ url('route.name') }}- Generate URLs{{ path('route.name') }}- Generate paths{{ file_url('public://image.jpg') }}- File URLs{{ content|without('field') }}- Exclude fields
Common templates:
page.html.twig- Page layout structurenode.html.twig- Node displayblock.html.twig- Block renderingfield.html.twig- Field outputviews-view.html.twig- Views output
3. Preprocessing Functions
Modify template variables before rendering:
Preprocess pattern:
function THEMENAME_preprocess_HOOK(&$variables) {
// Add or modify variables
// Access entities, services, configuration
// Prepare data for templates
}
Common preprocess hooks:
hook_preprocess_page()- Page-level variableshook_preprocess_node()- Node-specific datahook_preprocess_block()- Block modificationshook_preprocess_field()- Field alterationshook_preprocess_html()- HTML document
Best practices:
- Keep logic in preprocess, markup in templates
- Use dependency injection when possible
- Cache properly with cache contexts/tags
- Document complex preprocessing
4. Template Suggestions
Provide specific templates for different contexts:
Suggestion patterns:
page--front.html.twig # Homepage
page--node--{nid}.html.twig # Specific node
page--node--{type}.html.twig # Content type
node--{type}--{viewmode}.html.twig # Type + view mode
block--{plugin-id}.html.twig # Specific block
field--{entity}--{field}.html.twig # Specific field
Adding suggestions:
function THEMENAME_theme_suggestions_HOOK_alter(array &$suggestions, array $variables) {
// Add custom suggestions
$suggestions[] = 'custom__suggestion';
}
5. CSS & JavaScript Management
Organize and load theme assets efficiently:
Library definition:
# THEMENAME.libraries.yml
global-styling:
version: 1.0
css:
base:
css/base/reset.css: {}
theme:
css/theme/styles.css: {}
js:
js/custom.js: {}
dependencies:
- core/drupal
Loading libraries:
- Global: Define in
.info.yml - Conditional: Use
attach_library()in templates - Preprocessed: Attach in preprocess functions
Best practices:
- Separate CSS into layers (base, layout, component, theme)
- Use CSS aggregation in production
- Minimize JavaScript dependencies
- Leverage Drupal's asset library system
6. Responsive Design
Implement mobile-first, accessible designs:
Breakpoints definition:
# THEMENAME.breakpoints.yml
THEMENAME.mobile:
label: Mobile
mediaQuery: 'screen and (min-width: 0px)'
weight: 0
THEMENAME.tablet:
label: Tablet
mediaQuery: 'screen and (min-width: 768px)'
weight: 1
THEMENAME.desktop:
label: Desktop
mediaQuery: 'screen
Установить drupal-frontend в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл drupal-frontend?
Drupal Front End Specialist skill for theme development, Twig templates, and rendering system (Drupal 8-11+). Use when working with Drupal themes, Twig syntax, preprocessing, CSS/JS libraries, or template suggestions.
Как установить скилл drupal-frontend?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл drupal-frontend запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic