Terminal-First Drupal: Engineering Architecture with Claude Code Agents

Learn how to turn terminal-native AI agents into productive Drupal pair programmers — not just for ambitious builds, but for the everyday work of code review, refactoring, and testing.

When an AI agent writes production Drupal code, your architecture must answer questions it never had to before: 

  1. What is the canonical source of truth for entity relationships? 
  2. Where does business logic live if an agent can't infer it from file proximity? 
  3. Which contracts are stable enough to be AI-navigable?

Modern AI tools often fail on complex Drupal architectures due to context loss and copy-paste friction. This live demonstration showcases how terminal-native AI agents operate directly inside local development containers to plan, build, test, and refactor Drupal 11 features seamlessly.

Drupal has always been the CMS of choice for complex, community-driven websites. But can Drupal serve the developers themselves — as a platform built by developers, for developers?

Attendees will witness real-time agentic execution using ddev-claude-code inside a live DDEV environment. The session covers setting up governance files (CLAUDE.md), delegating Drush commands to agents, leveraging Model Context Protocol (MCP) servers, and enforcing security and PSR-4 coding standards automatically in agent loops.

This session walks through building the Daily Developer Toolkit, a real open-source site that catalogs tools, tutorials, code snippets, and events for the global developer community. Every piece of this stack is open source.

Run-of-Show (45 Minutes):

00:00–00:10 | Governance & Setup
Boot Claude Code and walk through an enterprise CLAUDE.md: scope boundaries, forbidden paths, DI enforcement, coding standards, and why governance must precede every agent invocation.

00:10–00:25 | Agentic Module Construction
Use claude -p to scaffold a custom Drupal 11 module with PSR-4, a Plugin Manager, and wired DI — live, inside DDEV. Watch the agent run ddev drush commands and export configuration without leaving the terminal.

00:25–00:35 | TDD and Self-Correction Loops
Direct Claude Code to write PHPUnit tests, execute them via ddev exec phpunit, and observe the self-healing loop: agent parses failures, refactors the implementation, and re-runs the suite until green.

00:35–00:45 | Daily Developer Toolkit and Q&A
Walk through the three slash commands every Drupal developer should run before pushing code — /code-review for anti-pattern detection, /security-review for Drupal-specific attack surfaces, and /simplify for quality refactoring. Includes reusable prompt templates for scaffolding, service wiring, and debugging, plus claude -p in non-interactive mode for CI pipelines.

Architectural patterns:

  1. Spec-first contracts — CLAUDE.md as architectural documentation, not just tooling config
  2. Service boundary discipline — why DI-only code survives agentic rewrites; \Drupal::* statics don't
  3. Test-as-specification — PHPUnit tests as the architectural handshake between human intent and agent execution
  4. Config-as-truth — why config/sync/ must be complete before an agent can safely scaffold

 

Key Takeaways:

  1. How to write a CLAUDE.md that keeps agents safe, scoped, and standards-compliant in a Drupal 11 project.
  2. A repeatable daily workflow: Start → Develop → Review (three passes) → Ship — with the commands at each stage.
  3. Six prompt templates developers can copy and adapt for modules, services, tests, debug traces, and migrations.
  4. How to run Claude Code non-interactively (claude -p) in CI for automated DI and security checks on every commit.

Attendees will leave with a framework for auditing their own module architecture for AI-navigability — and a clear set of patterns that survive the agent loop. A live build-out is used not to showcase the tool, but to stress-test three architectural assumptions in real time — and to show where they break.

Claude Code is the pressure test that reveals whether your Drupal architecture is actually well-structured — and this session teaches you to build for that standard.