# drupal-expert

Guides coding agents through modern Drupal 10 and 11 development, enforcing contrib research, constructor dependency injection, and automated PHPUnit tests.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1100 installs · ★ 49
- Author: madsnorgaard
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/madsnorgaard/drupal-agent-resources/tree/HEAD/.claude/skills/drupal-expert/SKILL.md
- Updated: 2026-09-17
- HTML: https://affpapa.org/en/nevibecode/skills/drupal-expert

## What it does

This skill enforces modern Drupal 10 and 11 architecture. It adopts a research-first rule: before generating custom code, the agent inspects drupal.org to verify whether an existing contrib module, patch, or Drupal 10.3 recipe already covers the requirement.

In custom development, static service calls via `\Drupal::service()` are strictly banned. The agent injects dependencies through class constructors, using `ContainerInjectionInterface` for controllers and `ContainerFactoryPluginInterface` for plugins. It uses PHP 8 attributes like `#[Hook]` for Drupal 11 hooks and reserves event subscribers for third-party PSR-14 integration.

Automated testing is treated as mandatory. The skill organizes test suites across Unit, Kernel, Functional, and FunctionalJS classes depending on database or browser needs. Any custom module configuration will fail review without a matching `config/schema` definition.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-expert -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/drupal-expert/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/drupal-expert/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-expert -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/drupal-expert/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-expert -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/drupal-expert/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install madsnorgaard/drupal-agent-resources drupal-expert
```

2. **Manually: put the files in place**
- File: `.github/skills/drupal-expert/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-expert -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/madsnorgaard/drupal-agent-resources --path .claude/skills/drupal-expert
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/drupal-expert/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add madsnorgaard/drupal-agent-resources --skill drupal-expert -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/madsnorgaard/drupal-agent-resources/tree/HEAD/.claude/skills/drupal-expert/SKILL.md

## When to use it
- scaffold Drupal 10 or 11 modules following PSR-4 and PHPCS standards
- configure dependency injection in plugins without static service calls
- implement modern OOP hooks using PHP attributes in Drupal 11
- write unit and kernel test suites with PHPUnit base classes

## Example prompts
- Build a custom block plugin in Drupal 11 with constructor dependency injection
- Check drupal.org for an existing module before writing custom order export logic
- Write a KernelTestBase test for my custom entity processing service

## Similar
- [php-pro](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-php-pro.md) — skill · 15500 installs
- [php-mcp-server-generator](https://affpapa.org/en/nevibecode/skills/php-mcp-server-generator.md) — skill · 8900 installs
- [laravel-tdd](https://affpapa.org/en/nevibecode/skills/laravel-tdd.md) — skill · 4900 installs
- [wordpress-testing-qa](https://affpapa.org/en/nevibecode/skills/wordpress-testing-qa.md) — skill · 413 installs
- [Laravel Expert Agent](https://affpapa.org/en/nevibecode/agents/laravel-expert-agent.md) — subagent · ★ 40418
- [php-development](https://affpapa.org/en/nevibecode/skills/php-development.md) — skill · 1100 installs

From the same set: [madsnorgaard/drupal-agent-resources](https://affpapa.org/en/nevibecode/by/madsnorgaard/drupal-agent-resources.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
