drupal-entities-fields

Generate Drupal 10/11 content and configuration entity types with base fields and handlers.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/proofoftom/drupal-skills --skill drupal-entities-fields
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-entities-fields
Source: https://github.com/proofoftom/drupal-skills/tree/main/skills/drupal-entities-fields
Command: npx skills add https://github.com/proofoftom/drupal-skills --skill drupal-entities-fields

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill simplifies the creation of custom content and configuration entities in Drupal, along with their associated fields, streamlining data modeling and management within your Drupal site.

Core Features & Use Cases

  • Entity Type Creation: Define both content and configuration entity types using modern PHP attributes (D11+) or annotations (D10).
  • Field Definition: Create base fields for content entities and manage properties for config entities.
  • Handler Configuration: Set up essential handlers like form builders, list builders, and route providers for entity management.
  • Bundle Support: Implement subtype functionality for content entities, linking them to their corresponding bundle configuration entities.
  • Use Case: You need to create a new "Event" content entity type with fields for date, location, and a description, and also a "Event Type" configuration entity to manage different kinds of events (e.g., "Conference", "Workshop").

Quick Start

Create a Drupal content entity called 'product' with a string field for 'name' and a timestamp field for 'created'.

Frequently Asked Questions about drupal-entities-fields

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

FAQPage Schema
How do I create a custom content entity type in Drupal 10 with base fields?

To create a custom Drupal content entity, define base fields using baseFieldDefinitions and configure handlers for forms and route providers. This Skill generates the full content entity structure, including bundle support and access control.

What is the best way to migrate Drupal entity annotations to PHP attributes?

Migrating Drupal entity annotations to PHP attributes involves updating your entity definition patterns for Drupal 11 compatibility. This Skill handles the annotation-to-attribute migration while generating modern ConfigEntityBase and content entity structures.

How do I set up bundle support for a custom Drupal content entity?

Bundle support for a Drupal content entity requires linking it to a corresponding configuration entity. This Skill implements subtype functionality by generating the necessary configuration entity to manage distinct bundles.

Does this approach support generating configuration entity types in Drupal?

Yes, generating configuration entity types in Drupal is fully supported. The Skill creates ConfigEntityBase implementations with managed properties, alongside essential list builders and form handlers.

How do I handle image and file fields programmatically in a custom Drupal entity?

Programmatic file handling for image and file fields in custom Drupal entities is supported. The Skill addresses file field definitions and management within the baseFieldDefinitions structure.

Can I generate entity access control and route providers for custom Drupal entities?

Yes, you can generate entity access control and route providers. The Skill configures essential handlers, including route providers, form builders, and list builders, ensuring proper entity management permissions.