Open Source · Drupal · AI Engineering

Drupal AI

Production-ready AI workflows for enterprise Drupal teams

I design systems where AI is not a toy —
it becomes part of the engineering workflow.

Standardized knowledge Faster onboarding Consistent code quality at scale

Modern Drupal teams don't fail because of lack of tools.
They fail because of fragmented knowledge.

Inconsistent delivery

Slower velocity

Hidden technical debt

Drupal AI is not a set of prompts.
It's a structured system for AI-assisted development.

🧠

Skills

Reusable domain knowledge — Drupal, security, architecture. 30+ skills

🤖

Agents

Task-specific execution — PR review, planning, debugging. 9 agents

📋

Rules

Enforced engineering standards. Not suggestions — constraints. 8 rule files

⚙️

Hooks

Automated workflows — code quality gates, validation pipelines. automated

❌ "chat assistant"
✅ engineering infrastructure

30+ domain knowledge modules

Each skill is a focused, versionable knowledge file. The AI loads only what it needs — no bloated context, no hallucinated patterns.

drupal-services

DI patterns for controllers, forms, and plugins via ContainerFactoryPluginInterface.

drupal-security

Route permissions, CSRF, XSS prevention, SQL injection prevention, secure file uploads.

drupal-entity-api

Load, create, update, delete entities using entity_type.manager. Node, User, Term, Media.

drupal-hooks

Drupal 11 OOP and procedural hooks — #[Hook] attribute, hook_form_alter, event subscribers.

drupal-caching

Cache tags, contexts, max-age, cache bins, invalidation, render array metadata.

drupal-queries

Select/Insert/Update/Delete via abstraction layer. Never concatenate SQL.

drupal-routes

routing.yml, admin routes, controllers, route parameters, title callbacks, upcasting.

drupal-plugins

Block, Field, Condition, Filter plugins with PHP attributes and ContainerFactoryPluginInterface.

drupal-migrations

D7-to-D11 upgrades, CSV/JSON imports, custom source/process/destination plugins.

drupal-twig

Best practices, auto-escaping, translation, library attaching, debugging, SDC components.

drupal-debugging

Devel, Drush watchdog, Twig debug, XDebug, error logging, troubleshooting patterns.

drupal-unit

UnitTestCase — isolated PHP logic with no Drupal bootstrap, mocking dependencies.

ddev-expert

DDEV containers, configuration, troubleshooting local development environments.

drupal-access

permissions.yml, access callbacks, AccessResult, custom access checkers, entity access.

+ 16 more skills

drupal-form-api, drupal-form-alter, drupal-paragraphs, drupal-search-api, drupal-state, drupal-taxonomy, drupal-render, drupal-events, drupal-fields, drupal-javascript, drupal-kernel, drupal-menus, drupal-form-ajax, drupal-form-validation, drupal-contrib-mgmt, drupal-composer View all on GitHub →

9 specialized agents

Agents are task-specific executors. Each one knows exactly what tools to use, which skills to load, and what quality bar to hit before returning results.

drupal-backend-dev implements

Modules, hooks, services, routing, and Drush commands. Loads 14 skills on spawn.

drupal-reviewer reviews

Expert Drupal code reviewer. Enforces quality, security, and best practices on every change.

code-reviewer reviews

General code review — bugs, security vulnerabilities, quality problems. Runs proactively.

drupal-frontend-dev implements

Twig templates, PostCSS/CSS, and JavaScript in the Drupal theme.

drupal-test-writer tests

ExistingSite tests that reproduce bugs and verify fixes. Runs PHPUnit regression suites.

quality-gate validates

Static code review — security, performance, quality. Read-only. Runs before done-gate.

done-gate validates

Runtime validator — builds, tests, drush cr. Checks deliverable completeness.

researcher explores

Deep codebase researcher — architecture, execution paths, patterns. Use before making changes.

drupal-contributor contributes

Write patches, create issues, contribute code upstream to drupal.org.

8 enforcement files

Rules are always-on constraints. Not suggestions. They apply to every agent, every task, every output — automatically.

drupal.mdPrefer DI. Follow namespace conventions. No unnecessary new modules.
phpcs.mdphpcs.xml is source of truth. Drupal + DrupalPractice standards enforced.
php.mdPHP conventions, typing, error handling, and modern PHP patterns.
testing.mdTest requirements, coverage expectations, and PHPUnit conventions.
workflow.mdPR conventions, commit standards, Drush usage over manual cache clearing.
tooling.mdDDEV-first. Composer for dependencies. Drush for Drupal operations.
frontend.mdTwig auto-escaping, library attachment, BEM naming, no inline styles.
docblocks.mdPHPDoc on all public methods. @see references on hook implementations.
View all rules on GitHub →

Automated workflow triggers

Hooks run shell scripts automatically on Claude Code events — session start, session resume. No manual setup required per-session.

on session start
session-start.sh

Initializes the environment — loads project context, validates DDEV state, sets up references for the session.

on session resume
session-resume.sh

Restores session context — picks up where the last session ended, reloads relevant state.

Hooks are configured in .claude/settings.json and execute outside the AI context — deterministic, not probabilistic.

System design principles

01 Knowledge as Code

Skills are modular and versionable. References externalized for scalability. No dependency on long prompts.

modular versionable portable

02 Deterministic Workflows

Agents execute predictable steps. Reduced randomness in AI outputs. Reproducible results across teams.

