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.
日本語の概要は準備中です。原文の説明を表示しています。
Clean Architecture knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Clean Architecture and Hexagonal Architecture audits.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Quick reference for Clean Architecture / Hexagonal Architecture patterns and PHP implementation guidelines.
┌────────────────────────────────────────────────────────────────┐
│ FRAMEWORKS & DRIVERS │
│ (Web, UI, DB, External Services, Devices) │
├────────────────────────────────────────────────────────────────┤
│ INTERFACE ADAPTERS │
│ (Controllers, Gateways, Presenters, Repositories) │
├────────────────────────────────────────────────────────────────┤
│ APPLICATION BUSINESS RULES │
│ (Use Cases, Application Services) │
├────────────────────────────────────────────────────────────────┤
│ ENTERPRISE BUSINESS RULES │
│ (Entities, Value Objects, Domain Services) │
└────────────────────────────────────────────────────────────────┘
▲
│
Dependencies point INWARD only
Rule: Source code dependencies must point INWARD. Inner layers know nothing about outer layers.
┌─────────────────┐
│ Primary │
│ Adapters │
│ (Controllers) │
└────────┬────────┘
│
▼
┌─────────────────┐
┌──────────►│ PORTS │◄──────────┐
│ │ (Interfaces) │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ APPLICATION │ │
│ │ (Use Cases) │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ DOMAIN │ │
│ │ (Entities) │ │
│ └─────────────────┘ │
│ │
│ ┌─────────────────┐ │
└───────────│ Secondary │───────────┘
│ Adapters │
│ (Repositories, │
│ External APIs) │
└─────────────────┘
Rule: Application core defines Ports (interfaces). Adapters implement them.
| Violation | Where to Look | Severity |
|---|---|---|
| Inner layer imports outer | Domain/Application importing Infrastructure | Critical |
| Framework in core | Doctrine/Symfony in Domain | Critical |
| Use Case with HTTP details | Request/Response in Application | Critical |
| Business logic in Controller | if/switch on domain state | Warning |
| Missing Port | Direct external service call | Warning |
| Adapter with logic | Repository doing validation | Warning |
// Application layer - defines the contract
namespace Application\Order\Port;
interface PaymentGatewayInterface
{
public function charge(PaymentRequest $request): PaymentResponse;
public function refund(string $transactionId, Money $amount): RefundResponse;
}
// Infrastructure layer - implements the contract
namespace Infrastructure\Payment;
final readonly class StripePaymentGateway implements PaymentGatewayInterface
{
public function __construct(
private StripeClient $stripe
) {}
public function charge(PaymentRequest $request): PaymentResponse
{
$charge = $this->stripe->charges->create([
'amount' => $request->amount->cents(),
'currency' => $request->currency->value,
'source' => $request->token,
]);
return new PaymentResponse(
transactionId: $charge->id,
status: PaymentStatus::from($charge->status)
);
}
}
namespace Application\Order\UseCase;
final readonly class ProcessPaymentUseCase
{
public function __construct(
private OrderRepositoryInterface $orders,
private PaymentGatewayInterface $paymentGateway, // Port
private EventDispatcherInterface $events
) {}
public function execute(ProcessPaymentCommand $command): PaymentResult
{
$order = $this->orders->findById($command->orderId);
$payment = $this->paymentGateway->charge(
new PaymentRequest($order->total(), $command->paymentToken)
);
if ($payment->isSuccessful()) {
$order->markAsPaid($payment->transactionId());
$this->orders->save($order);
}
return new PaymentResult($payment->transactionId(), $payment->status());
}
}
namespace Presentation\Api\Order;
final readonly class PaymentController
{
public function __construct(
private ProcessPaymentUseCase $processPayment
) {}
public function process(Request $request): JsonResponse
{
$command = new ProcessPaymentCommand(
orderId: new OrderId($request->get('order_id')),
paymentToken: $request->get('payment_token')
);
$result = $this->processPayment->execute($command);
return new JsonResponse([
'transaction_id' => $result->transactionId,
'status' => $result->status->value,
]);
}
}
For detailed information, load these reference files:
references/dependency-rule.md — The Dependency Rule explainedreferences/layer-boundaries.md — Layer responsibilities and boundariesreferences/port-adapter-patterns.md — Hexagonal Architecture patternsreferences/antipatterns.md — Common violations with detection patternsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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.
日本語の概要は準備中です。原文の説明を表示しています。