Index of every page on this site: llms.txt
All skills
grasmash avatar

/drupal-deploy-safety

@19514f4
Run it yourself

Things that pass locally and then break, or silently lose data, on a Drupal deploy. Use when planning or running a deploy, writing a hook_update_N / post-update / deploy hook, running drush updb / updatedb / config:import / drush deploy on a remote environment, a site is stuck in maintenance mode after a failed or killed update, adding a column to a custom_field field, an update hook talks to an external API (payment provider, cloud, SaaS), changing a service constructor or *.services.yml / drush.services.yml arguments, a Drush command is missing from drush list, or committing vendor/ for a host that deploys git state (ComposerAutoloaderInit not found). Covers deploy-path planning per change class, the updb → cr → cim → cr tail, maintenance-mode stranding, the custom_field addColumn() truncate trap, update hooks that re-fire on every environment, service arity, Drush command discovery, and committed-vendor autoloader skew.

Use this Skill: https://skilld.dev/gh/grasmash/drupal-claude-skills/drupal-deploy-safety

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesvendor-autoloader-skew.md

≈703 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Committed-vendor deploys: autoloader skew

Moved verbatim from the drupal-deploy-safety SKILL.md (§8).

Applies to hosts that deploy committed git state and run no composer install on the server.

What happens. The Composer autoloader class name carries a suffix (ComposerAutoloaderInit<suffix>, ComposerStaticInit<suffix>) that appears in three files:

  • vendor/autoload.php, at the vendor root (it's not inside vendor/composer/)
  • vendor/composer/autoload_real.php
  • vendor/composer/autoload_static.php

Composer picks the suffix from the config.autoloader-suffix setting if one is set. Otherwise it reuses the suffix it finds in the existing vendor/autoload.php. Failing that, it generates one (recent Composer 2.x uses the lock file's content-hash, else random bytes). If the suffix rotates and you stage only vendor/composer/, the entry point and the class it loads disagree. Drupal's autoload.php requires vendor/autoload.php on every request, so the result is a site-wide fatal: Class "ComposerAutoloaderInit<old>" not found.

Guards.

  • Pin the suffix so it never rotates:

    "config": { "autoloader-suffix": "my_project" }
  • When you actually add or remove a package, stage vendor/autoload.php, vendor/composer/, any added or removed package directories, and vendor/drupal/DrupalInstalled.php (generated by drupal/core-composer-scaffold), all together.

  • Add a pre-commit or pre-push check: extract the suffix from all three files in the staged/committed tree (git show :vendor/autoload.php, or HEAD: for a push) and fail if they differ.

  • Never commit a dev-dependency autoloader. Build the committed vendor with composer install --no-dev --optimize-autoloader. You can check it: vendor/composer/installed.php has 'dev' => false under root for a --no-dev build. Fail the check if it's true, or if dev-only packages (phpunit, etc.) show up in the committed classmap.

  • Running composer install --no-dev -o before committing vendor is correct. The hazards are committing what comes after it and committing only part of it. If you run composer install again to get your dev tools back, don't commit that result: it's a dev autoloader. And always commit all three suffix files together. A push that doesn't touch packages doesn't need a vendor rebuild at all, because git push ships commits, not the working tree.

  • Don't fix a skew by regenerating in a throwaway checkout and copying files back. The optimized classmap comes from scanning files on disk, so a checkout that lacks untracked package files produces a smaller classmap. Reconcile forward: commit the entry point to match the already-committed pair, then diff against a clean --no-dev build.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides instructional content and best practices for safe Drupal deployments. It covers common pitfalls like database update failures, configuration management, and service instantiation errors. No security risks or malicious patterns were detected.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 19514f4. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago

README badge

README badge for grasmash/drupal-claude-skills/drupal-deploy-safety