ddd-strategic-design — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ddd-strategic-design (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
# 检测当前项目信息
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "unknown")
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
echo "PROJECT: $PROJECT_ROOT"
echo "BRANCH: $BRANCH"
echo "COMMIT: $COMMIT"benefits-from 检查(推荐但非必须):
# 检查 goal-oriented 工件
GOAL_ARTIFACT="memory/artifacts/goal-oriented/latest.json"
if [ -f "$GOAL_ARTIFACT" ]; then
echo "FOUND: goal-oriented artifact"
# 提取目标信息,确保设计符合目标
fi
# 检查 first-principles 工件
FP_ARTIFACT="memory/artifacts/first-principles/latest.json"
if [ -f "$FP_ARTIFACT" ]; then
echo "FOUND: first-principles artifact"
# 提取第一性原理分析结果,用于指导设计
fi工件目录初始化:
# 确保工件目录存在
mkdir -p memory/artifacts/ddd-strategic根据用户消息判断:
检查点:
意图分类:
Strategic design focuses on defining bounded contexts and their relationships. A bounded context is a boundary within which a domain model is defined and applicable. Inside the boundary, all terms, rules, and logic have a specific, consistent meaning. Different contexts may use the same terms with different meanings.
Why it matters: Without clear boundaries, teams talk past each other. "Customer" means something different to Sales vs Support vs Billing. Strategic design makes these boundaries explicit.
Core principle: Language consistency within a boundary, explicit translation between boundaries.
Tactical design happens within each bounded context. See ddd-tactical-design skill for implementation details.
Applicable:
Not applicable:
digraph strategic_design {
rankdir=TB;
"Event Storming" [shape=box, style=filled, fillcolor="#c8e6c9"];
"Identify Bounded Contexts" [shape=box, style=filled, fillcolor="#bbdefb"];
"Define Context Map" [shape=box, style=filled, fillcolor="#fff9c4"];
"Architecture Decisions" [shape=box, style=filled, fillcolor="#f8bbd0"];
"保存工件" [shape=box, style=filled, fillcolor="#81c784"];
"Event Storming" -> "Identify Bounded Contexts";
"Identify Bounded Contexts" -> "Define Context Map";
"Define Context Map" -> "Architecture Decisions";
"Architecture Decisions" -> "保存工件";
}Gather domain experts and developers. Use sticky notes to explore the domain:
Domain Events (orange): Something that happened
Commands (blue): What triggers events
Aggregates (yellow): What handles commands and emits events
External Systems (pink): Outside dependencies
Actors (green): Who initiates commands
Process: Start with events, work backward to commands, identify what's needed.
Group related events, commands, and aggregates into contexts:
Principles:
Questions to ask:
Start coarse, refine later. Too many contexts = integration complexity. Too few = coupling.
Document relationships between contexts:
| Pattern | Description | When to Use |
|---|---|---|
| Partnership | Teams succeed or fail together | Tight coordination needed |
| Customer-Supplier | Downstream depends on upstream | Upstream serves downstream needs |
| Conformist | Downstream conforms to upstream | Upstream cannot be influenced |
| Anti-Corruption Layer | Downstream translates upstream model | Protect domain model purity |
| Open Host Service | Publish API for multiple consumers | Shared capability |
| Shared Kernel | Shared subset of model | Carefully controlled coupling |
Draw the map: Which contexts talk to each other? What patterns apply?
Based on context map, decide:
Use this table during Event Storming:
| Question | What to Look For | Example |
|---|---|---|
| What events? | Business-critical things that happened | "OrderPlaced", "PaymentFailed" |
| What triggers events? | Commands from users or systems | "PlaceOrder", "RetryPayment" |
| What boundaries? | Where language changes | Sales "Customer" ≠ Support "Customer" |
| Who owns what? | Team responsibility boundaries | Team A: Orders, Team B: Inventory |
| How do they communicate? | Sync vs async, contracts | Events for loose coupling, RPC for tight |
Bounded Context Checklist:
Event Storming reveals:
Bounded Contexts identified:
Context Map:
Architecture: Start as modular monolith. Deploy as microservices if teams scale.
Bounded Contexts:
Context Map:
Mistake: Creating a context for every aggregate or entity.
Problem: Excessive integration complexity. Every change touches multiple contexts.
Solution: Start with fewer, larger contexts. Split only when you feel coupling pain.
Rule of thumb: Can you deploy this independently without coordinating with 3+ other teams? If no, merge contexts.
Mistake: Designing contexts based on domain purity, ignoring Conway's Law.
Problem: One team owns multiple contexts → coupling. Multiple teams own one context → conflict.
Solution: Align context boundaries with team boundaries. One team, one context.
Mistake: Letting upstream context's model leak into downstream context.
Problem: Downstream model becomes polluted with concepts that don't fit its domain.
Solution: Add Anti-Corruption Layer. Translate upstream model to downstream model at the boundary.
Example: External "User" → ACL translates → Internal "AccountHolder" with different attributes.
保存战略设计结果到工件文件:
# 生成工件文件名
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
ARTIFACT_FILE="memory/artifacts/ddd-strategic/result-$TIMESTAMP.json"
# 写入工件
cat > "$ARTIFACT_FILE" <<EOF
{
"skill": "ddd-strategic-design",
"version": "2.0.0",
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"project": "$PROJECT_ROOT",
"branch": "$BRANCH",
"commit": "$COMMIT",
"input": {
"user_request": "用户的原始请求"
},
"output": {
"bounded_contexts": [
{
"name": "上下文名称",
"language": ["术语1", "术语2"],
"team": "团队名称",
"events": ["Event1", "Event2"]
}
],
"context_map": {
"Order → Inventory": "Customer-Supplier",
"Order → Payment": "Customer-Supplier"
},
"architecture_decisions": [
"Start as modular monolith",
"Deploy as microservices when teams scale"
]
},
"next_skills": [
"ddd-tactical-design",
"mvp-first"
]
}
EOF
echo "ARTIFACT SAVED: $ARTIFACT_FILE"
# 创建 latest.json 符号链接
ln -sf "$ARTIFACT_FILE" memory/artifacts/ddd-strategic/latest.json如果存在目标文件,记录设计完成:
# 检查是否有 pending 目标
GOAL_FILE=$(ls -t memory/goals/*.md 2>/dev/null | head -1)
if [ -n "$GOAL_FILE" ]; then
GOAL_STATUS=$(grep "状态:" "$GOAL_FILE" | awk '{print $2}')
if [ "$GOAL_STATUS" = "pending" ]; then
echo "Adding milestone: DDD 战略设计完成"
# 使用 Edit 工具添加里程碑
fi
fi根据设计结果,推荐后续技能:
推荐格式:
## 后续建议
基于 DDD 战略设计结果,建议继续执行:
**推荐技能链**:
1. /ddd-tactical-design - 在限界上下文内进行战术设计
2. /mvp-first - 进行 MVP 功能筛选
**根据设计阶段选择**:
- **战术实现** → /ddd-tactical-design(设计聚合、实体、值对象)
- **功能规划** → /mvp-first(筛选 MVP 功能)
- **迭代执行** → /pdca-cycle(进入 PDCA 循环)
是否继续执行?
- A) 执行推荐的技能链
- B) 只执行第一个技能
- C) 不继续,结束当前任务~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.