michtio/craftcms-claude-skills/skills/ddev/SKILL.md
ddev
DDEV local development environment for Craft CMS projects. ALWAYS load this skill when running any ddev command, configuring .ddev/config.yaml, or troubleshooting local container issues. Covers config.yaml (project type, PHP/Node versions, database, docroot), shorthand commands, add-ons and built-in Mailpit, custom commands, Vite dev server exposure, database import/export, Xdebug toggling, sharing local sites, and troubleshooting (port conflicts, container restarts, ddev-injected env vars silen
- Source repository stars
- 66
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-08-04
- Source checked
- 2026-08-04
Decision brief
What it does—and where it fits
DDEV local development environment for Craft CMS projects. ALWAYS load this skill when running any ddev command, configuring .
Not for
- Using ddev exec composer install instead of ddev composer install — DDEV shorthand commands handle path resolution and environment setup. Always use the shorthand.
- Forgetting ddev craft up does both migrate/all and project-config/apply — no need to run them separately after pulls or deploys.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/michtio/craftcms-claude-skills --skill "skills/ddev"Inspect the Agent Skill "ddev" from https://github.com/michtio/craftcms-claude-skills/blob/da3434f5d8cc6bc6a3f90a9343639f66f13239a3/skills/ddev/SKILL.md at commit da3434f5d8cc6bc6a3f90a9343639f66f13239a3. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Usage: check-cs
Review the “Usage: check-cs” section in the pinned source before continuing.
Review and apply the “Usage: check-cs” source section. - 02
Setup
1. composer.json — use the local host path:
composer.json — use the local host path:docker-compose override — mount the same path into the container. Create .ddev/docker-compose.mounts.yaml:Require the plugin: ddev composer require vendor/plugin-handle:@dev - 03
Project setup
The craft-project-setup skill offers to install Chrome DevTools MCP during scaffolding. If installed later, run claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest from the project root — this writes to the project's .claude.json, keeping it project-level.
The craft-project-setup skill offers to install Chrome DevTools MCP during scaffolding. If installed later, run claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest from the project root — this writes to the… - 04
Companion Skills — Always Load Together
When this skill triggers, also load:
craftcms — Plugin/module development. Required when DDEV commands involve Craft CLI (ddev craft make, ddev craft migrate, ddev craft project-config).craft-php-guidelines — PHP coding standards. Required when DDEV commands involve code quality tooling (ddev composer check-cs, ddev composer phpstan, ddev craft pest/test).When this skill triggers, also load: - 05
Documentation
When unsure about a DDEV feature, WebFetch the relevant docs page.
DDEV docs: https://docs.ddev.com/en/stable/Craft CMS quickstart: https://docs.ddev.com/en/stable/users/quickstart/craft-cmsConfiguration reference: https://docs.ddev.com/en/stable/users/configuration/config/
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 84/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 66 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- michtio/craftcms-claude-skills
- Skill path
- skills/ddev/SKILL.md
- Commit
- da3434f5d8cc6bc6a3f90a9343639f66f13239a3
- License
- MIT
- Collected
- 2026-08-04
- Default branch
- main
View the original SKILL.md
DDEV for Craft CMS Development
Companion Skills — Always Load Together
When this skill triggers, also load:
craftcms— Plugin/module development. Required when DDEV commands involve Craft CLI (ddev craft make,ddev craft migrate,ddev craft project-config).craft-php-guidelines— PHP coding standards. Required when DDEV commands involve code quality tooling (ddev composer check-cs,ddev composer phpstan,ddev craft pest/test).
Documentation
- DDEV docs: https://docs.ddev.com/en/stable/
- Craft CMS quickstart: https://docs.ddev.com/en/stable/users/quickstart/#craft-cms
- Configuration reference: https://docs.ddev.com/en/stable/users/configuration/config/
- Custom commands: https://docs.ddev.com/en/stable/users/extend/custom-commands/
- Additional services: https://docs.ddev.com/en/stable/users/extend/additional-services/
- Vite integration: https://docs.ddev.com/en/stable/users/usage/developer-tools/#nodejs
When unsure about a DDEV feature, WebFetch the relevant docs page.
Common Pitfalls
- Using
ddev exec composer installinstead ofddev composer install— DDEV shorthand commands handle path resolution and environment setup. Always use the shorthand. - Forgetting
ddev craft updoes bothmigrate/allandproject-config/apply— no need to run them separately after pulls or deploys. - Exposing the Vite dev server with
portsinstead ofweb_extra_exposed_ports—portscauses conflicts when running multiple DDEV projects.web_extra_exposed_portsroutes through Traefik and works with HTTPS. - Running
ddev composer global require— global packages install inside the container and vanish on restart. Install project-level dependencies only. - Setting
nodejs_versionbut runningnpm installon the host — Node must run inside the container viaddev npmto match the configured version. - Editing
.ddev/config.yamlwhile containers are running without restarting — changes to config requireddev restartto take effect. - Using
ddev import-dbwithout--target-db=dbon multi-database setups — the default target isdb, but if you've configured additional databases, be explicit. - Adding
#ddev-generatedto custom commands you've customized — DDEV overwrites files with this comment during updates. Only use it for add-on-managed commands. Custom commands you maintain should omit it. - Running
composer installon the host thenddev composer check-cs/ddev composer phpstan— if the host PHP version differs from DDEV's (e.g., host PHP 8.4, DDEV PHP 8.3),vendor/composer/platform_check.phpfails. Always runddev composer installsovendor/matches the container's PHP version.
Craft CLI First, Raw SQL Last
Always prefer Craft CLI commands over raw database queries:
ddev craft users/list-admins # not: ddev mysql -e "SELECT * FROM users WHERE admin=1"
ddev craft project-config/get system # not: reading project.yaml manually
ddev craft resave/entries # not: UPDATE queries on content tables
ddev craft elements/delete # not: DELETE FROM elements
Only fall back to ddev mysql when no CLI equivalent exists (e.g., checking table schemas, debugging specific rows, TRUNCATE cache for stuck mutex locks). Craft CLI commands handle project config, search index updates, and event firing that raw SQL skips.
Shorthand Commands
Always use DDEV shorthand over ddev exec:
ddev composer install # not ddev exec composer install
ddev craft up # not ddev exec php craft up
ddev npm install # not ddev exec npm install
ddev craft make service # scaffolding
Craft CMS Project Type
# .ddev/config.yaml
name: my-craft-site
type: craftcms
docroot: web
php_version: "8.3"
database:
type: mysql
version: "8.0"
nodejs_version: "20"
DDEV auto-injects: CRAFT_DB_SERVER, CRAFT_DB_USER, CRAFT_DB_PASSWORD, CRAFT_DB_DATABASE, PRIMARY_SITE_URL. These are injected into the container via .ddev/.env.web and can be opted out of with disable_settings_management: true in .ddev/config.yaml.
New Project Bootstrap
The canonical flow for a fresh DDEV + Craft project:
mkdir my-craft-site && cd my-craft-site
ddev config --project-type=craftcms --docroot=web # writes .ddev/config.yaml
ddev start
ddev composer create-project craftcms/craft # Craft's setup wizard runs automatically
ddev composer create-project launches Craft's interactive install wizard on completion. If it doesn't run (or you need to re-run it), use ddev craft install. Swap craftcms/craft for a community starter project to bootstrap from one instead.
Common Commands
ddev start # Start the project
ddev stop # Stop the project
ddev restart # Restart containers
ddev ssh # SSH into web container
ddev describe # Show project info and URLs
ddev launch # Open the project in a browser
ddev launch -m # Open Mailpit (also --mailpit)
ddev logs # View container logs
ddev import-db --file=dump.sql # Import database
ddev export-db --file=dump.sql # Export database
ddev xdebug on # Enable Xdebug
ddev craft db/backup # Craft database backup
Post-Install Auto-Run
Composer scripts auto-run craft up after install/update:
{
"scripts": {
"post-craft-update": [
"@php craft install/check && php craft up --interactive=0 || exit 0"
],
"post-update-cmd": "@post-craft-update",
"post-install-cmd": "@post-craft-update"
}
}
No need to manually run ddev craft migrate/all or ddev craft project-config/apply — ddev craft up does both, and it auto-runs after ddev composer install/update.
Add-ons
ddev add-on get ddev/ddev-redis # Install Redis
ddev add-on list # List installed add-ons
ddev add-on remove ddev/ddev-redis # Remove add-on
Mailpit is built into DDEV core — no add-on installation needed. Outgoing mail is captured automatically. Access the web UI with ddev mailpit, or ddev describe shows its URL (e.g. https://{project}.ddev.site:8026).
Sharing a Local Site
ddev share # Expose the project on a temporary public URL
ddev share defaults to the ngrok provider, which requires a free ngrok.com account and a configured ngrok auth token. (cloudflared is an alternative provider via --provider=cloudflared, no account required, but ngrok is the default.)
Custom Commands
Place scripts in .ddev/commands/web/ (container) or .ddev/commands/host/ (host):
#!/usr/bin/env bash
## Description: Run ECS code style check
## Usage: check-cs
## Example: ddev check-cs
cd /var/www/html && composer check-cs
Note: omit #ddev-generated on custom commands you maintain — DDEV overwrites files with that comment during updates. Only add-on-managed commands should include it.
Composer Path Repos and Volume Mounts
When developing plugins locally, Composer path repos symlink the plugin into vendor/. For this to work inside DDEV's Docker container, the host path must be volume-mounted so the symlink resolves.
Setup
- composer.json — use the local host path:
{
"repositories": [
{
"type": "path",
"url": "/Users/Shared/dev/craft-plugins/v5/*"
}
]
}
- docker-compose override — mount the same path into the container. Create
.ddev/docker-compose.mounts.yaml:
services:
web:
volumes:
- /Users/Shared/dev/craft-plugins:/Users/Shared/dev/craft-plugins
The mount path inside the container must match the host path exactly — Composer creates absolute symlinks that must resolve in both contexts. Replace /Users/Shared/dev/craft-plugins with your actual plugin directory path.
- Require the plugin:
ddev composer require vendor/plugin-handle:@dev
Common mistakes
- Using a Docker-internal path in
composer.jsonurl— the path must be the host filesystem path, not/var/www/... - Forgetting the volume mount —
ddev composer installsucceeds but the symlink points nowhere inside the container - Setting
"platform": {"php": "8.3"}incomposer.jsonconfig— don't. DDEV handles the PHP version via.ddev/config.yaml. Platform overrides cause dependency resolution mismatches between host and container, and prevent DDEV from managing version upgrades cleanly.
Browser Debugging with Chrome DevTools MCP
The Chrome DevTools MCP server gives Claude Code direct browser access — inspect pages, read console logs, check network requests, capture screenshots, and interact with the DOM.
Installation
claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
Quit and reopen Claude Code to load the new MCP server. Requires Chrome or Chromium running — the MCP server handles the DevTools Protocol connection automatically.
What it enables
| Capability | Use Case |
|---|---|
| Page inspection | Check rendered HTML, verify template output, inspect meta tags |
| Console logs | Catch Twig errors, JS exceptions, Garnish initialization failures |
| Network requests | Debug 404 assets, failed AJAX calls, Sprig/htmx swaps |
| DOM queries | Verify form markup, check field rendering, validate ARIA attributes |
| Screenshots | Visual verification of CP templates, responsive testing |
| Navigation & login | Authenticate into the CP, navigate to plugin settings/edit pages |
When to use
- Front-end template debugging — 404s, missing assets, broken layouts, SEOmatic meta tag verification
- CP template verification — plugin settings pages render correctly, editable tables work, slideout editors load
- Garnish/JS debugging — modals, drag-sort, disclosure menus initialize without console errors
- Sprig/htmx debugging — watch network requests for htmx swaps, verify response HTML fragments
- Auth flow testing — walk through login, registration, password reset end-to-end
- Read-only mode verification — confirm settings pages display correctly with
allowAdminChangesoff - Visual regression — screenshot before/after template changes
CP authentication pattern
DDEV sites are accessible at https://{project}.ddev.site. To inspect CP pages:
- Navigate to
https://{project}.ddev.site/{cpTrigger} - Log in with admin credentials
- Navigate to the plugin/settings page to inspect
- Check console for JS errors, inspect DOM for correct markup
Project setup
The craft-project-setup skill offers to install Chrome DevTools MCP during scaffolding. If installed later, run claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest from the project root — this writes to the project's .claude.json, keeping it project-level.
Running a Plugin's Own Test Suite
When a plugin is symlinked into a host project, run its suite from the plugin's own directory inside the container:
ddev exec --dir /var/www/html/vendor/acme/my-plugin vendor/bin/pest
ddev exec --dir /var/www/html/vendor/acme/my-plugin composer test
--dir sets the working directory, and that is the load-bearing part. markhuot/craft-pest-core reads its environment overrides from getcwd().'/phpunit.xml(.dist)' only — it does not parse a --configuration= flag. So the shared-root form:
# UNSAFE — runs the tests, but against the project's live database
ddev craft pest -- --configuration=vendor/acme/my-plugin/phpunit.xml.dist
…discovers and executes the plugin's tests while silently ignoring the plugin's own CRAFT_DB_DATABASE pin. Combined with a suite that hasn't bound the RefreshesDatabase trait (rollback is opt-in), that writes test data permanently into your development database. Treat the shared-root invocation as unsafe for any craft-pest-core suite.
The full mechanism, the isolation checklist, and the CI equivalent are in the craft-pest skill (references/isolation.md).
For plugins mounted via a Composer path repo, the --dir path is the symlink target inside the container — see Composer Path Repos and Volume Mounts for making that path resolve.
Troubleshooting
ddev poweroff # Stop all DDEV projects
ddev debug router # Debug router configuration
ddev debug capabilities # Check Docker capabilities
ddev delete --omit-snapshot # Remove project without snapshot
A general-config edit isn't taking effect (ddev-injected env var wins)
DDEV auto-injects Craft env vars (including PRIMARY_SITE_URL, and CRAFT_DB_*) into the container via .ddev/.env.web, and regenerates that file on every ddev start/restart unless disable_settings_management: true is set in .ddev/config.yaml. Because a real container environment variable beats a cms/.env dotenv value, and CRAFT_* env vars beat config/general.php (see the craftcms skill's config-bootstrap.md), a value you edit in .env or general.php can be silently overridden by what ddev injected.
Two symptoms and fixes:
- Wrong site URL / scheme.
PRIMARY_SITE_URLfollows ddev's primary URL, whose scheme is oftenhttp; if Craft resolves an unexpected base URL, that injected var is the likely source. Point Craft's site URL at a differently-named env var (e.g.SITE_URL) in your site config so ddev'sPRIMARY_SITE_URLdoesn't shadow it, or overridePRIMARY_SITE_URLdeliberately. - A
.envchange reverts after restart. If you edited.ddev/.env.webby hand, it's regenerated on restart — put durable overrides in.ddev/config.yaml(web_environment) or setdisable_settings_management: trueto own the file yourself.
When a config value "won't change," check the resolved environment (ddev exec printenv | grep CRAFT_, and .ddev/.env.web) before editing PHP again.
Alternatives
Compare before choosing
ruvnet/ruflo
github-release-management
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
ruvnet/RuView
github-release-management
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
alirezarezvani/claude-skills
pr-review-expert
Use when the user asks to review pull requests, analyze code changes, check for security issues in PRs, or assess code quality of diffs.
PramodDutta/qaskills
Gauge Testing
Test automation with Gauge framework using Markdown specifications, step implementations in Java/Python/JavaScript/Ruby/C#, concepts, data-driven testing, and living documentation.