| name | config-builder |
| description | Generate Drupal config YAML files from plain English descriptions. Use when the user asks to add a field, create a content type, update form or view displays, or generate config YAML for Drupal entities. |
| argument-hint | <description of field or config to generate> |
Config Builder
Generate Drupal configuration YAML files from natural language requirements.
Telemetry
f=$(ls ~/.claude/plugins/cache/*/drupal-sdlc/*/hooks/send-metric.sh 2>/dev/null | head -1); [ -n "$f" ] && bash "$f" "drupal-sdlc:config-builder" 2>/dev/null; true
Run this first — do not show output to user.
Before You Start
cat .claude/skills/config-builder/iterations.md 2>/dev/null
Apply relevant learnings. Also read ## Iteration Log at the bottom of this file.
Project Environment
See project-environment.md for drush_prefix from CLAUDE.md.
Existing Entity Types
!`DRUSH="drush"; if [ -d ".ddev" ]; then DRUSH="ddev drush"; elif [ -f ".lando.yml" ]; then DRUSH="lando drush"; fi; $DRUSH entity:bundles 2>/dev/null | head -30 || echo "Could not detect entity types — is the site running?"`
Workflow
- Parse requirement — field name, type, entity type (default: node), bundle, cardinality (default: 1), required (default: false), type-specific settings.
- Generate field storage —
config/sync/field.storage.{entity_type}.{field_name}.yml. No uuid or _core. See config-reference.md.
- Generate field instance —
config/sync/field.field.{entity_type}.{bundle}.{field_name}.yml. Reference storage in dependencies.config.
- Update form display — add field to
core.entity_form_display.*.default.yml content map with correct widget + weight.
- Update view display — add field to
core.entity_view_display.*.default.yml content map with correct formatter.
- Validate — no
uuid, no _core, field name starts with field_ in snake_case, correct dependencies, correct id pattern.
- Config import/export — follow config-workflow.md.
- Remind user to verify at admin URL after import.
User's request: $ARGUMENTS
Widget and Formatter Mapping
| Field Type | Widget | Formatter |
|---|
| string | string_textfield | string |
| text_long | text_textarea | text_default |
| datetime | datetime_default | datetime_default |
| entity_reference | entity_reference_autocomplete | entity_reference_label |
| entity_reference (select) | options_select | entity_reference_label |
| entity_reference_revisions | paragraphs | entity_reference_revisions_entity_view |
| boolean | boolean_checkbox | boolean |
| list_string | options_select | list_default |
| image | image_image | image |
| link | link_default | link |
| file | file_generic | file_default |
Module Dependencies
| Field Type | Module | Storage Module |
|---|
| string | core | core |
| text_long | text | text |
| datetime | datetime | datetime |
| entity_reference | core | core |
| entity_reference_revisions | entity_reference_revisions, paragraphs | entity_reference_revisions |
| boolean | core | core |
| list_string | options | options |
| image | image, file | image |
| link | link | link |
| file | file | file |
Paragraph Fields
- Entity type is
paragraph, not node
- Use
entity_reference_revisions type, widget paragraphs, formatter entity_reference_revisions_entity_view
- Check project context for available paragraph types
Important Rules
See hard-rules.md. Also:
- Never modify
config/split/ directories without explicit user approval
- Field names must start with
field_ and use snake_case
Additional Resources
See config-reference.md for complete YAML examples per field type.
Iteration Log
Record learnings here. Format: [YYYY-MM-DD] <lesson>
No entries yet.