twig:make-component

Generate Twig Component PHP classes and templates in Symfony applications.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/atournayre/claude-personas --skill twig-make-component
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: twig:make-component
Source: https://github.com/atournayre/claude-personas/tree/main/twig/skills/make-component
Command: npx skills add https://github.com/atournayre/claude-personas --skill twig-make-component

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of reusable Twig Components in Symfony applications, streamlining front-end development by generating both the PHP class and the Twig template.

Core Features & Use Cases

  • Full Component Generation: Creates a PHP class with #[AsTwigComponent] and a corresponding Twig template.
  • Customizable Props & Options: Supports defining component properties, mount methods, computed properties, and slots.
  • Anonymous Components: Can generate Twig templates only for purely visual components.
  • Use Case: Quickly scaffold a new UserProfileCard component, defining its props like user and avatarUrl, and generating the initial PHP and Twig files ready for customization.

Quick Start

Use the twig:make-component skill to generate a new Twig component named 'UserProfileCard' with 'user:App\Entity\User' and 'avatarUrl:?string' as props.

Frequently Asked Questions about twig:make-component

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

FAQPage Schema
How do I generate Twig components in Symfony automatically?

To generate Twig components in Symfony, you can use an automation Skill to scaffold PHP classes with #[AsTwigComponent] attributes and corresponding Twig templates, defining props, mount methods, and slots for reusable UI elements.

What are anonymous Twig components and when should I use them?

Anonymous Twig components are purely visual templates generated without a PHP class. You should use them when a component only requires static presentation markup and does not need dynamic props or mount methods.

Can I define custom props and mount methods for Symfony UX components?

Yes, you can define custom props and mount methods for Symfony UX components by generating a PHP class that accepts typed properties like user:App\Entity\User and includes mount methods for initialization logic.

What's the best way to scaffold a reusable UI element with Twig templates?

The best way to scaffold a reusable UI element is to generate a Twig component structure that creates both the PHP class and associated Twig template simultaneously, ensuring properties and namespaces align for rapid development.

Does Twig component generation support computed properties and slots?

Twig component generation supports computed properties and slots, allowing you to define derived data within the PHP class and pass dynamic template content into the component UI structure.