drupal-plugins

Implement Drupal plugin architectures using PHP attributes and ContainerFactoryPluginInterface.

67|13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/edutrul/drupal-ai --skill drupal-plugins
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-plugins
Source: https://github.com/edutrul/drupal-ai/tree/main/.claude/skills/drupal-plugins
Command: npx skills add https://github.com/edutrul/drupal-ai --skill drupal-plugins

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drupal plugin development can be complex due to the variety of plugin types, discovery methods, and dependency-injection requirements; this skill consolidates guidance for building Block, Field, Condition, and Filter plugins using PHP attributes and the ContainerFactoryPluginInterface.

Core Features & Use Cases

  • Provides PHP attribute-based plugin discovery (Drupal 11+)
  • Demonstrates DI via ContainerFactoryPluginInterface and modern plugin managers
  • Includes scaffolding guidance for Block, Field, Condition, and Filter plugins in Drupal projects

Quick Start

Create a new Drupal plugin by extending the appropriate base class and applying the PHP attribute with a valid plugin id and admin label.

Frequently Asked Questions about drupal-plugins

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

FAQPage Schema
How do I create a Drupal plugin using PHP attributes in Drupal 11?

To create a Drupal plugin using PHP attributes in Drupal 11, extend the appropriate base class and apply the PHP attribute with a valid plugin id and admin label for discovery. This modern approach replaces annotations for Block, Field, Condition, and Filter plugins.

What is the best way to migrate Drupal plugins from annotations to PHP attributes?

Migrating Drupal plugins from annotations to PHP attributes involves replacing annotation docblocks with attribute classes while maintaining the plugin id and metadata. This update is necessary for modern Drupal 11 plugin discovery and compatibility.

How does dependency injection work with Drupal plugin managers and ContainerFactoryPluginInterface?

Dependency injection with Drupal plugin managers uses ContainerFactoryPluginInterface to pass services directly into plugin instances. This allows your Block, Field, Condition, or Filter plugins to access external services without relying on global calls.

Can I scaffold different types of Drupal plugins like Block and Field using PHP attributes?

Yes, you can scaffold Block, Field, Condition, and Filter plugins using PHP attributes. This skill provides scaffolding guidance by extending the specific base class for each plugin type and defining the required attribute metadata.

Do I need PHP attributes for plugin discovery in Drupal 11?

Yes, PHP attributes are the standard for plugin discovery in Drupal 11, replacing the older annotation docblocks. Using attributes ensures your Block, Field, Condition, and Filter plugins are correctly discovered by modern plugin managers.