Back to list
Swoking

symfony-skapi-dto

by Swoking

Claude Code plugin pour projets Symfony StarterKit

0🍴 0📅 Jan 19, 2026

SKILL.md


name: symfony-sk:api-dto description: Create DTOs with validation attributes for form data. Use when receiving structured input. allowed-tools: Read, Write, Edit, Glob, Grep

API DTO Skill

Mission

Create Data Transfer Objects with validation attributes for API input.


Location

api/src/Dto/<Feature>/<Name>Dto.php


Template

<?php

namespace App\Dto\<Feature>;

use StarterKit\Attribute\Dto;
use StarterKit\Attribute\StringProperty;
use StarterKit\Attribute\IntegerProperty;
use App\Attribute\DateProperty;
use App\Attribute\TimeProperty;

#[Dto(emptyError: -XXXXX)]
final class <Name>Dto
{
    #[StringProperty(emptyError: -XXXXY, invalidError: -XXXXY, mandatory: true)]
    public ?string $title = null;

    #[DateProperty(emptyError: -XXXXZ, invalidError: -XXXXZ, mandatory: true)]
    public ?\DateTime $date = null;

    #[StringProperty(emptyError: -XXXXW, invalidError: -XXXXW, mandatory: false)]
    public ?string $description = null;
}

Property Attributes

From StarterKit (StarterKit\Attribute\)

AttributePHP TypeUsage
StringProperty?stringText, lists
TextareaProperty?stringLong text
IntegerProperty?intNumbers
BooleanProperty?boolYes/No
EmailProperty?stringEmail validation
SettingProperty?stringDropdown from settings

From App (App\Attribute\)

AttributePHP TypeUsage
DateProperty?\DateTimeDate (Y-m-d)
TimeProperty?\DateTimeTime (H:i)

Common Parameters

ParameterDescription
emptyErrorError code when empty but mandatory
invalidErrorError code when format invalid
mandatoryRequired field (true/false)
hiddenHide in form
onChangeJS callback function name

Error Code Allocation

Use /error-code skill to allocate codes. Query existing codes first via vm-executor agent.

Convention -XXYZZ:

  • XX = Feature code
  • Y = Action index
  • ZZ = Unique error number (not necessarily sequential, just unique in the range)

Note: Each DTO/form needs unique codes. If a feature already has codes -28100 to -28105, the next ones could be -28106, -28107, etc.


Checklist

  • #[Dto(emptyError: -XXXXX)] on class
  • Each property has attribute with error codes
  • Error codes allocated via /error-code skill (query existing first)
  • Register form via /autoform skill

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon