symfony
БесплатноБез исполняемых скриптовНе проверенSymfony is a PHP framework for building web applications and APIs from reusable components: routing and controllers, dependency injection, Doctrine ORM…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Symfony — Enterprise PHP Framework
Overview
Symfony is a PHP framework built from decoupled components, wired together by a dependency-injection container and configured with PHP attributes. A new project starts as a minimal skeleton; features (Doctrine ORM, Serializer, Validator, Security, Messenger, API Platform) are added with composer require, and Symfony Flex recipes register and configure each one. Current stable is 8.1 (PHP 8.4+, maintained until January 2027); 7.4 is the long-term-support line (PHP 8.2+, security fixes until November 2029).
Instructions
Installation
composer create-project symfony/skeleton:"8.1.*" checkout-api # or "7.4.*" for the LTS
cd checkout-api
composer require orm serializer validator messenger mailer # API building blocks
composer require --dev maker
composer require webapp # OR the full server-rendered stack: Twig, forms, security, profiler
composer require api # OR API Platform for REST/GraphQL resources
# Optional Symfony CLI: local HTTPS server, `symfony new`, `symfony check:requirements`
brew install symfony-cli/tap/symfony-cli # macOS/Linux; Windows: scoop install symfony-cli
symfony serve -d # without the CLI: php -S 127.0.0.1:8000 -t public
Put machine-specific settings in .env.local (git-ignored), for example DATABASE_URL="postgresql://app:${DB_PASSWORD}@127.0.0.1:5432/checkout?serverVersion=16&charset=utf8". The skeleton also ships an AGENTS.md with the project's conventions for coding agents — read it.
Controllers and Routing
<?php
// src/Controller/UserController.php
namespace App\Controller;
use App\Dto\CreateUser;
use App\Entity\User;
use App\Message\SendWelcomeEmail;
use App\Repository\UserRepository;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Attribute\MapQueryParameter;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/api/users')]
final class UserController extends AbstractController
{
public function __construct(
private readonly UserRepository $users,
private readonly EntityManagerInterface $em,
private readonly MessageBusInterface $bus,
) {}
#[Route('', methods: ['GET'])]
public function list(#[MapQueryParameter] int $page = 1, #[MapQueryParameter] int $limit = 20): JsonResponse
{
return $this->json($this->users->findPaginated($page, $limit), context: ['groups' => ['user:list']]);
}
#[Route('', methods: ['POST'])]
public function create(#[MapRequestPayload] CreateUser $input): JsonResponse
{
$user = new User($input->name, $input->email);
$this->em->persist($user);
$this->em->flush();
$this->bus->dispatch(new SendWelcomeEmail($user->getId()));
return $this->json($user, 201, context: ['groups' => ['user:detail']]);
}
#[Route('/{id}', requirements: ['id' => '\d+'], methods: ['GET'])]
public function show(User $user): JsonResponse
{
return $this->json($user, context: ['groups' => ['user:detail']]);
}
}
// src/Dto/CreateUser.php
namespace App\Dto;
use App\Entity\User;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[UniqueEntity(fields: ['email'], entityClass: User::class)]
final readonly class CreateUser
{
public function __construct(
#[Assert\NotBlank, Assert\Length(min: 2, max: 100)]
public string $name,
#[Assert\NotBlank, Assert\Email]
public string $email,
) {}
}
#[MapRequestPayload] deserializes and validates the JSON body (malformed JSON → 400, violations → 422). A User argument is loaded from the {id} placeholder; an unknown id gives 404.
Doctrine Entity
<?php
// src/Entity/User.php
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: 'users')]
class User
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column]
#[Groups(['user:list', 'user:detail'])]
private ?int $id = null;
#[ORM\Column]
#[Groups(['user:detail'])]
private \DateTimeImmutable $createdAt;
public function __construct(
#[ORM\Column(length: 100)]
#[Groups(['user:list', 'user:detail'])]
private string $name,
#[ORM\Column(unique: true)]
#[Groups(['user:detail'])]
private string $email,
) {
$this->createdAt = new \DateTimeImmutable();
}
public function getId(): ?int { return $this->id; }
public function getName(): string { return $this->name; }
public function getEmail()
Установить symfony в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл symfony?
Symfony is a PHP framework for building web applications and APIs from reusable components: routing and controllers, dependency injection, Doctrine ORM, validation, security and the Messenger queue. Use when a user asks to create or upgrade a Symfony project, write controllers, entities or migrations, validate request payloads, run background jobs with Messenger, build a REST API with API Platform, or debug services and routes with bin/console.
Как установить скилл symfony?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл symfony запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic