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 Chain of Responsibility pattern for PHP 8.5. Creates handler chains for request processing with middleware-style composition. Includes unit tests.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Creates Chain of Responsibility pattern infrastructure for sequential request processing.
| Scenario | Example |
|---|---|
| Multiple processors | Validation, discounts, approvals |
| Unknown handlers | Plugin systems |
| Priority processing | First match wins |
| Middleware | HTTP pipeline, logging |
Path: src/Domain/{BoundedContext}/Handler/
{Name}HandlerInterface.php — Handler contract with setNext and handle methodsPath: src/Domain/{BoundedContext}/Handler/
Abstract{Name}Handler.php — Base class with chain linking logicPath: src/Domain/{BoundedContext}/Handler/
{Specific}{Name}Handler.php — Specific handler implementationsPath: src/Domain/{BoundedContext}/Handler/
{Name}ChainBuilder.php — Fluent builder for chain construction{Handler}Test.php — Individual handler tests{Name}ChainTest.php — Chain integration tests| Component | Path |
|---|---|
| Handler Interface | src/Domain/{BoundedContext}/Handler/ |
| Abstract Handler | src/Domain/{BoundedContext}/Handler/ |
| Concrete Handlers | src/Domain/{BoundedContext}/Handler/ |
| Chain Builder | src/Domain/{BoundedContext}/Handler/ |
| Pipeline | src/Application/Pipeline/ |
| Unit Tests | tests/Unit/Domain/{BoundedContext}/Handler/ |
| Component | Pattern | Example |
|---|---|---|
| Interface | {Name}HandlerInterface | ValidationHandlerInterface |
| Abstract | Abstract{Name}Handler | AbstractValidationHandler |
| Concrete | {Specific}{Name}Handler | EmailValidationHandler |
| Builder | {Name}ChainBuilder | ValidationChainBuilder |
| Test | {ClassName}Test | EmailValidationHandlerTest |
interface {Name}HandlerInterface
{
public function setNext(self $handler): self;
public function handle({RequestType} $request): {ResultType};
}
abstract class Abstract{Name}Handler implements {Name}HandlerInterface
{
private ?{Name}HandlerInterface $next = null;
public function setNext({Name}HandlerInterface $handler): {Name}HandlerInterface
{
$this->next = $handler;
return $handler;
}
public function handle({RequestType} $request): {ResultType}
{
if ($this->next !== null) {
return $this->next->handle($request);
}
return $this->getDefaultResult();
}
abstract protected function getDefaultResult(): {ResultType};
}
final class {Specific}Handler extends Abstract{Name}Handler
{
public function handle({RequestType} $request): {ResultType}
{
if ($this->canHandle($request)) {
return $this->process($request);
}
return parent::handle($request);
}
private function canHandle({RequestType} $request): bool
{
return {condition};
}
}
final class {Name}ChainBuilder
{
private array $handlers = [];
public function add({Name}HandlerInterface $handler): self
{
$this->handlers[] = $handler;
return $this;
}
public function build(): {Name}HandlerInterface
{
$first = $this->handlers[0];
$current = $first;
for ($i = 1; $i < count($this->handlers); $i++) {
$current = $current->setNext($this->handlers[$i]);
}
return $first;
}
}
$chain = (new ValidationChainBuilder())
->add(new NotEmptyValidationHandler('email'))
->add(new EmailValidationHandler('email'))
->add(new MinLengthValidationHandler('password', 8))
->build();
$result = $chain->validate($request);
if ($result->hasErrors()) {
throw new ValidationException($result->getMessage());
}
$vipHandler = new VipDiscountHandler();
$promoHandler = new PromoCodeDiscountHandler($promoCodes);
$bulkHandler = new BulkDiscountHandler();
$vipHandler->setNext($promoHandler);
$promoHandler->setNext($bulkHandler);
$result = $vipHandler->apply($discountRequest);
| Anti-pattern | Problem | Solution |
|---|---|---|
| Circular Chain | Infinite loop | Validate chain structure |
| No Default | Unhandled requests | Provide fallback handler |
| Coupled Handlers | Hard to reorder | Use interface properly |
| Missing Builder | Manual chain assembly | Create ChainBuilder |
| State in Handler | Non-reentrant | Make handlers stateless |
For complete PHP templates and examples, see:
references/templates.md — Handler Interface, Abstract Handler, Concrete Handler, Chain Builder, Pipeline templatesreferences/examples.md — Validation Chain, Discount Chain examples and testsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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.
日本語の概要は準備中です。原文の説明を表示しています。