$npx -y skills add michtio/craftcms-claude-skills --skill ddevDDEV 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 settings (project type, PHP/Node versions, database, docroot), shorthand
| 1 | # DDEV for Craft CMS Development |
| 2 | |
| 3 | ## Companion Skills — Always Load Together |
| 4 | |
| 5 | When this skill triggers, also load: |
| 6 | |
| 7 | - **`craftcms`** — Plugin/module development. Required when DDEV commands involve Craft CLI (`ddev craft make`, `ddev craft migrate`, `ddev craft project-config`). |
| 8 | - **`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`). |
| 9 | |
| 10 | ## Documentation |
| 11 | |
| 12 | - DDEV docs: https://docs.ddev.com/en/stable/ |
| 13 | - Craft CMS quickstart: https://docs.ddev.com/en/stable/users/quickstart/#craft-cms |
| 14 | - Configuration reference: https://docs.ddev.com/en/stable/users/configuration/config/ |
| 15 | - Custom commands: https://docs.ddev.com/en/stable/users/extend/custom-commands/ |
| 16 | - Additional services: https://docs.ddev.com/en/stable/users/extend/additional-services/ |
| 17 | - Vite integration: https://docs.ddev.com/en/stable/users/usage/developer-tools/#nodejs |
| 18 | |
| 19 | When unsure about a DDEV feature, `WebFetch` the relevant docs page. |
| 20 | |
| 21 | ## Common Pitfalls |
| 22 | |
| 23 | - Using `ddev exec composer install` instead of `ddev composer install` — DDEV shorthand commands handle path resolution and environment setup. Always use the shorthand. |
| 24 | - Forgetting `ddev craft up` does both `migrate/all` and `project-config/apply` — no need to run them separately after pulls or deploys. |
| 25 | - Exposing the Vite dev server with `ports` instead of `web_extra_exposed_ports` — `ports` causes conflicts when running multiple DDEV projects. `web_extra_exposed_ports` routes through Traefik and works with HTTPS. |
| 26 | - Running `ddev composer global require` — global packages install inside the container and vanish on restart. Install project-level dependencies only. |
| 27 | - Setting `nodejs_version` but running `npm install` on the host — Node must run inside the container via `ddev npm` to match the configured version. |
| 28 | - Editing `.ddev/config.yaml` while containers are running without restarting — changes to config require `ddev restart` to take effect. |
| 29 | - Using `ddev import-db` without `--target-db=db` on multi-database setups — the default target is `db`, but if you've configured additional databases, be explicit. |
| 30 | - Adding `#ddev-generated` to 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. |
| 31 | - Running `composer install` on the host then `ddev 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.php` fails. Always run `ddev composer install` so `vendor/` matches the container's PHP version. |
| 32 | |
| 33 | ## Craft CLI First, Raw SQL Last |
| 34 | |
| 35 | Always prefer Craft CLI commands over raw database queries: |
| 36 | |
| 37 | ```bash |
| 38 | ddev craft users/list-admins # not: ddev mysql -e "SELECT * FROM users WHERE admin=1" |
| 39 | ddev craft project-config/get system # not: reading project.yaml manually |
| 40 | ddev craft resave/entries # not: UPDATE queries on content tables |
| 41 | ddev craft elements/delete # not: DELETE FROM elements |
| 42 | ``` |
| 43 | |
| 44 | 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. |
| 45 | |
| 46 | ## Shorthand Commands |
| 47 | |
| 48 | Always use DDEV shorthand over `ddev exec`: |
| 49 | |
| 50 | ```bash |
| 51 | d |