スキル一覧に戻る
Swoking

symfony-skfront-route

by Swoking

Claude Code plugin pour projets Symfony StarterKit

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

SKILL.md


name: symfony-sk:front-route description: Create front/back Route controllers extending BaseRoute. Use for pages and form endpoints. allowed-tools: Read, Write, Edit, Glob, Grep

Front Route Skill

Mission

Create Route controllers for front or back office.


Location

  • Front: front/src/Controller/<Feature>/<Name>Route.php
  • Back: back/src/Controller/<Feature>/<Name>Route.php

HTTP Methods

CRITICAL: Only GET or POST - Never PUT, DELETE, PATCH in front/back.


Template

<?php

namespace App\Controller\<Feature>;

use App\Service\Bll\<Feature>Service;
use StarterKit\Controller\BaseRoute;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;

class <Feature><Action>Route extends BaseRoute
{
    #[Route("/<feature>/{key}/<action>", name: "<feature>_<action>", methods: ["POST"])]
    public function <action>(string $key, <Feature>Service $service): Response
    {
        $result = $service-><method>($key);

        return $this->checkAuthorization($result, new JsonResponse([
            'code' => $result->getCode(),
            'message' => $result->getMessage(),
            'data' => $result->getData(),
        ]));
    }
}

Key Rules

  1. Extends BaseRoute
  2. Inject services in method parameters (NOT constructor)
  3. Wrap response with $this->checkAuthorization()
  4. Only GET or POST methods

Patterns

JSON Response (API-like)

return $this->checkAuthorization($result, new JsonResponse([
    'code' => $result->getCode(),
    'message' => $result->getMessage(),
    'data' => $result->getData(),
]));

Page Render

return $this->checkAuthorization($result, $this->render('feature/page.html.twig', [
    'data' => $result->getData(),
]));

Checklist

  • Extends BaseRoute
  • Service injected in method parameter
  • HTTP method is GET or POST only
  • Response wrapped with checkAuthorization()
  • Registered in security zone

スコア

総合スコア

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

レビュー

💬

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