AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Drupal Plugins

skill-edutrul-drupal-ai-drupal-plugins · by edutrul

Drupal plugin system — Block, Field, Condition, Filter plugins with PHP attributes and ContainerFactoryPluginInterface.

No reviews yet
0 installs
41 views
0.0% view→install

Install

$ agentstack add skill-edutrul-drupal-ai-drupal-plugins

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-edutrul-drupal-ai-drupal-plugins)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Drupal Plugins? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Drupal Plugins (Drupal 11)

Example (Best Practice)

// src/Plugin/Block/MyBlock.php
namespace Drupal\my_module\Plugin\Block;

use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[Block(
  id: 'my_block',
  admin_label: new TranslatableMarkup('My Block'),
  category: new TranslatableMarkup('Custom'),
)]
final class MyBlock extends BlockBase implements ContainerFactoryPluginInterface {

  use StringTranslationTrait;

  public function __construct(
    array $configuration,
    string $plugin_id,
    mixed $plugin_definition,
    private readonly EntityTypeManagerInterface $entityTypeManager,
  ) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
  }

  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container->get('entity_type.manager'),
    );
  }

  public function build(): array {
    return [
      '#markup' => $this->t('Hello from my block.'),
      '#cache' => [
        'tags' => ['node_list'],
        'contexts' => ['user.permissions'],
      ],
    ];
  }

}

Note: Plugins are discovered via attributes (or annotations in legacy code), not services.yml.

PHP Attributes vs Annotations

Use PHP attributes (Drupal 10.2+, required style for Drupal 11):

#[Block(id: 'my_block', admin_label: new TranslatableMarkup('My Block'))]

Legacy (discouraged):

// @Block(id = "my_block", admin_label = @Translation("My Block"))

Configurable Block (blockForm / blockSubmit)

public function defaultConfiguration(): array {
  return ['limit' => 5];
}

public function blockForm(array $form, FormStateInterface $form_state): array {
  $form['limit'] = [
    '#type' => 'number',
    '#title' => $this->t('Limit'),
    '#default_value' => $this->configuration['limit'],
  ];
  return $form;
}

public function blockSubmit(array $form, FormStateInterface $form_state): void {
  $this->configuration['limit'] = $form_state->getValue('limit');
}

Plugin Generators

drush generate plugin:block
drush generate plugin:field:formatter
drush generate plugin:field:widget
drush generate plugin:field:type
drush generate plugin:condition
drush generate plugin:filter

Mental Model

| | | |---|---| | Discovery | Via PHP attributes (or legacy annotations) — not services.yml | | Instantiation | By plugin managers, not the service container | | DI | Requires ContainerFactoryPluginInterface | | Manager | Each plugin type has its own manager (e.g., BlockManager) | | Plugin ID | Must be unique — used internally by Drupal to identify the plugin |

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.