predictable reproducible

03 Separation of Concerns

Skills → knowledge. Agents → execution. Rules → constraints. Hooks → automation.

skills agents rules hooks

04 Tool-Integrated Execution

Native integration with the tools Drupal teams already use.

GitHub CLI DDEV Drush PHPCS PHPUnit

This is where it stops being theory.

🔍

PR Review Automation

  • Detect coding standard violations
  • Suggest architectural improvements
  • Enforce Drupal best practices
🧩

Debugging Workflows

  • Structured debugging — not guesswork
  • Reference-first analysis
  • Faster issue isolation
📦

Drupal Development Acceleration

  • Generate modules, services, plugins
  • Follow strict DI + architecture patterns
  • Avoid anti-patterns by default
🔄

Migration & Legacy Refactoring

  • Systematic transformation of old code
  • Pattern-based improvements
  • Reduced regression risk

Real files. Real patterns. No abstractions.

These are actual files from the repository — not pseudocode. Drop them into your project and they work.

.claude/skills/drupal-services/SKILL.md
---
name: drupal-services
description: Drupal services and dependency injection for controllers,
  forms, and plugins. Inject services via ContainerFactoryPluginInterface
  and services.yml.
---

# Drupal Services & Dependency Injection

## Core Principle

**Never use `\Drupal::service()` in classes — inject via constructor.**

## Dependency Injection Patterns

### Controllers & Forms (ContainerInjectionInterface)

use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

final class MyController implements ContainerInjectionInterface {
  public function __construct(
    private readonly AccountProxyInterface $currentUser,
    private readonly EntityTypeManagerInterface $entityTypeManager,
  ) {}

  public static function create(ContainerInterface $container): static {
    return new static(
      $container->get('current_user'),
      $container->get('entity_type.manager'),
    );
  }
}
.claude/agents/drupal-backend-dev.md
---
name: drupal-backend-dev
description: Drupal backend developer for implementing modules, hooks,
  services, routing, and Drush commands. Use for Drupal-specific
  backend implementation tasks.
tools: Read, Write, Edit, Glob, Grep, Bash
model: inherit
skills:
  - drupal-hooks
  - drupal-services
  - drupal-entity-api
  - drupal-caching
  - drupal-security
  - drupal-render
  - drupal-routes
  - drupal-queries
  - drupal-plugins
  - drupal-events
  - drupal-form-api
  - drupal-form-alter
  - drupal-access
  - drupal-fields
---

You are a Drupal 11 specialist working on a Drupal site.

Key conventions for this project:
- Custom modules live in `docroot/modules/custom/`
- Use DDEV for local development (`ddev drush`, `ddev composer`)
- Follow Drupal coding standards
- Services are defined in `*.services.yml` files

When implementing Drupal features:
1. Check existing patterns in the codebase first
2. Use the preloaded skills for patterns
3. Invoke additional skills on demand for specialized tasks

## Before Reporting Done

1. Run `ddev drush cr` — does the site rebuild without fatal errors?
2. No SQL injection (always use placeholders)
3. Output is escaped (`t()`, `Xss::filter()`, `#markup` with caution)
4. No N+1 queries (no DB calls inside loops)
5. Caching: render arrays cacheable? Cache tags/contexts set?
.claude/rules/drupal.md + rules/phpcs.md
# .claude/rules/drupal.md

- Prefer DI; avoid `\Drupal::service()` in classes.
- Follow existing module/namespace conventions.
- Prefer placing code in an existing relevant module
  over creating a new one.
- Use appropriate Drupal patterns and reference material.


# .claude/rules/phpcs.md

- `phpcs.xml` is the source of truth
  (Drupal + DrupalPractice standards).
- Don't enforce rules excluded in `phpcs.xml`.
- Prefer patterns already in the codebase over new conventions.
- Flag potential PHPCS violations during code review.


# .claude/rules/workflow.md

- Always run PHPCS before submitting a PR.
- Use Drush for cache clearing, not manual file deletion.
- Document hook implementations with @see references.
- Prefer config over hardcoded values.
edutrul/drupal-ai View on GitHub →
.claude/
skills/ 30+ domain skills
agents/ 8 specialized agents
rules/ 7 enforcement rules
hooks/ automated workflows
.codex/ Codex-compatible mirror
CLAUDE.example.md
AGENTS.example.md
SKILL.md

This is not about saving minutes.
It's about engineering consistency across teams.

In enterprise environments — 10+ developers, 100+ features, multiple environments:

Without structure

  • AI introduces chaos
  • Inconsistent delivery
  • Hidden technical debt

With Drupal AI

  • Consistent patterns
  • Faster onboarding
  • Reduced cognitive load
  • Scalable knowledge transfer

This project reflects how I approach systems.

01 / PATTERNSThink in patterns, not scripts
02 / SCALEDesign for teams, not individuals
03 / LONGEVITYOptimize for long-term maintainability
04 / AITreat AI as infrastructure, not a shortcut

Eduardo Telaya

Senior Drupal Backend Specialist and international speaker focused on architecture, performance, and scalable systems.

15+ years building Drupal platforms
Fortune 500 environment experience
#1 Book Curso Relámpago Drupal 10 — launched EN/ES
Speaker International conferences

If you're building Drupal platforms at scale
and want AI to actually improve engineering outcomes —

This is the direction. Use it. Fork it. Adapt it. Or use it as a reference to design your own system.