← スキル一覧に戻る

symfony-skapi-action
by Swoking
Claude Code plugin pour projets Symfony StarterKit
⭐ 0🍴 0📅 2026年1月19日
SKILL.md
name: symfony-sk:api-action description: Create API Action controllers extending BaseAction. Use for API endpoints. allowed-tools: Read, Write, Edit, Glob, Grep
API Action Skill
Mission
Create API controller actions that handle HTTP requests, validate DTOs, and return JSON.
Location
api/src/Controller/<Feature>/<Name>Action.php
Template - Without DTO
<?php
namespace App\Controller\<Feature>;
use App\Service\<Feature>Service;
use StarterKit\Controller\BaseAction;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
class <Feature><Action>Action extends BaseAction
{
#[Route("/{lang}/<route>", name: "<feature>_<action>", methods: ["POST"])]
public function <action>Action(<Feature>Service $service, string $lang, string $key): JsonResponse
{
$this->initApiResult($lang);
$this->apiResult = $service-><method>($this->apiResult, $lang, $key);
return $this->processReturnCode();
}
}
Template - With DTO
<?php
namespace App\Controller\<Feature>;
use App\Dto\<Feature>\<Feature><Action>Dto;
use App\Service\<Feature>Service;
use StarterKit\Controller\BaseAction;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;
class <Feature><Action>Action extends BaseAction
{
#[Route("/{lang}/<route>", name: "<feature>_<action>", methods: ["POST"])]
public function <action>Action(<Feature>Service $service, Request $request, string $lang): JsonResponse
{
$data = $this->initApiResult($lang, <Feature><Action>Dto::class, $request);
if ($this->apiResult->getCode() === 0) {
$this->apiResult = $service-><method>($this->apiResult, $lang, $data);
}
return $this->processReturnCode();
}
}
Key Rules
- Extends
BaseAction - Route starts with
/{lang}/ - ALWAYS pass
$langto service - Check
getCode() === 0before calling service with DTO - Return
$this->processReturnCode()
HTTP Methods
| Action | Method |
|---|---|
| List/Read | GET |
| Create | POST |
| Update | PUT |
| Delete | DELETE |
| Custom | POST |
Checklist
- Extends
BaseAction - Route starts with
/{lang}/ -
$langpassed to service - Returns
processReturnCode() - Registered in security zone (use
/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
レビュー
💬
レビュー機能は近日公開予定です