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 Null Object pattern for PHP 8.5. Creates safe default implementations eliminating null checks. Includes unit tests.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Creates Null Object pattern infrastructure for eliminating null checks.
| Scenario | Example |
|---|---|
| Optional dependencies | Logger, Cache, Notifier |
| Missing entities | Customer, User, Product |
| Feature toggles | Disabled feature returns null object |
| Default implementations | No-op defaults |
Path: src/Domain/{BoundedContext}/
{Name}Interface.php — Interface with isNull() methodPath: src/Domain/{BoundedContext}/
Null{Name}.php — Null implementation returning neutral valuesPath: src/Domain/{BoundedContext}/
{Name}.php — Real implementation with business logicNull{Name}Test.php — Null object behavior tests| Component | Path |
|---|---|
| Interface | src/Domain/{BoundedContext}/ |
| Null Object | src/Domain/{BoundedContext}/ |
| Real Implementation | src/Domain/{BoundedContext}/ |
| Unit Tests | tests/Unit/Domain/{BoundedContext}/ |
| Component | Pattern | Example |
|---|---|---|
| Interface | {Name}Interface | CustomerInterface |
| Real Implementation | {Name} | Customer |
| Null Object | Null{Name} | NullCustomer |
| Test | {ClassName}Test | NullCustomerTest |
| Type | Neutral Value |
|---|---|
string | '' (empty string) |
int | 0 |
float | 0.0 |
bool | false |
array | [] |
void | No return |
| Object | Empty/default instance |
| Collection | Empty collection |
interface {Name}Interface
{
public function {method1}(): {returnType1};
public function {method2}({params}): {returnType2};
public function isNull(): bool;
}
final readonly class Null{Name} implements {Name}Interface
{
public function {method1}(): {returnType1}
{
return {neutralValue1};
}
public function isNull(): bool
{
return true;
}
}
final readonly class {Name} implements {Name}Interface
{
public function __construct({properties}) {}
public function {method1}(): {returnType1}
{
return {realImplementation};
}
public function isNull(): bool
{
return false;
}
}
final readonly class DoctrineCustomerRepository implements CustomerRepositoryInterface
{
public function findById(CustomerId $id): CustomerInterface
{
$row = $this->connection->fetchAssociative(
'SELECT * FROM customers WHERE id = :id',
['id' => $id->toString()]
);
if ($row === false) {
return new NullCustomer();
}
return $this->hydrate($row);
}
}
final readonly class CreateOrderUseCase
{
public function execute(CreateOrderCommand $command): Order
{
$customer = $this->customers->findById($command->customerId);
// No null check needed - NullCustomer returns 0.0
$discount = $customer->getDiscount();
$order = Order::create(
customerId: $customer->id(),
items: $command->items,
discount: $discount
);
return $order;
}
}
| Anti-pattern | Problem | Solution |
|---|---|---|
| Throwing in Null | Unexpected exceptions | Return neutral values |
No isNull() | Can't detect null object | Add isNull method |
| Different Interface | LSP violation | Same interface as real |
| Side Effects | Unexpected behavior | Pure no-op methods |
| Complex Logic | Not a null object | Keep simple and neutral |
For complete PHP templates and examples, see:
references/templates.md — Interface, NullObject, Real Implementation, NullLogger, NullCache templatesreferences/examples.md — NullCustomer, NullNotifier, Repository integration 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.
日本語の概要は準備中です。原文の説明を表示しています。