L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Développement · SKILL.md

craftcms-ops

craftcms-ops

Craft CMS 3/4/5 agency site builds: Matrix-as-entries content modeling, Twig and element queries, eager loading, output escaping and CSRF, and the usual plugin stack - SEOmatic, Blitz, Formie, CKEditor, craft-vite - plus DDEV, Codeception, image transforms, the queue, and 3-to-4-to-5 upgrades. Use when building, debugging, securing, speeding up, or upgradin…

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: craftcms-ops description: "Craft CMS 3/4/5 agency site builds: Matrix-as-entries content modeling, Twig and element queries, eager loading, output escaping and CSRF, and the usual plugin stack - SEOmatic, Blitz, Formie, CKEditor, craft-vite - plus DDEV, Codeception, image transforms, the queue, and 3-to-4-to-5 upgrades. Use when building, debugging, securing, speeding up, or upgrading a Craft site, or editing its Twig templates, config/project, or any of those plugins." license: MIT allowed-tools: "Read Write Bash" metadata: author: claude-mods related-skills: "ddev-ops, laravel-ops, sql-ops, nginx-ops, perf-ops, web-perf-ops, frontend-upgrade-ops, tailwind-ops, playwright-ops, a11y-ops, security-ops"

Craft CMS Operations

Versions verified 2026-10-05 against Packagist and the official docs. Craft 5.x is current (5.11); Craft 4 and 3 are past security support; Craft 6 is in alpha. scripts/check-craft-facts.py --live re-checks the plugin majors on a schedule.

The recurring agency shape: Craft 5 (or a 4/3 site awaiting upgrade) on DDEV, with SEOmatic, Blitz, Formie, and CKEditor, a Vite (or legacy Laravel Mix) front end, and modules tested with Codeception and ECS. This file is the procedure and the router; each topic lives in one reference.

Step 1 - Orient before touching anything

