SuperAPI AI Directory

ddd-model-review

Coding & development

View repository

Updated 10-16 01:39

About this skill

DDD Model Review

English version: English

When to Use

  • After tactical modeling is complete, a quality gate check of the overall model is needed.
  • Existing modeling artifacts need comprehensive evaluation (can be used as a standalone entry point).
  • Regular model health checks: the team wants to quantify model quality and identify degradation trends.

Input Requirements

  • Required: At least 3 or more of the following artifacts are needed:
    • Context catalog and glossary (from ddd-contexts)
    • Context relationship matrix (from ddd-context-map)
    • Aggregate catalog and invariants table (from ddd-aggregates)
    • Domain event catalog and service definitions (from ddd-domain-interactions)
  • Optional: Subdomain classification (from ddd-subdomains), event flows (from ddd-discover), scope definitions (from ddd-scope)。

Process

  1. Terminology consistency check: Scan terminology usage across all artifacts, detecting cross-artifact naming conflicts, definition drift, and same name with different meanings.
    • Industry benchmarking (optional but recommended): If the business domain has mature open-source reference implementations (such as Cargo in the logistics domain, Broadleaf in the e-commerce domain, Pyramid in the B2B domain), they should be used as the 9th dimension of comparison reference. List item by item: this model's semantic merge/split deviationsfrom the reference; the reference's proactive identification of known limitations(for example Activity/Status/Event overlap);future domains not modeled but worth considering(for example Billing/Customer/Carrier).
  2. Boundary consistency check: Verify whether aggregate boundaries are consistent with context boundaries—invariants should not cross contexts.
  3. Completeness check: Check whether every event in the event flows has a formal definition in the event catalog; whether every command has a corresponding aggregate handler.
  4. Coupling analysis: Assess the degree of coupling between contexts—dependency direction, amount of shared data, number of synchronous calls.
  5. Scoring: Score the following dimensions from 0-10: terminology consistency, boundary rationality, invariant expression rate, event completeness, coupling degree; if industry benchmarking is enabled, add the "benchmarking deviation" dimension.
  6. Issue list and backtracking triggers: Output discovered issues, impact, evidence, suggested fixes, and generate backtracking instructions according to trigger conditions.

Output

Artifact Structural Requirements
Score Overview Table: dimension (terminology consistency, boundary rationality, invariant expression rate, event completeness, coupling degree), score (0-10), main reasons for deductions
Issue List Table: issue, impact, evidence (cite specific artifacts), suggested fix, priority
Industry Benchmarking Report (only when enabled) Table: comparison item, reference implementation practice, this model's practice, is it merge/split/omission, is it acceptable, recommendation
Backtracking Trigger List Table: trigger condition, backtracking target Skill, description
Implementation Readiness Determination Conclusion: Ready / Not Ready + blocking item list

Validation Checklist

  • Each deduction item provides reviewable evidence (cite specific artifacts and entries)
  • Backtracking trigger conditions are clear and executable
  • Scoring is repeatable (the same input yields the same score)
  • The implementation-readiness determination has clear pass/fail criteria
  • If a recognized open-source reference implementation exists for the business domain, at least one round of benchmarking has been done; the benchmarking conclusions have been captured in the issue list

Backtracking triggers

This Skill is the core trigger of the feedback loop. Based on the evaluation results, trigger the following backtracking:

Trigger condition Backtrack to Description
Contradiction between aggregate boundaries and context boundaries ddd-contexts The context needs to be redivided to accommodate consistency requirements
Terminology conflict rate > 20% ddd-contexts The ubiquitous language definition is insufficient
Invariant expression rate < 60% ddd-aggregates The aggregate may be a data container rather than a behavioral boundary
Integration patterns are inconsistent with the context map ddd-context-map New integration requirements were discovered at the tactical level
Event completeness < 70% ddd-domain-interactions The event catalog is missing or does not cover key processes

Prevent infinite loops: The same backtracking path is executed at most 3 times. If it is still triggered on the 3rd time, mark it as an "architectural decision requiring manual intervention".

Example

@ddd-model-review
请对以下建模工件做全局质量评估:
- 上下文目录:[粘贴]
- 聚合目录:[粘贴]
- 领域事件目录:[粘贴]
- 上下文关系矩阵:[粘贴]
请输出分维度评分、问题清单与回溯建议。