Search by

drupal / droost_cms

Drupal-Infrastructure

Drupal CMS for sites an AI agent builds under droost: Droost Theme, UI Patterns 2, SDC-first display patterns, and droost's site tools with their Canvas half.

Package info

git.drupalcode.org/project/droost_cms.git

Type:drupal-recipe

pkg:composer/drupal/droost_cms

Statistics

Installs: 185

Dependents: 0

Suggesters: 0

1.1.1 2026-11-22 12:43 UTC

This package is auto-updated.

Last update: 2026-11-22 20:52:08 UTC


README

A Drupal recipe for Drupal CMS sites an AI agent builds under droost:

  • everything in drupal_cms_starter (Canvas page building, media, SEO, the admin UI, the Mercury theme…);
  • the Droost Theme as the site default: Tailwind v4 and daisyUI, served as the stylesheet the theme ships compiled (its browser JIT mode is a development setting, off as installed), design tokens in one css/tokens.css, and 21 Canvas-clean SDCs. Mercury stays installed and is no longer the default;
  • UI Patterns 2 (and its field formatters) as the SDC display layer for structured entities;
  • a worked design pattern: an event content type whose default display is composed entirely from SDCs;
  • droost's site tools: the droost module (2.x) and droost_canvas, through which an agent reads and writes content and Canvas pages (drush droost:tool), each call recorded for the run;
  • the agent layer (below): the component_lint gate and the paragraph droost carries into AGENTS.md.

The droost command is not a Drupal module: it is one command, droost, in the project's own tools/droost/. The recipe installs two of the module's parts, droost and droost_canvas, because a recipe runs in production too; turn on droost_build and droost_dev (configuration, fields, Views, the developer tools) in a development copy, never in production.

What droost_canvas brings to a production site

droost carries content tools only. droost_canvas carries four more content tools and three tools of the build group (use droost build tools):

ToolWhat it writes
droost_canvas_component_lintNothing: it reads SDCs against Canvas's requirements
droost_canvas_component_toggleConfiguration: it turns Canvas Component entities on or off
droost_canvas_variant_tree_setConfiguration: it replaces a page variant's component tree

All three run from the command line only (drush droost:tool): a build tool refuses a web request whatever is switched on. The two that write are held by the allow_config_write switch, and on the command line a switch nobody set is on (over the web a switch nobody set is off). On a production site, turn it off:

drush droost:gate allow_config_write off
drush droost:gate                        # every switch and its state

The switch is written to settings.droost.php beside settings.php, not to exported configuration, so it is set on each site and does not travel with a deployment of configuration. Turning a switch off needs no terminal; turning one on needs a person at one.

Requirements