CheckWhereTells you
Craft + plugin versionscomposer.json, ddev composer show craftcms/cmsWhich line of the version matrix applies - Craft 4 and 5 APIs differ
Local environment.ddev/config.yamlPHP/DB versions; run everything as ddev craft, ddev composer, ddev npm
Schemaconfig/project/*.yamlSource of truth for sections, fields, entry types, plugin settings
Configconfig/general.php, config/<plugin>.php, .envEnvironment-specific behaviour (devMode, allowAdminChanges, caching)
Front-end buildpackage.json + config/vite.php, or webpack.mix.jscraft-vite or Laravel Mix
Templatestemplates/_layouts, _partials, _partials/entry/<type>.twigLayout inheritance and element partials
PHPmodules/, tests/, codeception.yml, ecs.phpWhere logic and tests live
Page cacheconfig/blitz.php, Blitz utilityWhether what you see is cached HTML - check before debugging "my change isn't showing"

Step 2 - Route the task

TaskRead
Listing pages, relations, Matrix/nested entries, pagination, multi-siteelement-queries.md
Printing anything user-influenced, forms that POST, JS data, rich text outputtwig-security.md
Meta tags, JSON-LD, sitemaps, robots.txt, hreflangseomatic.md
Static caching, "changes don't show", cache warming, dynamic bits on cached pagesblitz.md
Building, theming, or debugging forms; spam; form emails not sendingformie.md
Rich-text fields, nested entries inside rich text, Redactor conversionckeditor.md
Craft on DDEV: the craftcms type, ddev craft, Craft's upload_dirs (generic DDEV: ddev-ops)ddev.md
Tests for modules/plugins, fixtures, ECS/PHPStancodeception.md
Front-end assets, Vite dev server, critical CSScraft-vite.md
Moving off Laravel Mix/Webpack, or Vue 2 to Vue 3frontend-upgrade-ops (the full migration playbook)
Upgrading Craft 3 → 4 → 5, plugin version lines, Craft 6 statusupgrades.md
Slow pages, images, queue setup, production configperformance.md
Core Web Vitals failing (LCP, INP, CLS), PageSpeed or Search Console flagsweb-perf-ops (field data first; its references/craft.md maps the Craft levers)
Headless front ends, GraphQL schemas and tokensgraphql.md
Modules, plugins, events, migrations, queue jobsplugin-development.md
Modeling a new flexible page typeassets/entry-type-field-layout.md

Step 3 - Hold the non-negotiables

  1. Eager-load before you loop. .with([...]) up front; .eagerly() inside shared partials (Craft 5 only). One query per card is the most common Craft perf bug.
  2. Escape by context. Never |raw user-influenced values; |e('js') inside JS strings; {{ csrfInput() }} in every POST form - csrfInput({ async: true }) on cached pages.
  3. Schema only through Project Config. Change it in the CP locally, commit config/project/, run php craft up on deploy. Production runs allowAdminChanges => false; never hand-edit the YAML.
  4. Data changes are content migrations (php craft migrate/create), tested on a copy of production - not CP clicking on live.
  5. Production runs a queue worker. Blitz regeneration, Formie emails and integrations, transform pre-generation, and resaves are all queue jobs.
  6. Fix queries, then cache. Blitz for public pages; on Blitz-cached pages drop {% cache %} (or set enableTemplateCaching false).
  7. Logic lives in module services, not Twig - services are testable.
  8. Stay on the latest Craft 5 patch. Craft ships regular Twig/RCE security fixes.

Version matrix

PackageCraft 3Craft 4Craft 5 (current)
craftcms/cms3.9 (EOL)4.18 (EOL Apr 2026)Craft 5.x (5.11); Craft 6 in alpha
nystudio107/craft-seomatic3.x4.xSEOmatic 5
putyourlightson/craft-blitz3.x4.xBlitz 5 (5.13 needs Craft 5.6+)
verbb/formie1.x2.xFormie 3 (Formie 4 in beta)
Rich textRedactorRedactor or craftcms/ckeditor 3.xCKEditor plugin 5.x (needs Craft 5.10+; 4.x below that)
nystudio107/craft-vite1.x4.xcraft-vite 5
nystudio107/craft-imageoptimize1.x4.xImageOptimize 5
spacecatninja/imager-x3.x4.xImager-X 6 (5.x still maintained)
codeception/codeceptionmatch core's require-devmatch core's require-devCodeception 5

Requirements for Craft 5: PHP 8.2+, MySQL 8.0.17+ / MariaDB 10.4.6+ / PostgreSQL 13+. Details and plugin upgrade notes: upgrades.md.

Everyday commands

Command (prefix ddev locally)Does
craft upPending migrations + Project Config - run on every deploy
craft project-config/apply / project-config/rebuildApply YAML to the DB / rebuild YAML from the DB
craft clear-caches/allData, template, and asset caches
craft queue/run / queue/info / queue/retry allWork and inspect the queue
craft blitz/cache/refreshRefresh Blitz after template deploys (Blitz tracks content, not templates)
craft migrate/create <name>New content migration
craft make <type>Scaffold modules/plugins/components (craftcms/generator)
craft entrify/categories <group>Convert categories (or tags, global-set) to entries

Craft 5 content model

ConceptWhat it isCraft 5 change
SectionSingle, Channel, or Structure; holds entry types + URI formats-
Entry typeThe unit of content shapeGlobal and reusable across sections and Matrix fields
FieldReusable inputGlobal, with multi-instance use in one layout
Matrix fieldRepeatable nested contentStores nested entries, not blocks
CKEditor fieldRich textCan hold nested entries inline
Element partials_partials/entry/<typeHandle>.twig.render() renders nested entries through them
Project Configconfig/project/ YAMLSource of truth - commit it

Pick the section type by shape: Single for one-off pages (home, contact), Channel for streams (news, events), Structure for hierarchies (pages, docs). Prefer flat entry types plus a Matrix "page builder" field over many near-identical sections. Starter shape: entry-type-field-layout.md.

Gotchas

SymptomCauseFix
Listing page runs hundreds of queriesRelation fetched per item.with() / .eagerly()
Change visible in CP, not on siteBlitz/CDN serving cached HTMLblitz.md
Form submissions save, emails never sendQueue not running in productionQueue daemon (performance.md)
Assets unstyled in production onlyVite 5+ manifest is in dist/.vite/Set manifestPath (craft-vite.md)
{% set seomatic.meta.seoTitle = ... %} does nothingset only reads{% do seomatic.meta.seoTitle('...') %}
Staging copy of the site got indexed / prod de-indexedSEOmatic environment wrongCheck robots in view-source (seomatic.md)
Project Config conflicts between developersCP edits on shared/prod environmentsallowAdminChanges false outside local; one schema change per PR
Event handler fires several times per saveDrafts, revisions, propagationGuard with ElementHelper::isDraftOrRevision() + propagating
craft.matrixBlocks() errors after upgradeRemoved in Craft 5craft.entries().field(...).owner(...)

Bundled resources

FileUse
assets/entry-type-field-layout.mdContent-modeling starter: section + entry type + Matrix-as-entries, mapped to Project Config
assets/craft-facts.jsonThe version facts this skill documents (package, major, prose token)
scripts/check-craft-facts.pyStaleness verifier: --offline (prose still states the facts) / --live (Packagist majors)

See also

  • ddev-ops (generic DDEV: version pinning, env files, snapshots and sanitised pulls, Mutagen, add-ons, Xdebug, and an auditor for .ddev/ mistakes)
  • laravel-ops (Composer/PHP tooling; Craft 6 is Laravel-based) · sql-ops (indexes behind slow orderBy) · nginx-ops (serving Craft, Blitz rewrites) · perf-ops (profiling) · tailwind-ops · playwright-ops (browser tests against the DDEV URL)
  • web-perf-ops (Core Web Vitals: CrUX/RUM first, then the failing subpart; Blitz, transforms, craft-vite critical CSS and SEOmatic/Formie script placement as INP/LCP levers)
  • frontend-upgrade-ops (Laravel Mix or Webpack to Vite via craft-vite, Vue 2 to Vue 3, Vue islands in Twig, and when a widget should become Alpine instead)
  • a11y-ops (WCAG 2.2 for Twig sites: heading levels across partials, asset alt text, Formie and CKEditor markup, multi-site lang; see its references/server-rendered-templates.md)
  • security-ops (Craft/Twig/PHP security: CSRF and Formie, allowAnonymous, devMode and the security key, GraphQL scoping, uploads, advisories and Craft 3/4 end of life; its references/craft-*.md, twig-*.md, php-*.md)
  • Craft 5 docs · Plugin Store · Craft security advisories

Why this shape: a 2026 survey of 57 Craft-agency repositories found Craft in 36 (Craft 5 ×17, 4 ×13, 3 ×6), DDEV in 36, SEOmatic in 33, Blitz 21, Formie 18, CKEditor 18, Laravel Mix 18 versus craft-vite 12, Tailwind 12, ECS 11, and Codeception 10. The references follow that frequency; upgrades matter because half the Craft sites were on an EOL major.

Skills enregistrées