Drupal Fields

Design Drupal field plans with consistent machine names and reuse rules.

34|12|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-fields
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Drupal Fields
Source: https://github.com/theodorosploumis/drupal-best-practices/tree/main/ai/skills/fields
Command: npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-fields

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents the creation of poorly named or ambiguously reused fields that can lead to configuration sync issues, developer confusion, and difficult content management. It ensures your field architecture is clear, consistent, and maintainable.

Core Features & Use Cases

  • Consistent Machine Names: Generate machine names following patterns like field_[bundle]_[short] for specific fields and generic names for shared fields.
  • Mandatory Descriptions: Ensure every field has a clear description, aiding developers and content editors in understanding its purpose.
  • Safe Reuse Guidance: Get advice on when fields can be safely reused across different content entities without causing semantic or configuration conflicts.
  • Use Case: When adding an "Author" field to an Article content type, use this Skill to ensure its machine name is field_article_author, it has a clear description, and you understand if it's safe to reuse for other content types.

Quick Start

List fields for an event bundle with machine names, descriptions, directory guidance for uploads, and whether each field can be safely reused elsewhere.

Frequently Asked Questions about Drupal Fields

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I name Drupal fields consistently across my site?

Consistent field naming in Drupal follows patterns like `field_[bundle]_[short]` for bundle-specific fields and generic names for shared fields. This prevents configuration sync issues and reduces developer confusion by establishing clear ownership and reuse rules.

What's the best way to prevent field reuse conflicts in Drupal?

Safe field reuse requires validating that semantics align across content types. This Skill flags unsafe reuse when field meaning differs between bundles, ensuring your field architecture remains maintainable and avoiding sync conflicts during configuration deployment.

Why should every Drupal field have a description?

Field descriptions aid both developers and content editors in understanding purpose and usage. Mandatory descriptions enforce clarity, reduce ambiguity, and support long-term maintenance by documenting intent directly in your field configuration.

How do I organize file directories for Drupal field uploads?

Directory guidance structures upload storage by field and bundle, improving file management and preventing naming collisions. Clear directory hierarchies make field-level file organization predictable and maintainable across your Drupal project.

Can I apply the same field to multiple content types in Drupal?

Fields can be safely reused across content types only when their semantics remain consistent. This Skill provides guidance on safe reuse patterns and identifies cases where shared fields risk configuration or content management issues.