スキル一覧に戻る
Swoking

symfony-skapi-entity

by Swoking

Claude Code plugin pour projets Symfony StarterKit

0🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: symfony-sk:api-entity description: Create or modify Doctrine entities. Use for database models. allowed-tools: Read, Write, Edit, Glob, Grep

API Entity Skill

Mission

Create or modify Doctrine ORM entities.


Location

api/src/Entity/<Name>.php


Template

<?php

namespace App\Entity;

use App\Repository\<Name>Repository;
use Doctrine\ORM\Mapping as ORM;
use StarterKit\Entity\BaseEntity;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: <Name>Repository::class)]
#[ORM\Table(name: '<table_name>')]
class <Name> extends BaseEntity
{
    #[ORM\Column(type: 'string', length: 255)]
    #[Groups(['<feature>'])]
    private ?string $title = null;

    #[ORM\Column(type: 'datetime', nullable: true)]
    #[Groups(['<feature>'])]
    private ?\DateTime $date = null;

    #[ORM\ManyToOne(targetEntity: User::class)]
    #[ORM\JoinColumn(nullable: false)]
    private ?User $owner = null;

    // Getters and setters...

    public function getTitle(): ?string
    {
        return $this->title;
    }

    public function setTitle(?string $title): self
    {
        $this->title = $title;
        return $this;
    }
}

Common Column Types

TypeUsage
stringText (specify length)
textLong text
integerNumbers
booleanTrue/false
datetimeDate and time
dateDate only
jsonJSON data

Relationships

// Many-to-One
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private ?User $owner = null;

// One-to-Many
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: Child::class)]
private Collection $children;

// Many-to-Many
#[ORM\ManyToMany(targetEntity: Tag::class)]
private Collection $tags;

Serialization Groups

Use #[Groups(['<feature>'])] for API output control.


After Modification

IMPORTANT: Run dsu (Doctrine Schema Update) on VM after entity changes.

Use vm-executor agent:

"Run: ./scripts/dsu"

Checklist

  • Extends BaseEntity
  • Has repository class
  • Groups defined for serialization
  • Getters/setters for all properties
  • Run dsu after changes

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です