Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

domain-model-boundaries-mapper领域模型边界映射器

Agent Skill

domain-model-boundaries-mapper 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,271

周安装

91

GitHub Stars

32

下载量

735
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:domain-model-boundaries-mapper(领域模型边界映射器)
来源仓库:https://github.com/patricio0312rev/skills
仓库路径:skills/domain-model-boundaries-mapper
安装命令:
npx skills add https://github.com/patricio0312rev/skills --skill domain-model-boundaries-mapper
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/patricio0312rev/skills --skill domain-model-boundaries-mapper

简介

domain-model-boundaries-mapper 绘制领域边界与所有权映射,遵循 DDD 实践。

  • 适用于电商、CRM 等系统的有界上下文识别与职责分配。
  • 输出包含实体、值对象与上下文图的标准化领域地图模板。
  • 帮助团队明确各上下文边界与集成方式,减少耦合。
  • 建议结合业务流程图验证映射准确性,避免遗漏关键交互。

SKILL.md

Domain Model & Boundaries Mapper

Map domain boundaries and ownership using Domain-Driven Design.

Domain Map Template

# Domain Map: E-Commerce Platform

## Bounded Contexts

### 1. Customer Management

**Core Domain:** User accounts, profiles, preferences
**Owner:** Customer Team
**Ubiquitous Language:**

- Customer: Registered user with account
- Profile: Customer personal information
- Preferences: User settings and choices

**Entities:**

- Customer (id, email, name)
- Address (id, customer_id, street, city)
- PaymentMethod (id, customer_id, type, token)

**Bounded Context Diagram:**

┌─────────────────────────────┐ │ Customer Management │ │ ┌─────────┐ ┌──────────┐ │ │ │Customer │ │ Address │ │ │ └─────────┘ └──────────┘ │ │ ┌─────────────────────┐ │ │ │ Payment Method │ │ │ └─────────────────────┘ │ └─────────────────────────────┘

### 2. Order Management
**Core Domain:** Order processing, fulfillment
**Owner:** Orders Team
**Ubiquitous Language:**
- Order: Purchase request with line items
- LineItem: Product quantity in order
- Fulfillment: Physical delivery of order

**Entities:**
- Order (id, customer_id, status, total)
- LineItem (id, order_id, product_id, quantity)
- Shipment (id, order_id, tracking_number)

### 3. Product Catalog
**Core Domain:** Product information, inventory
**Owner:** Catalog Team
**Ubiquitous Language:**
- Product: Sellable item
- SKU: Stock keeping unit
- Inventory: Available stock

**Entities:**
- Product (id, name, price, description)
- Inventory (sku, quantity, warehouse_id)

## Context Relationships

Customer Management ──────▶ Order Management (customer_id)

Product Catalog ──────▶ Order Management (product_id)

Order Management ──────▶ Fulfillment (order events)

## Anti-Corruption Layers

### Order Management → Customer Management
**Problem:** Orders need customer data but shouldn't depend on Customer domain model

**Solution:** Customer Adapter

// Order domain's view of customer interface CustomerForOrder { id: string; shippingAddress: Address; billingAddress: Address; }

// Adapter translates Customer domain to Order domain class CustomerAdapter { async getCustomerForOrder(customerId: string): Promise<CustomerForOrder> { const customer = await customerService.getCustomer(customerId); return { id: customer.id, shippingAddress: this.toOrderAddress(customer.defaultShippingAddress), billingAddress: this.toOrderAddress(customer.defaultBillingAddress), }; } }


## Dependency Map

┌──────────────┐ │ Customer │ └──────┬───────┘ │ ▼ ┌──────────────┐ ┌────────────┐ │ Orders │─────▶│ Products │ └──────┬───────┘ └────────────┘ │ ▼ ┌──────────────┐ │ Fulfillment │ └──────────────┘


**Dependency Rules:**

- Customer has no dependencies
- Orders depends on Customer (read) and Products (read)
- Fulfillment depends on Orders (events)

## Interface Contracts

### Customer Management → Orders

// Public interface exposed by Customer domain interface CustomerService { getCustomer(id: string): Promise<Customer>; getCustomerAddresses(id: string): Promise<Address[]>; }

// Events published interface CustomerUpdated { customerId: string; email: string; name: string; }


### Product Catalog → Orders

interface ProductService { getProduct(id: string): Promise<Product>; checkAvailability(sku: string, quantity: number): Promise<boolean>; reserveInventory(items: ReservationRequest[]): Promise<Reservation>; }


## Refactor Recommendations

### Problem 1: Tight Coupling

**Current:** Orders directly queries Customer database **Issue:** Breaks bounded context, creates coupling **Recommendation:** Use Customer API instead

// ❌ Before: Direct database access const customer = await db.customers.findById(customerId);

// ✅ After: API call through adapter const customer = await customerAdapter.getCustomerForOrder(customerId);


### Problem 2: Shared Models

**Current:** Same `User` model used across contexts **Issue:** Changes in one context affect others **Recommendation:** Separate models per context

// Customer context interface Customer { id: string; email: string; profile: CustomerProfile; preferences: CustomerPreferences; }

// Order context (different model!) interface OrderCustomer { id: string; shippingAddress: Address; billingAddress: Address; }


### Problem 3: God Service

**Current:** `OrderService` handles orders, inventory, payments, shipping **Issue:** Single service owns too much **Recommendation:** Extract bounded contexts

- OrderService: Order lifecycle
- InventoryService: Stock management
- PaymentService: Payment processing
- FulfillmentService: Shipping

## Strategic Design Patterns

### Pattern 1: Shared Kernel

**When:** Two contexts must share some code **Example:** Common value objects (Money, Address)

// Shared kernel (minimal!) class Money { constructor(public amount: number, public currency: string) {} }


### Pattern 2: Customer/Supplier

**When:** One context depends on another **Example:** Orders (customer) depends on Products (supplier)

- Supplier defines interface
- Customer adapts to their needs

### Pattern 3: Published Language

**When:** Many contexts need same data **Example:** Product events

interface ProductCreated { productId: string; name: string; price: Money; publishedAt: Date; }


## Migration Strategy

### Phase 1: Identify Boundaries

- Map existing code to domains
- Identify coupling points
- Document dependencies

### Phase 2: Define Interfaces

- Design APIs between contexts
- Create adapter layers
- Define event contracts

### Phase 3: Decouple

- Replace direct DB access with APIs
- Introduce anti-corruption layers
- Separate models per context

### Phase 4: Extract Services (optional)

- Move contexts to separate services
- Implement API gateways
- Set up event bus

## Best Practices

1. **Ubiquitous language**: Same terms in code and domain
2. **Bounded contexts**: Clear boundaries, separate models
3. **Context maps**: Document relationships
4. **Anti-corruption layers**: Protect domain integrity
5. **Event-driven**: Loose coupling via events
6. **Separate databases**: Context owns its data

## Output Checklist

- Bounded contexts identified (3-7)
- Core domain vs supporting domains
- Ubiquitous language defined per context
- Entity/aggregate definitions
- Context relationship diagram
- Dependency map
- Interface contracts defined
- Anti-corruption layers designed
- Refactor recommendations
- Migration strategy

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.37%
按下载量换算223

Gemini CLI

22.3%
按下载量换算164

Antigravity

16.44%
按下载量换算121

windsurf

13.02%
按下载量换算96

github-copilot

7.52%
按下载量换算55

Codex

3.84%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills