Help us improve
Share bugs, ideas, or general feedback.
From drupal-lab
Run Drupal development tools (phpcs, phpstan, phpunit, drush, composer) inside DDEV containers. Use when you need to run PHP commands, coding standards checks, static analysis, tests, or drush against a Drupal worktree. Host-side PHP commands will fail -- DDEV provides PHP 8.5, database, Chrome webdriver, and test env vars. Do NOT use for DDEV lifecycle management (start/stop/setup) -- use drupal-lab:process-lifecycle instead.
npx claudepluginhub cosmicdreams/claude-plugins --plugin drupal-labHow this skill is triggered — by the user, by Claude, or both
Slash command
/drupal-lab:ddevThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run all development tools inside DDEV containers where PHP 8.5, MariaDB, Chrome webdriver, and test environment variables are properly configured.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Share bugs, ideas, or general feedback.
Run all development tools inside DDEV containers where PHP 8.5, MariaDB, Chrome webdriver, and test environment variables are properly configured.
For general DDEV knowledge (lifecycle, database operations, troubleshooting, worktree isolation, providers), see lib:ddev. This skill covers Drupal-specific commands only.
Host-side commands (composer phpcs, ./vendor/bin/phpunit) will fail or produce wrong results because:
.ddev/core-dev/.env file configures SQLite test DB and Chrome webdriverDDEV must be started before running any commands. See lib:ddev for startup and lifecycle.
Important: Resolve the active project root from ~/.claude/drupal-lab.json before running any commands. See drupal-lab/references/project-context.md for the resolution steps. All relative paths (./worktrees/...) are relative to that root. If inside a worktree (..../worktrees/1234), cd ../.. to return to the project root.
Follow /process-lifecycle skill Phase 1 (INIT) for the full setup procedure. That skill is the single source of truth for:
.ddev/ configuration from mainconfig.local.yaml (prevents container conflicts)Each worktree runs as an independent DDEV project. Multiple worktrees can run simultaneously with different project names.
To run commands against a different worktree's code from an already-running DDEV (e.g., main):
cd ./worktrees/main
ddev exec composer phpcs -- --report-full /var/www/html/path/to/file.php
Note: this only works for files inside the running DDEV's mounted directory.
cd ./worktrees/{issue}
ddev start
Wait for all containers (web, db, chrome) to report healthy. This takes ~30 seconds.
ddev drupal lint:phpcs
ddev exec composer phpcs -- path/to/file.php path/to/other.php
ddev exec composer phpcbf -- path/to/file.php
ddev drupal lint
ddev drupal lint --stop-on-failure
PHPStan catches type errors, undefined methods, incorrect return types, and other issues that phpcs does not.
ddev drupal lint:phpstan
ddev exec vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist path/to/file.php
ddev exec vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist core/modules/settings_tray/src/
The custom ddev phpunit command sources env vars from core/.env and clears stale Chrome sessions automatically.
ddev phpunit core/modules/settings_tray/tests
ddev phpunit core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
ddev phpunit --group settings_tray
ddev phpunit --testsuite unit
ddev phpunit --filter testMethodName core/modules/settings_tray/tests
ddev drupal test:browser chrome
ddev drupal test:browser firefox
Watch tests live at:
ddev drupal test:extensions-enable
ddev drush status
ddev drush cache:rebuild
ddev drush sql:sanitize
ddev composer install
ddev composer update
ddev exec php -v
ddev exec php core/scripts/db-tools.php
ddev drupal install demo_umami
ddev drupal cache
ddev drupal admin-login
For general DDEV troubleshooting (container logs, Mutagen, port conflicts, error table), see lib:ddev. Below are Drupal-specific issues only.
Error: "phpunit is not in PATH"
ddev composer install
Stale Chrome sessions causing test failures
The ddev phpunit command auto-clears these, but manually:
ddev exec curl -f -s http://chrome:4444/status
Tests fail with "connection refused" Ensure Chrome container is running:
ddev describe --json-output 2>/dev/null | jq '.raw.status'
Cryptic test failure (blank output, segfault, timeout) Check container logs first — the root cause is usually visible there:
ddev logs | tail -50
| Component | Value |
|---|---|
| PHP | 8.5 |
| Database | MariaDB 10.11 |
| Test DB | SQLite (sites/default/files/db.sqlite) |
| Webdriver | Chrome at chrome:4444 |
| Base URL | http://web (internal) |
| Site URL | https://drupal-test.ddev.site |
| Perf mode | Mutagen |
| Node.js | 24 |
For PHP performance profiling (xhprof, slow query log), see drupal-lab:perf-measure.
For frontend performance (Lighthouse, Core Web Vitals), see improve:perf-measure.