architecture-patterns
バックエンドアーキテクチャパターンの実装
Également disponible depuis: Barnhardt-Enterprises-Inc,AdamManuel-dev
保守性の高いバックエンドシステムを構築するには、実証済みのアーキテクチャパターンが必要です。このスキルは、Clean Architecture、Hexagonal Architecture、Domain-Driven Design を実装して、関心の分離を適切に保ちながら、テスト可能でスケーラブルなアプリケーションを作成するのに役立ちます。
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "architecture-patterns". Create a Clean Architecture structure for a user management system
Résultat attendu:
このスキルは、domain/entities に User エンティティ、domain/interfaces に IUserRepository ポート、use_cases に CreateUserUseCase と UpdateUserUseCase、adapters/repositories に PostgresUserRepository 実装、adapters/controllers に HTTP 処理のための UserController を含む完全なディレクトリ構造を生成します。各コンポーネントは適切な依存関係の流れと関心の分離を示します。
Utilisation de "architecture-patterns". Implement a payment gateway adapter using hexagonal architecture
Résultat attendu:
このスキルは、charge メソッドの契約を定義する PaymentGatewayPort インターフェースを作成し、続いて本番用の StripePaymentAdapter とテスト用の MockPaymentAdapter の両方を実装します。両アダプタは同じポートインターフェースを実装するため、ビジネスロジックを変更せずに容易に差し替えできます。例にはエラーハンドリングと適切な async/await パターンが含まれます。
Utilisation de "architecture-patterns". Design an Order aggregate with DDD patterns
Résultat attendu:
このスキルは、add_item、calculate_total、submit メソッドでビジネスルールをカプセル化したアグリゲートルートとして Order エンティティを設計します。OrderItem エンティティ、通貨処理のための Money バリューオブジェクト、状態管理のための OrderStatus enum、OrderSubmittedEvent などのドメインイベントを含みます。アグリゲートは不変条件を強制し、一貫性境界を維持します。
Audit de sécurité
SûrAll 43 static analysis findings are false positives from educational code examples in documentation. The skill teaches software architecture patterns through Python examples showing Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. No executable code, network access, or security vulnerabilities present.
Score de qualité
Ce que vous pouvez construire
新規バックエンドサービスのアーキテクチャ設計
適切なレイヤー分離、依存性注入、テスト可能なビジネスロジックを備えた Clean Architecture の原則で新しいマイクロサービスを計画・実装する。
モノリシックアプリケーションのリファクタリング
密結合なモノリシックアプリケーションを、テストと保守が容易なポートとアダプタを備えた整然とした Hexagonal Architecture に変換する。
Domain-Driven Design パターンの実装
アグリゲート、エンティティ、バリューオブジェクト、ドメインイベントを含む DDD の戦術的パターンで複雑なビジネスドメインをモデリングし、ドメイン整合性を高める。
Essayez ces prompts
Create a Clean Architecture folder structure for an e-commerce order management system with domain entities, use cases, and adapters.
Implement a user repository port interface and PostgreSQL adapter following hexagonal architecture principles with async database access.
Design an Order aggregate with domain entities, value objects, and business rules for adding items, calculating totals, and state transitions.
Refactor this FastAPI endpoint that has business logic in the controller into a proper use case with dependency injection and separation of concerns.
Bonnes pratiques
- 依存関係は常に外側のレイヤーから内側へ向け、ドメインレイヤーがインフラに依存しないようにする
- ドメインレイヤーで契約を定義するためにインターフェースとポートを使い、外側レイヤーでテスト可能性のためのアダプタを実装する
- ビジネスロジックはドメインエンティティとユースケースに保持し、コントローラは HTTP の関心事のみを扱いユースケースに委譲する
Éviter
- ユースケースやドメインエンティティではなく、コントローラや API ハンドラにビジネスロジックを置く
- データプロパティのみで振る舞いがない貧血なドメインモデルを作り、ロジックをすべてサービスに置く
- 抽象化インターフェースなしにドメインレイヤーを特定のフレームワーク、データベース、外部 API に密結合させる