Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Generates ADR Action classes for PHP 8.5. Creates single-responsibility HTTP endpoint handlers with PSR-7 support. Includes unit tests.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Generate ADR-compliant Action classes for HTTP endpoints.
__invoke() method<?php
declare(strict_types=1);
namespace Presentation\Api\{Context}\{Action};
use Application\{Context}\UseCase\{Action}\{Action}Command;
use Application\{Context}\UseCase\{Action}\{Action}Handler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class {Action}Action
{
public function __construct(
private {Action}Handler $handler,
private {Action}Responder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
{inputParsing}
$command = new {Action}Command(
{commandProperties}
);
$result = $this->handler->handle($command);
return $this->responder->respond($result);
}
{privateMethods}
}
<?php
declare(strict_types=1);
namespace Tests\Unit\Presentation\Api\{Context}\{Action};
use Application\{Context}\UseCase\{Action}\{Action}Command;
use Application\{Context}\UseCase\{Action}\{Action}Handler;
use Application\{Context}\UseCase\{Action}\{Action}Result;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Presentation\Api\{Context}\{Action}\{Action}Action;
use Presentation\Api\{Context}\{Action}\{Action}Responder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
#[Group('unit')]
#[CoversClass({Action}Action::class)]
final class {Action}ActionTest extends TestCase
{
private {Action}Handler $handler;
private {Action}Responder $responder;
private {Action}Action $action;
protected function setUp(): void
{
$this->handler = $this->createMock({Action}Handler::class);
$this->responder = $this->createMock({Action}Responder::class);
$this->action = new {Action}Action($this->handler, $this->responder);
}
public function testInvokesHandlerWithCommand(): void
{
$request = $this->createRequest([{testData}]);
$result = $this->createMock({Action}Result::class);
$response = $this->createMock(ResponseInterface::class);
$this->handler
->expects($this->once())
->method('handle')
->with($this->callback(fn ({Action}Command $cmd) =>
{commandAssertions}
))
->willReturn($result);
$this->responder
->expects($this->once())
->method('respond')
->with($result)
->willReturn($response);
$actual = ($this->action)($request);
self::assertSame($response, $actual);
}
private function createRequest(array $body): ServerRequestInterface
{
$stream = $this->createMock(StreamInterface::class);
$request = $this->createMock(ServerRequestInterface::class);
$request->method('getParsedBody')->willReturn($body);
$request->method('getBody')->willReturn($stream);
return $request;
}
}
<?php
declare(strict_types=1);
namespace Presentation\Api\User\GetById;
use Application\User\UseCase\GetUserById\GetUserByIdQuery;
use Application\User\UseCase\GetUserById\GetUserByIdHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class GetUserByIdAction
{
public function __construct(
private GetUserByIdHandler $handler,
private GetUserByIdResponder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
$userId = $request->getAttribute('id');
$query = new GetUserByIdQuery(userId: $userId);
$result = $this->handler->handle($query);
return $this->responder->respond($result);
}
}
<?php
declare(strict_types=1);
namespace Presentation\Api\User\ListAll;
use Application\User\UseCase\ListUsers\ListUsersQuery;
use Application\User\UseCase\ListUsers\ListUsersHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class ListUsersAction
{
public function __construct(
private ListUsersHandler $handler,
private ListUsersResponder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
$queryParams = $request->getQueryParams();
$query = new ListUsersQuery(
page: (int) ($queryParams['page'] ?? 1),
perPage: (int) ($queryParams['per_page'] ?? 20),
search: $queryParams['search'] ?? null,
);
$result = $this->handler->handle($query);
return $this->responder->respond($result);
}
}
<?php
declare(strict_types=1);
namespace Presentation\Api\User\Create;
use Application\User\UseCase\CreateUser\CreateUserCommand;
use Application\User\UseCase\CreateUser\CreateUserHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class CreateUserAction
{
public function __construct(
private CreateUserHandler $handler,
private CreateUserResponder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
$body = (array) $request->getParsedBody();
$command = new CreateUserCommand(
email: $body['email'] ?? '',
name: $body['name'] ?? '',
);
$result = $this->handler->handle($command);
return $this->responder->respond($result);
}
}
<?php
declare(strict_types=1);
namespace Presentation\Api\User\Update;
use Application\User\UseCase\UpdateUser\UpdateUserCommand;
use Application\User\UseCase\UpdateUser\UpdateUserHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class UpdateUserAction
{
public function __construct(
private UpdateUserHandler $handler,
private UpdateUserResponder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
$userId = $request->getAttribute('id');
$body = (array) $request->getParsedBody();
$command = new UpdateUserCommand(
userId: $userId,
name: $body['name'] ?? null,
email: $body['email'] ?? null,
);
$result = $this->handler->handle($command);
return $this->responder->respond($result);
}
}
<?php
declare(strict_types=1);
namespace Presentation\Api\User\Delete;
use Application\User\UseCase\DeleteUser\DeleteUserCommand;
use Application\User\UseCase\DeleteUser\DeleteUserHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final readonly class DeleteUserAction
{
public function __construct(
private DeleteUserHandler $handler,
private DeleteUserResponder $responder,
) {
}
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
$userId = $request->getAttribute('id');
$command = new DeleteUserCommand(userId: $userId);
$result = $this->handler->handle($command);
return $this->responder->respond($result);
}
}
| Component | Path |
|---|---|
| Action | src/Presentation/Api/{Context}/{Action}/{Action}Action.php |
| Action Interface | src/Presentation/Shared/Action/ActionInterface.php |
| Test | tests/Unit/Presentation/Api/{Context}/{Action}/{Action}ActionTest.php |
When asked to create an Action:
| HTTP Method | Action Name | Command/Query |
|---|---|---|
| GET (single) | Get{Resource}ByIdAction | Get{Resource}ByIdQuery |
| GET (list) | List{Resource}sAction | List{Resource}sQuery |
| POST | Create{Resource}Action | Create{Resource}Command |
| PUT | Update{Resource}Action | Update{Resource}Command |
| PATCH | Patch{Resource}Action | Patch{Resource}Command |
| DELETE | Delete{Resource}Action | Delete{Resource}Command |
For detailed patterns and examples:
references/templates.md — Additional Action templatesreferences/examples.md — Real-world Action examples아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Master backend architectures, REST API design, microservices, and server-side development across multiple languages. Use this as a central index to access specialized sub-skills.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
在每次回复中使用固定前缀并列出本次实际参考的指令/文件,便于校验是否遵循上下文与规则。
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
[00] META. Orchestrate skills into dynamic chains for complex tasks. Analyzes the task, discovers available skills, builds an optimal chain, explains why each skill is needed, and executes step-by-step with user confirmation. Use for any complex task requiring multiple thinking/research/analysis steps. Triggers on "plan this", "how to approach", "what's the strategy", "build a plan", or any multi-step problem requiring skill orchestration.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.