frameworkmakeentity

Génère une entité Doctrine avec repository selon principes Elegant Objects

⭐6stars🔀0forks📁View on GitHub🕐Updated Jan 2, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill automates the generation of Doctrine entities and repositories based on 'Elegant Objects' principles. It helps developers maintain a clean, object-oriented architecture by producing final classes, static factories, and repository interfaces, significantly reducing manual boilerplate and ensuring architectural consistency in PHP projects.

Use Cases

  • Rapidly bootstrapping new database entities in Symfony or PHP projects while adhering to strict OOP standards.
  • Enforcing architectural consistency across a team by automating the creation of standardized repository patterns and interfaces.
  • Reducing development time and manual errors when implementing complex entity traits such as logging, dependency injection, and UUID identification.
  • Modernizing legacy codebases by generating clean, immutable entity structures that follow best practices like private constructors and static factories.
nameframework:make:entity
descriptionGénère une entité Doctrine avec repository selon principes Elegant Objects
licenseMIT
version1.0.0

Framework Make Entity Skill

Description

Génère une entité Doctrine complète avec son repository selon les principes Elegant Objects.

Usage

Use skill framework:make:entity

Variables requises

  • {EntityName} - Nom de l'entité en PascalCase (ex: Product)
  • {entityName} - Nom de l'entité en camelCase (ex: product)
  • {namespace} - Namespace du projet (défaut: App)
  • {properties} - Liste des propriétés avec types (name:string, price:float)

Dépendances

  • Contracts présents (appelle framework:make:contracts si absent)

Outputs

  • src/Entity/{EntityName}.php
  • src/Repository/{EntityName}Repository.php
  • src/Repository/{EntityName}RepositoryInterface.php

Workflow

  1. Demander le nom de l'entité (EntityName)
  2. Demander les propriétés (nom, type, nullable)
  3. Vérifier si src/Contracts/ existe, sinon appeler framework:make:contracts
  4. Générer l'entité depuis le template templates/Entity/
  5. Générer le repository et son interface
  6. Afficher le résumé des fichiers créés

Patterns appliqués

Entité

  • Classe final, constructeur privé, factory statique create()
  • Traits : DatabaseTrait, NullTrait, DependencyInjectionTrait
  • Interfaces : LoggableInterface, DatabaseEntityInterface, NullableInterface, DependencyInjectionAwareInterface, OutInterface, HasUrlsInterface, InvalideInterface

Repository

  • Classe final, extends ServiceEntityRepository
  • Implémente interface du repository

References

  • Usage - Exemples et détails de génération

Notes

  • ID Uuid ajouté automatiquement
  • Propriétés privées avec getters (pas de setters)
  • Méthode toLog() inclut toutes les propriétés