Symfony framework mastery - Doctrine, DI container, Messenger, and enterprise architecture
Provides expert guidance for Symfony 6.4/7.x development. Triggers when building Doctrine entities, configuring DI services, or implementing Messenger async messaging with proper enterprise patterns.
/plugin marketplace add pluginagentmarketplace/custom-plugin-php/plugin install php-assistant@pluginagentmarketplace-phpThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyAtomic skill for mastering enterprise-grade Symfony applications
Comprehensive skill for building robust Symfony applications. Covers Symfony 6.4 LTS and 7.x with focus on Doctrine ORM, dependency injection, and API Platform.
interface SkillParams {
topic:
| "doctrine" // ORM, DBAL, migrations
| "di-container" // Services, autowiring, tags
| "routing" // Routes, controllers
| "security" // Voters, firewalls
| "messenger" // Async messaging
| "api-platform" // REST/GraphQL APIs
| "forms"; // Form types, validation
level: "beginner" | "intermediate" | "advanced";
symfony_version?: "6.4" | "7.0" | "7.1" | "7.2";
project_type?: "webapp" | "api" | "microservice";
}
validation:
topic:
required: true
allowed: [doctrine, di-container, routing, security, messenger, api-platform, forms]
level:
required: true
symfony_version:
default: "7.1"
beginner:
- Entity creation with attributes
- Basic relationships
- Repository basics
intermediate:
- DQL and QueryBuilder
- Lifecycle events
- Custom repository methods
advanced:
- Inheritance mapping
- Second-level cache
- Event subscribers
beginner:
- Service basics
- Autowiring
- Constructor injection
intermediate:
- Service tags
- Factory services
- Decorators
advanced:
- Compiler passes
- Service subscribers
- Lazy services
beginner:
- Messages and handlers
- Sync vs async transports
intermediate:
- Message middleware
- Retry strategies
- Multiple transports
advanced:
- Custom transports
- Saga patterns
graph TD
A[Skill Invoked] --> B{Validate}
B -->|Invalid| C[Return Error]
B -->|Valid| D[Load Content]
D --> E{Topic Router}
E --> F[Generate Examples]
F --> G[Add Console Commands]
errors:
CONTAINER_ERROR:
code: "SYMFONY_001"
recovery: "Run cache:clear, check services.yaml"
DOCTRINE_ERROR:
code: "SYMFONY_002"
recovery: "Run doctrine:schema:validate"
retry:
max_attempts: 3
backoff:
type: exponential
initial_delay_ms: 100
<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\ProductRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: ProductRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Product
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank]
private string $name;
#[ORM\ManyToOne(inversedBy: 'products')]
#[ORM\JoinColumn(nullable: false)]
private Category $category;
#[ORM\Column]
private \DateTimeImmutable $createdAt;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable();
}
}
<?php
declare(strict_types=1);
namespace App\Service;
use App\Repository\ProductRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
final readonly class ProductService
{
public function __construct(
private ProductRepository $repository,
private EntityManagerInterface $entityManager,
private LoggerInterface $logger,
#[Autowire('%app.tax_rate%')]
private float $taxRate,
) {}
public function createProduct(array $data): Product
{
$product = new Product();
$product->setName($data['name']);
$this->entityManager->persist($product);
$this->entityManager->flush();
$this->logger->info('Product created', ['id' => $product->getId()]);
return $product;
}
}
<?php
declare(strict_types=1);
namespace App\MessageHandler;
use App\Message\SendOrderConfirmation;
use App\Service\EmailService;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
#[AsMessageHandler]
final readonly class SendOrderConfirmationHandler
{
public function __construct(
private EmailService $emailService,
) {}
public function __invoke(SendOrderConfirmation $message): void
{
$this->emailService->sendOrderConfirmation($message->orderId);
}
}
<?php
declare(strict_types=1);
namespace App\Tests\Functional;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
final class ProductControllerTest extends WebTestCase
{
public function testListProducts(): void
{
$client = static::createClient();
$client->request('GET', '/api/products');
$this->assertResponseIsSuccessful();
}
}
| Problem | Solution |
|---|---|
| Service not found | Run debug:container, check autowiring |
| Doctrine mapping error | Run doctrine:schema:validate |
| Route not found | Run debug:router, check firewall |
| Metric | Target |
|---|---|
| Code accuracy | 100% |
| Symfony conventions | 100% |
| DI best practices | 100% |
Skill("php-symfony", {topic: "messenger", level: "advanced"})
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.