drupal-hook-patterns

Community

Modern Drupal hooks with robust OOP patterns.

AuthorAJV009
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Drupal module development often relies on procedural hook implementations in .module files. This skill provides modern OOP hook patterns using #[Hook] attributes and a legacy bridge for Drupal 10 compatibility, enabling maintainable, testable module code.

Core Features & Use Cases

  • OOP Hook pattern with #[Hook] attribute for Drupal 11+.
  • Legacy Bridge for Drupal 10 compatibility.
  • Examples of Form Alter, Entity Hooks, Theme Hooks, and Event Subscribers.
  • Use cases: migrate existing module code to OOP patterns, implement new hooks with clear separation of concerns.

Quick Start

Explain how to convert a legacy hook into an OOP hook using attributes in a module.

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-hook-patterns
Download link: https://github.com/AJV009/drupal-devkit/archive/main.zip#drupal-hook-patterns

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.