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

/drupal-config-mgmt

@19514f4
Run it yourself

Guides Drupal configuration management safely - single-config export/set/delete, config:import and config:export (cim/cex) with preview-first --no --diff, config:status checks, Config Split (complete vs partial splits, csex/csim, activation), and syncing config from remote environments through Terminus, acli, platform/upsun, lagoon or drush aliases. Use when exporting or importing Drupal config, inspecting or changing a single config object, merging production config into a feature branch, working with config_split, or diagnosing config that will not import or vanishes from config/default on export.

Use this Skill: https://skilld.dev/gh/grasmash/drupal-claude-skills/drupal-config-mgmt

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesprod-config-merge.md

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

Preferred Prod Config Merge Workflow

Merging production config into a branch that carries local feature config, moved from SKILL.md.

Preferred Prod Config Merge Workflow

Purpose: Safely merge production config changes while preserving local feature work.

The Process

Step 1: Commit local changes first

git add config/default/your-new-field.yml docroot/modules/custom/your_module/your_module.module
git commit -m "feat: add new feature"

docroot/ here is the web root; yours may be web/ instead.

Step 2: Pull production database

ddev pull pantheon --environment=live
# Or your preferred method

Step 3: Export config from prod DB

This is one of the few places a full export is the point. It is safe only because Step 1 left the tree clean and Steps 4 to 6 review every file; never run it over uncommitted work. See surgical-config.md.

ddev drush config:export -y

Step 4: Review git diff on config directory

git diff --stat config/           # Summary of changes
git status --short config/        # See added/modified/deleted

Step 5: Identify files to revert vs keep

Look for these patterns:

  • D (Deleted) - Your new feature files deleted by prod export → REVERT
  • M (Modified) - UUID changes from prod → KEEP (a UUID mismatch makes the next import delete and recreate the config entity, so prod's UUID must win)
  • M (Modified) - Actual prod config changes → KEEP
  • M (Modified) - Local changes overwritten → REVERT (case by case)

Step 6: Restore your local feature files

# Restore deleted files (your new feature config)
git checkout HEAD -- config/default/field.storage.node.your_new_field.yml
git checkout HEAD -- config/default/field.field.node.bundle.your_new_field.yml

# Or restore specific modified files
git checkout HEAD -- config/default/some.config.yml

Step 7: Verify and commit prod config

git status --short config/        # Verify your files are restored
git diff config/                  # Review remaining prod changes
git add config/
git commit -m "chore: sync config from production"

Quick Reference Table

git status Meaning Action
D config/default/field.*.your_feature.yml Your new feature deleted git checkout HEAD -- <file>
M config/default/*.yml (UUID only) Prod UUID sync Keep (stage for commit)
M config/default/views.view.*.yml View changed in prod Keep (review first)
M config/default/system.*.yml System config from prod Keep (review first)

Example Session

# After pulling prod DB and exporting config
$ git status --short config/
 M config/default/core.entity_view_display.node.article.teaser.yml
 M config/default/field.storage.group.field_member_count.yml
 D config/default/field.field.node.article.field_related_count.yml
 D config/default/field.storage.node.field_related_count.yml
 M config/default/views.view.articles.yml

# The D files are our new feature - restore them
$ git checkout HEAD -- config/default/field.field.node.article.field_related_count.yml \
                       config/default/field.storage.node.field_related_count.yml

# Verify
$ git status --short config/
 M config/default/core.entity_view_display.node.article.teaser.yml
 M config/default/field.storage.group.field_member_count.yml
 M config/default/views.view.articles.yml

# Our feature files are no longer in the diff - commit prod changes
$ git add config/ && git commit -m "chore: sync config from production"

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.

1 warning1mo5 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides comprehensive instructions for Drupal configuration management using industry-standard tools like Drush, Git, and various hosting CLIs. While it executes shell commands and uses dynamic PHP evaluation to update configuration, these actions are essential for its purpose and are implemented using established developer workflows.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer8mo

    2/2 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

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-config-mgmt