Check Context Communicationのロゴ

Check Context Communication

コミュニティ
dykyi-roman
check-context-communication

Audits Bounded Context communication patterns. Checks Context Map relationships (Shared Kernel, ACL, Open Host), event vs direct calls, and anti-corruption layer usage.

概要

公開者dykyi-roman
リポジトリawesome-claude-code
スキル名check-context-communication
スター
98
フォーク
25
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    dykyi-romanがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Check Context Communication」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-context-communication
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git /tmp/awesome-claude-code
mkdir -p .claude/skills
cp -r /tmp/awesome-claude-code/skills/check-context-communication .claude/skills/check-context-communication
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCheck Context Communicationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCheck Context Communicationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Check Context Communicationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Context Communication Audit

Analyze PHP code for proper Bounded Context communication following DDD Context Map patterns.

Detection Patterns

1. Direct Cross-Context Dependency

php
// CRITICAL: Order context directly uses User context internals
namespace App\Order\Application;

use App\User\Domain\User;           // Cross-context import!
use App\User\Domain\UserRepository;  // Cross-context import!

final readonly class CreateOrderUseCase
{
    public function __construct(
        private UserRepository $userRepo, // Depends on another context's repository
    ) {}

    public function execute(CreateOrderCommand $command): void
    {
        $user = $this->userRepo->find($command->userId());
        $order = Order::create($user->email(), $user->shippingAddress());
        // Tight coupling — if User changes, Order breaks
    }
}

// CORRECT: Anti-Corruption Layer
namespace App\Order\Infrastructure\ACL;

final readonly class UserProfileAdapter implements OrderContext\UserProfilePort
{
    public function __construct(
        private UserContextApi $userApi, // Interface, not concrete
    ) {}

    public function getShippingInfo(UserId $userId): ShippingInfo
    {
        $userData = $this->userApi->getUserProfile($userId);
        return new ShippingInfo(  // Map to Order context's own model
            address: Address::fromArray($userData['address']),
            name: $userData['name'],
        );
    }
}

2. Shared Kernel Misuse

php
// ANTIPATTERN: Too much shared between contexts
namespace App\Shared\Domain;

class User { }         // Full entity in Shared — too much!
class Order { }        // Full entity in Shared — too much!
class Money { }        // OK — genuine shared concept
class Currency { }     // OK — genuine shared concept
class EventId { }      // OK — infrastructure concern

// CORRECT: Minimal Shared Kernel
namespace App\Shared\Domain;

// Only truly shared, stable concepts
final readonly class Money { }
final readonly class Currency { }
final readonly class EventId { }
final readonly class AggregateId { }

3. Synchronous Cross-Context Call

php
// ANTIPATTERN: Synchronous call between contexts
namespace App\Order\Application;

final readonly class CompleteOrderUseCase
{
    public function execute(CompleteOrderCommand $command): void
    {
        $order = $this->orderRepo->find($command->orderId());
        $order->complete();
        $this->orderRepo->save($order);

        // Synchronous cross-context calls!
        $this->inventoryService->reserve($order->items());     // Inventory context
        $this->paymentService->capture($order->paymentId());   // Payment context
        $this->shippingService->schedule($order->address());   // Shipping context
        // If any fails → partial state + coupling
    }
}

// CORRECT: Event-driven cross-context communication
final readonly class CompleteOrderUseCase
{
    public function execute(CompleteOrderCommand $command): void
    {
        $order = $this->orderRepo->find($command->orderId());
        $order->complete(); // Records OrderCompleted domain event
        $this->orderRepo->save($order);
        // Events dispatched asynchronously:
        // OrderCompleted → InventoryContext (reserve)
        // OrderCompleted → PaymentContext (capture)
        // OrderCompleted → ShippingContext (schedule)
    }
}

4. Missing Anti-Corruption Layer

php
// ANTIPATTERN: External API model used directly in domain
namespace App\Order\Domain;

use Stripe\PaymentIntent;  // External API model in domain!

final class Payment
{
    public function __construct(
        private PaymentIntent $stripePayment, // Stripe model in domain
    ) {}

    public function isSuccessful(): bool
    {
        return $this->stripePayment->status === 'succeeded'; // Coupled to Stripe
    }
}

// CORRECT: ACL translates external to domain
namespace App\Order\Infrastructure\ACL;

