Agent skill
ddd-architecture
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/ddd-architecture
SKILL.md
DDD Architecture Skill
Description
ドメイン駆動設計(DDD)に準拠したバックエンドコードを書くためのスキルです。
Automatic Activation
このスキルは以下のファイルを編集する際に自動で適用されます:
backend/src/domain/**/*.ts- エンティティ、リポジトリIFbackend/src/application/**/*.ts- ユースケース、DTO、サービスbackend/src/infrastructure/**/*.ts- DynamoDB実装、マッパーbackend/src/presentation/**/*.ts- コントローラー、ルートbackend/src/container/**/*.ts- DIコンテナ
Architecture Layers
Presentation Layer (コントローラー、ルート)
↓
Application Layer (ユースケース、アプリケーションサービス)
↓
Domain Layer (エンティティ、リポジトリインターフェース)
↑
Infrastructure Layer (DynamoDBリポジトリ実装)
Directory Structure
backend/src/
├── domain/
│ ├── entities/{feature}/ # エンティティ定義
│ └── repositories/{feature}/ # リポジトリインターフェース
├── application/
│ ├── dto/{feature}/ # Data Transfer Objects
│ ├── usecases/{feature}/ # ユースケース
│ └── services/{feature}/ # アプリケーションサービス
├── infrastructure/
│ ├── repositories/{feature}/ # DynamoDB実装
│ └── mappers/{feature}/ # エンティティ⇔DBマッパー
└── presentation/
├── controllers/{feature}/ # コントローラー
└── routes/{feature}/ # ルーティング
Implementation Rules
1. Domain Layer
- エンティティはビジネスロジックを持つ
- リポジトリはインターフェースのみ定義
- 外部依存を持たない
2. Application Layer
- ユースケースは1つの操作を表す
- DTOで入出力を定義
- ドメインオブジェクトを操作
3. Infrastructure Layer
- リポジトリインターフェースを実装
- DynamoDBとの通信を担当
- マッパーでエンティティ変換
4. Presentation Layer
- HTTPリクエスト/レスポンスを処理
- 認証・認可のミドルウェア適用
- Swagger定義も更新
New Feature Checklist
新機能追加時は以下を全て実装:
-
domain/entities/{feature}/{Feature}.ts -
domain/repositories/{feature}/{Feature}Repository.ts -
application/dto/{feature}/{Feature}Dto.ts -
application/usecases/{feature}/{Feature}UseCase.ts -
infrastructure/repositories/{feature}/DynamoDB{Feature}Repository.ts -
infrastructure/mappers/{feature}/{Feature}Mapper.ts -
presentation/controllers/{feature}/{Feature}Controller.ts -
presentation/routes/{feature}/{feature}Routes.ts -
container/Container.tsにDI登録 -
server.tsにルート追加 -
config/swagger.tsにAPI定義追加
Naming Conventions
| 種類 | 命名規則 | 例 |
|---|---|---|
| エンティティ | PascalCase | Order, MenuItem |
| リポジトリIF | PascalCase + Repository | OrderRepository |
| リポジトリ実装 | DynamoDB + PascalCase + Repository | DynamoDBOrderRepository |
| ユースケース | PascalCase + UseCase | CreateOrderUseCase |
| コントローラー | PascalCase + Controller | OrderController |
| ルート | camelCase + Routes | orderRoutes |
| DTO | PascalCase + Dto | CreateOrderDto |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
riot-games
Manage Riot Games account, track stats across League, Valorant, and more
parcel
Provides comprehensive guidance for Parcel bundler including zero-configuration setup, asset handling, hot module replacement, and production builds. Use when the user asks about Parcel, needs to set up a build tool quickly, or work with Parcel's automatic configuration.
bbs
Manage issues with The Fold's CAS-native BBS (Bulletin Board System). Use for creating, updating, searching, and tracking issues. Invoke when the user wants to create tickets, find work, check issue status, or manage dependencies.
jito-bundles-and-priority-fees
Master Jito bundles for MEV protection and priority fee optimization on Solana - bundle submission, tip strategies, and transaction landing. Use for trading bots, high-priority transactions, and MEV-aware applications.
observability-monitoring-monitor-setup
You are a monitoring and observability expert specializing in implementing comprehensive monitoring solutions. Set up metrics collection, distributed tracing, log aggregation, and create insightful da
makefile-review
Didn't find tool you were looking for?