framework:make:entity
Génère une entité Doctrine avec repository selon principes Elegant Objects
What this skill does
# Framework Make Entity Skill
Génère une entité Doctrine complète avec son repository selon les principes Elegant Objects.
## Variables
- **{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)
## Outputs
- `src/Entity/{EntityName}.php`
- `src/Repository/{EntityName}Repository.php`
- `src/Repository/{EntityName}RepositoryInterface.php`
## Instructions à Exécuter
**IMPORTANT : Exécute ce workflow étape par étape :**
### 1. Demander le nom de l'entité
- Utilise AskUserQuestion pour demander :
```
Question: "Quel est le nom de l'entité à créer ?"
Header: "Entité"
```
- Valide que le nom est en PascalCase (première lettre majuscule)
- Stocke dans EntityName
- Génère entityName = EntityName en camelCase (première lettre minuscule)
### 2. Demander les propriétés de l'entité
- Utilise AskUserQuestion pour demander :
```
Question: "Quelles sont les propriétés de l'entité ? Format: name:type,email:string,age:int"
Header: "Propriétés"
```
- Parse la liste des propriétés
- Pour chaque propriété, extrais le nom et le type
### 3. Vérifier les contracts
- Exécute `ls src/Contracts/` avec Bash
- Si le répertoire n'existe pas :
- Affiche : `⚠️ Contracts manquants - Génération automatique`
- Utilise Skill pour appeler `framework:make:contracts`
### 4. Détecter le namespace du projet
- Lis `composer.json` avec Read
- Extrais le namespace depuis `autoload.psr-4`
- Si non trouvé, utilise `App` par défaut
### 5. Générer l'entité
- Créé le fichier `src/Entity/{EntityName}.php` avec Write
- Structure de classe :
```php
namespace {namespace}\Entity;
use Doctrine\ORM\Mapping as ORM;
use {namespace}\Repository\{EntityName}Repository;
#[ORM\Entity(repositoryClass: {EntityName}Repository::class)]
final class {EntityName}
{
#[ORM\Id]
#[ORM\Column(type: 'uuid', unique: true)]
private string $id;
// Propriétés générées depuis la liste
private function __construct() {}
public static function create({params}): self
{
$self = new self();
$self->id = Uuid::v7();
// Affectations des propriétés
return $self;
}
// Getters pour chaque propriété
}
```
### 6. Générer l'interface du repository
- Créé le fichier `src/Repository/{EntityName}RepositoryInterface.php` avec Write
- Contenu :
```php
namespace {namespace}\Repository;
interface {EntityName}RepositoryInterface
{
public function find(string $id): ?{EntityName};
public function findAll(): array;
}
```
### 7. Générer le repository
- Créé le fichier `src/Repository/{EntityName}Repository.php` avec Write
- Contenu :
```php
namespace {namespace}\Repository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use {namespace}\Entity\{EntityName};
final class {EntityName}Repository extends ServiceEntityRepository implements {EntityName}RepositoryInterface
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, {EntityName}::class);
}
}
```
### 8. Afficher le résumé
Affiche :
```
✅ Entité {EntityName} générée avec succès
Fichiers créés :
- src/Entity/{EntityName}.php
- src/Repository/{EntityName}Repository.php
- src/Repository/{EntityName}RepositoryInterface.php
Propriétés :
{liste des propriétés}
Prochaines étapes :
- Créer la migration : php bin/console make:migration
- Générer la factory : /framework:make:factory {EntityName}
- Générer la collection : /framework:make:collection {EntityName}
```
## 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](references/usage.md) - 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
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.