smithery/atournayre

framework:make:factory

Génère Factory Foundry pour tests

Installation

$ npx skills add smithery/atournayre --skill frameworkmakefactory

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/atournayre · top by installs.

npx skills add smithery/atournayre

Browse all from smithery/atournayre

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.0.0
LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,684 B
  • docs SUMMARY.md 63 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Framework Make Factory Skill

Instructions à Exécuter

IMPORTANT : Exécute ce workflow étape par étape :

Description

Génère une Factory Foundry pour créer des instances d'entités dans les tests.

Usage

Use skill framework:make:factory

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 pour defaults()

Dépendances

  • Entité dans src/Entity/{EntityName}.php
  • Zenstruck Foundry installé

Outputs

  • src/Factory/{EntityName}Factory.php

Workflow

  1. Demander le nom de l'entité (EntityName)
  2. Vérifier que l'entité existe
  3. Lire l'entité pour détecter les propriétés du constructeur create()
  4. Générer la factory depuis le template templates/Factory/
  5. Afficher le fichier créé

Patterns appliqués

  • Extends PersistentObjectFactory, classe final
  • Méthode class() retournant FQCN
  • Méthode defaults() avec valeurs Faker
  • Méthode initialize() avec instantiateWith() appelant Entity::create()
  • Méthodes custom (ex: withSpecificId(), inactive())

References

  • [Usage](references/usage.md) - Exemples de tests et valeurs Faker recommandées

Notes

  • Utilise instantiateWith() pour respecter Elegant Objects (pas de new Entity())
  • Faker via self::faker()
  • Méthodes custom uniquement si demandées (YAGNI)
  • Persiste par défaut, withoutPersisting() si besoin