Drupal CMS ships Canvas, and this recipe adds UI Patterns. The two fought over the SDC plugin manager (canvas#3561618) until UI Patterns 2.0.22, which stops decorating the manager once Canvas has replaced it. This recipe requires ^2.0.22, so no patch and no bridge module are needed. Measured 2026-11-22 on Canvas 1.13.0 and core 11.4.13: with UI Patterns 2.0.23 the recipe applies the first time and both names resolve to Canvas's manager. With 2.0.21 the recipe also applies and drush cr passes, but plugin.manager.sdc is then UI Patterns' class while Canvas keeps its own, and scripts/assert-recipe-applied.sh says the manager is split. (On Canvas 1.12.0, measured 2026-10-20, drush cr was fatal in Canvas's PropShape with 2.0.21.)

Install

On a fresh Drupal CMS project (composer create-project drupal/cms <dir>):

composer require -W 'drupal/tool:^1.0@beta' 'drupal/droost_cms:^1.0'
drush site:install minimal -y
drush recipe ../recipes/droost_cms
recipes/droost_cms/scripts/assert-recipe-applied.sh .

Measured 2026-11-22 on a project created that day, with this recipe and Droost Theme at their commits of that day: the four lines run as written and the last prints RECIPE APPLIED CLEAN. The project was Drupal CMS 2.2.10 (core 11.4.13, Canvas 1.13.0, Mercury 1.0.5), and the composer require brought the starter 2.2.10, UI Patterns 2.0.23, Tool API 1.0.0-beta12 and droost 2.1.0.

Or install in a browser: after the composer require, open the site and pick "Droost CMS" in the Drupal CMS installer, which applies the recipe itself. Then skip the two drush lines: running drush recipe on a site the installer built applies the recipe a second time, and that fails (see "Apply it once" below). Measured the same day on the same project: the installer lists "Droost CMS", builds the site, and the assert script passes on it.

The recipe brings droost 2.1 or later and droost_theme 1.1 or later with it. Tool API is still in beta, so it is root-required with that stability: Composer ignores stability flags in a package that is not the root, so the recipe cannot widen stability for you.

-W lets Composer move packages the project has already locked. droost conflicts with twig 3.30.0, which breaks Drupal's escape filter, and a fresh Drupal CMS project locks that version (2.2.10 did on 2026-11-22). Without -W the command stops at "Your requirements could not be resolved"; with it twig moves to 3.29.0.

Then droost itself, in its own vendor directory (as its README installs it), and the layer:

mkdir -p tools/droost
composer init -d tools/droost -n --name=local/droost-tools   # a Composer project of its own, for config to write to
composer config -d tools/droost platform.php 8.3.0   # resolve the tools for PHP 8.3, the lowest droost runs on, so they run on the site's PHP
composer require -d tools/droost 'droost/workflow:^1.0'
php tools/droost/vendor/bin/droost init
php tools/droost/vendor/bin/droost code:index
recipes/droost_cms/scripts/install-layer.sh .
# merge recipes/droost_cms/examples/droost.yml into droost/droost.yml
php tools/droost/vendor/bin/droost init     # again: carries droost/agents.md into AGENTS.md
drush en droost_build droost_dev -y         # a development copy only

scripts/assert-recipe-applied.sh <site-dir> checks a DDEV site for what this recipe installs and refuses to say OK otherwise: the modules (droost and droost_canvas among them; it notes droost_build or droost_dev when either is on, and the state of allow_config_write), the theme, that Canvas and UI Patterns share one SDC manager after a rebuild, that the front page serves through droost_theme with no Mercury chrome, the event type with its four fields and its composed display, the five block placements and their order in the content region, and that the site's configuration passes core's schema check for every config object.

Apply it once. Applying it a second time fails inside drupal_cms_starter: the starter creates canvas.content_template.node.page.full with create: rather than createIfNotExists:, so the second run stops at "Entity canvas.content_template.node.page.full exists". That is the starter's, and it holds for any site the starter already built, so this recipe cannot be applied on top of an installed Drupal CMS site either. Measured 2026-11-22 on the starter 2.2.10, both ways: drush recipe on a site the installer had built from "Droost CMS", and this recipe on a site built from the Starter recipe alone. Both stopped at that message.

The agent layer

The Canvas tools are the droost module's: droost_canvas lists pages and resolves aliases, reads, validates and writes a page's tree and a page variant's (the frame), hides components from the editor, and lints SDCs against Canvas's requirements. Its canvas-build skill, which says which of Canvas page, frame, composed display or View to build and how, is installed by droost init from the module. They lived here as a copied layer (droost/bin/canvas) until 2026-10-24.

What remains here is what a project needs beside the module, and scripts/install-layer.sh <project> copies it in. It is a script and not Composer's scaffold because Drupal CMS unpacks a recipe when it is required: the recipe leaves the lock, so a package file mapping would never run again. The script never overwrites a file you changed (it reports it and exits 1; --force replaces it).

FileWhat it is
droost/gates/component-lint.phpThe component_lint gate: every SDC in custom code meets Canvas's requirements, asked of the module (drush droost:component-lint --custom). Exit 4 when there is none, which droost records as a labelled pass (droost/workflow F-340); exit 3 when the module could not answer
droost/agents.mdA paragraph droost carries into AGENTS.md (appended, if another package's text is already there)

The gate file sits under droost/gates/, which droost freezes while a run is open, and droost's guard refuses writes into modules/contrib/droost (droost/workflow F-367), so a run cannot loosen the check its components pass.

examples/droost.yml is this recipe's part of droost/droost.yml: the component_lint gate and three house rules (new markup lives in an SDC; a landing page is a Canvas page written with droost_canvas_tree_set; site state changes through droost's tools, not raw drush php:eval). scripts/validate-layer.sh checks the layer before it ships.

Custom block (block_content) needs Canvas 1.13

On Canvas 1.12, drush en block_content on a site this recipe built stopped halfway with "Table 'db.block_content' doesn't exist", and left the module enabled with no table (measured 2026-10-20 on Canvas 1.12.0). Core clears the plugin caches before it creates a new module's tables; Canvas's block manager generated its components when they were cleared, and block_content's block deriver queried the table that was not there yet. It was Canvas's: #3582851.

It is corrected in Canvas 1.13.0. Measured 2026-11-22 on a site this recipe built with Canvas 1.13.0: drush en block_content turns the module on with its four tables, a block type and a block save, Canvas lists the block as a component, and drush cr passes. A project created that day gets 1.13.0. On a site still on Canvas 1.12, update Canvas before turning Custom block on.

Known nuance: theme blocks

Droost Theme ships its block placements (main menu in the header; messages, page title, local tasks and main content in the content region) as theme config/optional, and a recipe that installs the theme does not bring them in: measured 2026-11-22 on core 11.4.13, a recipe whose only theme was droost_theme left it with no block at all. This recipe therefore ships the same five block configs in its own config/, with the theme's weights, so a fresh site always gets the navbar and, above the main content, messages, then the page title, then the tabs (weights -30, -20, -10 and 0).

On a Drupal CMS site the tabs block is seldom seen. Drupal CMS gives every signed-in user the navigation sidebar, which shows a page's tabs in its top bar and empties the block, and the login pages are Gin's. The block prints its tabs for a signed-in user who does not have the sidebar (measured 2026-11-22 on Drupal CMS 2.2.10).

The page title block was left out until 2026-11-22, because Canvas pages and composed displays carry their own headings. The event display does not render the node's title, so an event page had no title at all. The block is now placed, and Droost Theme prints its heading on every page but a Canvas page: a Canvas page is built from components and its h1 is the one they give it, most often a hero's. A Canvas page with no heading component has no h1; give it a hero or a heading. Measured 2026-11-22 on a site built from this recipe: the Home page the starter creates, a Canvas page that opens with Droost Theme's hero, an event and the login page each have one h1. With the title printed on Canvas pages too, the first two had two.

The event machine name, and why it is a risk worth naming

This recipe's config/ ships node.type.event — an unprefixed machine name in the same namespace Drupal CMS uses for its own content types (page, blog). If Drupal CMS ever ships an event content type of its own, a site that applied both would end up with ONE type carrying a mixture of two designs, because this recipe sets config: strict: false and a non-strict recipe reconciles differing config rather than refusing.

Checked against Drupal CMS 2.2.10 (2026-11-22): no recipe of Drupal CMS defines event. A project created that day has two of its recipes on disk, drupal_cms_starter and drupal_cms_site_template_base, and Drupal CMS's repository at that tag holds seven more (drupal_cms_blank, drupal_cms_accessibility_tools, drupal_cms_ai, drupal_cms_forms, drupal_cms_google_analytics, drupal_cms_multilingual and drupal_cms_search). The only content type any of the nine defines is page. So this is a forward risk, not a present conflict, and renaming now would cost ten config files plus every demo node for a collision that may never arrive.

The installer of 2.2.10 also lists site templates from other projects, and some of them describe events (Summit, Convene). Those were not read. A site is built from one template, so they do not meet this recipe in the installer.

Before installing an events recipe alongside this one, check whether it defines node.type.event. If it does, install it on a site WITHOUT this recipe, or rename this pattern's type first — a merged content type is the kind of breakage that shows up as a display that mostly works.

What the design pattern demonstrates

config/core.entity_view_display.node.event.default.yml renders every event field through droost_theme:section with UI Patterns component formatters: the field label becomes the heading prop, and the field's value fills the content slot through the field's own core formatter. It is the template the canvas-build skill points an agent at for a composed display.