add-bc-contract

Generate inter-BC data access contracts with Provider pattern implementations.

Updated Dec 16, 2019
One-click install
npx skills add https://github.com/Dev-Int/tests --skill add-bc-contract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-bc-contract
Source: https://github.com/Dev-Int/tests/tree/main/.claude/skills/add-bc-contract
Command: npx skills add https://github.com/Dev-Int/tests --skill add-bc-contract

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the complexity of implementing clean communication between bounded contexts by automatically generating contracts and providers.

Core Features & Use Cases

  • Inter-BC Communication: Create clean interfaces for data sharing between services.
  • Provider Pattern: Automatically implement the provider pattern with proper dependency injection.
  • Use Case: When your Inventory system needs to access Article data from the Admin context, this Skill generates the contract interface and provider implementation automatically.

Quick Start

Add a contract for the Admin bounded context to provide Article data to the Inventory system.

Frequently Asked Questions about add-bc-contract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create clean communication contracts between bounded contexts?

Inter-service communication contracts define how one bounded context (BC) reads data from another. This Skill generates a Contract interface with provide() and provideAll() methods, plus a read-only Provider implementation using Finder, automatically wired via services.yaml for dependency injection across service boundaries.

When should I use the provider pattern instead of a repository for cross-context data access?

Use the provider pattern when a BC needs read-only access to another BC's data without direct repository coupling. Providers enforce architectural boundaries, expose domain data safely via explicit contracts, and maintain Deptrac dependency rules—repositories couple contexts too tightly and violate bounded-context isolation.

How do I expose domain data from one bounded context to another?

Implement a Contract interface in the data-providing BC that returns EntityData through provide(uuid) and provideAll(ids) methods. The Skill auto-generates the Provider, configures it in services.yaml, and validates the implementation against architecture rules (cs-fixer, stan, deptrac).

Can I use providers to generate cross-context select options in Twig components?

Yes. Providers expose domain data as read-only iterables, making them ideal for populating Twig component select options across BCs. The Contract interface standardizes the shape; Finder queries return only necessary fields without repository-level coupling.

What validation does this Skill apply after generating provider contracts?

The Skill runs cs-fixer for code style, PHPStan for static analysis, deptrac analyse to verify boundary rules are maintained, and qa checks. This ensures the generated Contract and Provider comply with architecture constraints and code standards.

Does this approach work with domain-driven design principles?

Yes. Provider contracts align with DDD by formalizing BC boundaries, treating data exposure as explicit contracts rather than implicit dependencies, and preventing anemic data access patterns through Finder-based, read-only providers.