symfony:controller

Generate Symfony PHP controller files with routing attributes and Twig templates.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the creation of Symfony controllers, ensuring adherence to modern PHP 8 features, routing best practices, and common patterns like CRUD, API, and single-action controllers.

Core Features & Use Cases

  • Automated Controller Generation: Creates PHP controller files with appropriate routing attributes.
  • Multiple Controller Types: Supports CRUD, API, and Single Action controller generation.
  • Optional Features: Integrates Twig templates, FormType for new/edit actions, and security attributes (#[IsGranted]).
  • Use Case: Quickly scaffold a new ProductController for a Symfony application, including index, show, new, edit, and delete actions with associated Twig templates and form integration.

Quick Start

Use the symfony:controller skill to generate a new CRUD controller named 'OrderController' with Twig templates and form integration.

Frequently Asked Questions about symfony:controller

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

FAQPage Schema
How do I generate a Symfony controller with routing attributes and CRUD actions?

Yes, Symfony controller generation includes API controller types. It scaffolds PHP files with routing attributes designed for API endpoints, ensuring adherence to modern PHP 8 features and best practices.

Does the generated Symfony controller support Twig templates and form integration?

Yes, generated Symfony controllers support optional Twig templates and FormType integration for new and edit actions. It creates corresponding template files alongside the controller logic.

Can I add security attributes like IsGranted to a generated Symfony controller?

Yes, you can add security attributes to a generated Symfony controller. The generation process supports integrating `#[IsGranted]` attributes directly into the PHP controller files to enforce access control.

How does the Symfony controller generator detect my project namespace?

The Symfony controller generator detects your project namespace by reading the composer.json file. It uses this information to ensure the generated PHP controller files match your application's existing namespace structure.

What's the best way to create a single-action Symfony controller?

The best way to create a single-action Symfony controller is using the skill's single-action controller type. It generates a PHP file with routing attributes tailored for one specific endpoint, following modern best practices.