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.
日本語の概要は準備中です。原文の説明を表示しています。
Analyzes bounded context boundaries in DDD projects. Detects cross-context coupling, shared kernel violations, context mapping issues, and ubiquitous language inconsistencies. Generates context map diagrams and boundary recommendations.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill analyzes PHP DDD projects for bounded context boundary issues, cross-context coupling, and context mapping violations.
| Concept | Definition | Violation Indicator |
|---|---|---|
| Bounded Context | Explicit boundary with its own domain model | Missing namespace separation |
| Ubiquitous Language | Consistent terminology within context | Same term, different meanings |
| Context Map | Relationships between contexts | Unclear dependencies |
| Anti-Corruption Layer | Translation between contexts | Direct foreign model usage |
| Shared Kernel | Deliberately shared code | Unintentional sharing |
| Published Language | Public API contracts | Breaking changes |
# Identify bounded contexts from directory structure
Glob: **/src/**/Domain/*
Glob: **/src/**/Context/*
Glob: **/src/**/Bounded/*
Glob: **/src/**/Module/*
# Namespace-based contexts
Grep: "namespace.*\\\\Domain\\\\|namespace.*\\\\Context\\\\" --glob "**/*.php"
# Composer autoload namespaces
Read: composer.json (check autoload paths for context namespaces)
Context Indicators:
src/ (e.g., Order, User, Payment)Domain/ subfolder per contextBoundedContext/ or Context/ folder structure# Find cross-context imports (most critical)
# Pattern: Context A importing from Context B's Domain layer
# Order context importing User domain
Grep: "use Order\\\\.*\\\\Domain" --glob "**/User/**/*.php"
Grep: "use User\\\\.*\\\\Domain" --glob "**/Order/**/*.php"
# General pattern: Domain layer importing another Domain
Grep: "use [A-Z][a-z]+\\\\Domain\\\\" --glob "**/Domain/**/*.php"
# Direct entity references across contexts
Grep: "use.*\\\\Entity\\\\(?!.*\\\\self)" --glob "**/Domain/**/*.php"
# Aggregates referencing foreign entities directly
Grep: "private.*[A-Z][a-z]+Entity\|private readonly [A-Z][a-z]+" --glob "**/Aggregate/**/*.php"
# Should use ID references only
# Good: private UserId $userId
# Bad: private User $user (from another context)
# Detect direct object references vs ID references
Grep: "\\$user[^I]|\\$order[^I]|\\$customer[^I]" --glob "**/Domain/**/*.php"
# Repository from one context used in another
Grep: "UserRepositoryInterface" --glob "**/Order/**/*.php"
Grep: "OrderRepositoryInterface" --glob "**/User/**/*.php"
# Generic repository pattern violations
Grep: "RepositoryInterface" --glob "**/*.php"
# Check if implementations span contexts
# Identify potential shared kernel (common code between contexts)
Glob: **/Shared/**/*.php
Glob: **/Common/**/*.php
Glob: **/Core/**/*.php
Glob: **/SharedKernel/**/*.php
# Find duplicated Value Objects across contexts
# Same class name in multiple contexts
Glob: **/Domain/**/Email.php
Glob: **/Domain/**/Money.php
Glob: **/Domain/**/Address.php
# Shared events
Grep: "class.*Event.*implements|extends.*Event" --glob "**/Shared/**/*.php"
Shared Kernel Rules:
# Event publishers (upstream)
Grep: "EventDispatcher|MessageBus|publish\(" --glob "**/Domain/**/*.php"
Grep: "class.*Event\s*\{|final readonly class.*Event" --glob "**/Domain/**/*.php"
# Event subscribers (downstream)
Grep: "EventSubscriber|MessageHandler|Listener" --glob "**/*.php"
Grep: "function __invoke\(.*Event" --glob "**/*.php"
# Check which context publishes and which subscribes
# API clients (customer role)
Grep: "ApiClient|HttpClient|RestClient" --glob "**/Infrastructure/**/*.php"
# API providers (supplier role)
Grep: "Controller|Action|Endpoint" --glob "**/Presentation/**/*.php"
# ACL presence
Glob: **/AntiCorruption/**/*.php
Glob: **/ACL/**/*.php
Glob: **/Adapter/**/*.php
Glob: **/Translator/**/*.php
# Missing ACL (direct external model usage)
Grep: "use External\\\\|use ThirdParty\\\\|use Legacy\\\\" --glob "**/Domain/**/*.php"
# Find same term with different meanings
# Example: "Account" in User context vs Payment context
# Find class with same name in different contexts
Glob: **/User/**/Account.php
Glob: **/Payment/**/Account.php
Glob: **/Billing/**/Account.php
# Find similar entity names
Glob: **/Domain/**/User.php
Glob: **/Domain/**/Customer.php
Glob: **/Domain/**/Client.php
# Inconsistent naming
Grep: "class Order|class Purchase|class Sale" --glob "**/Domain/**/*.php"
# Bounded Context Analysis Report
## Context Map
```mermaid
graph TB
subgraph "Order Context"
O_Domain[Domain]
O_App[Application]
end
subgraph "User Context"
U_Domain[Domain]
U_App[Application]
end
subgraph "Payment Context"
P_Domain[Domain]
P_App[Application]
end
subgraph "Shared Kernel"
SK[Money, Currency]
end
O_Domain -->|"uses ID only"| U_Domain
O_Domain -->|"publishes events"| P_Domain
O_Domain --> SK
U_Domain --> SK
P_Domain --> SK
| Context | Location | Entities | Events | Dependencies |
|---|---|---|---|---|
| Order | src/Order/ | 5 | 8 | User (ID), Payment (event) |
| User | src/User/ | 3 | 4 | None |
| Payment | src/Payment/ | 4 | 6 | Order (event) |
| Shared | src/Shared/ | 0 | 0 | All contexts |
src/Order/Domain/Entity/Order.php:15private User $user (from User context)private UserId $userIdacc-create-value-object (for UserId), acc-create-anti-corruption-layersrc/Payment/Infrastructure/Gateway/StripeGateway.phpuse Stripe\PaymentIntent;acc-create-anti-corruption-layersrc/Order/Domain/ValueObject/Address.phpsrc/User/Domain/ValueObject/Address.phpacc-create-value-objectsrc/User/ uses Account for user profilesrc/Payment/ uses Account for financial accountUserProfile and PaymentAccount| From \ To | Order | User | Payment | Shared |
|---|---|---|---|---|
| Order | - | ID ref | Events | Uses |
| User | - | - | - | Uses |
| Payment | Queries | Queries | - | Uses |
| Shared | - | - | - | - |
Legend:
## Context Integration Patterns
### Recommended Patterns
| Pattern | When to Use | Skills |
|---------|-------------|--------|
| ID Reference | Entity association across contexts | `acc-create-value-object` |
| Domain Events | Async communication | `acc-create-domain-event` |
| ACL | External systems, legacy | `acc-create-anti-corruption-layer` |
| Shared Kernel | Common VOs (Money, etc.) | `acc-create-value-object` |
| Published Language | Public contracts | Documentation |
### Anti-patterns
| Anti-pattern | Issue | Remediation |
|--------------|-------|-------------|
| Direct Entity Reference | Tight coupling | Use ID + resolve via query |
| Shared Entities | Ownership unclear | Split or explicit ownership |
| Cross-Context Repository | Boundary violation | Use events or ACL |
| Synchronous Cross-Context Calls | Temporal coupling | Use async events |
## Quick Analysis Commands
```bash
# Detect bounded contexts
echo "=== Bounded Contexts ===" && \
find src -maxdepth 2 -type d -name "Domain" && \
echo "=== Cross-Context Imports ===" && \
for ctx in $(find src -maxdepth 1 -type d | tail -n +2); do \
name=$(basename $ctx); \
grep -rn "use .*\\\\Domain\\\\" --include="*.php" "$ctx" | grep -v "use $name"; \
done && \
echo "=== Shared Kernel ===" && \
find src -type d -name "Shared" -o -name "Common" -o -name "Core"
Works with:
acc-ddd-auditor — Domain model qualityacc-structural-auditor — Layer violationsacc-ddd-generator — Generate missing componentsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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.
日本語の概要は準備中です。原文の説明を表示しています。