final readonly class StripePaymentAdapter implements PaymentGateway
{
    public function charge(Money $amount): PaymentResult
    {
        $intent = $this->stripe->paymentIntents->create([...]);
        return PaymentResult::from(   // Domain model
            status: $this->mapStatus($intent->status),
            transactionId: new TransactionId($intent->id),
        );
    }

    private function mapStatus(string $stripeStatus): PaymentStatus
    {
        return match ($stripeStatus) {
            'succeeded' => PaymentStatus::COMPLETED,
            'requires_action' => PaymentStatus::PENDING,
            default => PaymentStatus::FAILED,
        };
    }
}

5. Event Leaking Internal State

php
// ANTIPATTERN: Domain event exposes aggregate internals
final readonly class OrderCompleted implements DomainEvent
{
    public function __construct(
        public Order $order,  // Full aggregate in event!
        // Other contexts can access all internal state
    ) {}
}

// CORRECT: Event contains only necessary data
final readonly class OrderCompleted implements DomainEvent
{
    public function __construct(
        public OrderId $orderId,
        public UserId $userId,
        public Money $total,
        public \DateTimeImmutable $occurredAt,
    ) {}
}

6. No Context Boundary in Namespace

php
// ANTIPATTERN: Flat structure without context boundaries
src/
├── Entity/
│   ├── User.php
│   ├── Order.php
│   └── Product.php     // All entities mixed together!
├── Repository/
│   ├── UserRepository.php
│   └── OrderRepository.php

// CORRECT: Bounded Context boundaries in namespace
src/
├── UserManagement/     // Bounded Context
│   ├── Domain/
│   ├── Application/
│   └── Infrastructure/
├── OrderProcessing/    // Bounded Context
│   ├── Domain/
│   ├── Application/
│   └── Infrastructure/

Grep Patterns

bash
# Cross-context imports
Grep: "use App\\\\[A-Z][a-z]+\\\\Domain" --glob "**/Application/**/*.php"
# Check if import is from different context than file's context

# Direct service calls across contexts
Grep: "Service->|Client->|Api->" --glob "**/Application/**/*UseCase.php"

# External models in domain
Grep: "use Stripe\\\\|use Twilio\\\\|use AWS\\\\|use Google\\\\" --glob "**/Domain/**/*.php"

# Full aggregate in events
Grep: "public.*Entity.*\$|public.*Aggregate.*\$" --glob "**/Domain/**/*Event*.php"

# Shared Kernel size
Glob: **/Shared/Domain/**/*.php
# Count files — if > 10, probably too much shared

# Missing ACL
Grep: "implements.*Port|implements.*Gateway" --glob "**/Infrastructure/ACL/**/*.php"

Severity Classification

PatternSeverity
Direct cross-context domain dependency🔴 Critical
External model in domain layer🔴 Critical
Synchronous cross-context calls🟠 Major
Oversized Shared Kernel🟠 Major
Event leaking aggregate internals🟠 Major
Missing ACL for external service🟡 Minor

Context Map Patterns Reference

PatternWhen to Use
Shared KernelTwo teams co-own small shared model (Money, EventId)
Anti-Corruption LayerProtect domain from external/legacy models
Open Host ServiceProvide well-defined API for consumers
Published LanguageShared event schema (JSON Schema, Protobuf)
Customer/SupplierUpstream provides, downstream consumes
ConformistDownstream adopts upstream model (not recommended)

Output Format

markdown
### Context Communication: [Description]

**Severity:** 🔴/🟠/🟡
**Location:** `file.php:line`
**Contexts:** [Source Context] → [Target Context]
**Pattern Violated:** [Context Map pattern]

**Issue:**
[Description of the communication violation]

**Impact:**
- Coupling between bounded contexts
- Cannot deploy/evolve contexts independently

**Code:**
```php
// Cross-context violation

Fix:

php
// Proper context communication

よくある質問

AIスキル「Check Context Communication」では何ができますか?

Audits Bounded Context communication patterns. Checks Context Map relationships (Shared Kernel, ACL, Open Host), event vs direct calls, and anti-corruption layer usage.

TypingMindでCheck Context Communicationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Check Context Communicationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCheck Context Communicationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-context-communicationを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Check Context Communicationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Check Context Communicationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCheck Context Communicationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Check Context Communication」は無料ですか?

はい。dykyi-romanがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