flowchart LR
A[OrderHandler] --> B[OrderValidator]
B --> C[OrderRepo]
C -.leak.-> D[PricingClient]
classDef leak stroke:#dc2626,stroke-width:2px;
class C,D leak
`;arrows 用绝对定位在 relative container 上的 inline SVG `` 或 ``。当你希望 "after" diagram 像一个 thick-bordered 的 deep module、internals 灰显时,就用这种方式:Mermaid 无法以合适的视觉分量渲染出那种效果。
### 横截面(适合 layered shallowness)
用水平 bands(`h-12 border-l-4`)展示一个 call 穿过的 layers。Before:6 个薄 layers,每个几乎不做事。After:1 个厚 band,标注 consolidated responsibility。
### 体量图(适合表达 "interface as wide as implementation")
每个 module 两个 rectangles:一个代表 interface surface area,一个代表 implementation。Before:interface rectangle 几乎和 implementation rectangle 一样高(shallow)。After:interface rectangle 矮,implementation rectangle 高(deep)。
### 调用图收拢
Before:把 function calls tree 渲染为 nested boxes。After:把同一棵 tree collapse 成一个 box,内部 calls 以 faded 状态显示。
## 样式指南
- Lean editorial,不要 corporate-dashboard。留足 whitespace。Headings 可选 serif(`font-serif` 与 stone/slate 很搭)。
- 谨慎用色:一个 accent(emerald 或 indigo),red 用于 leakage,amber 用于 warnings。
- Diagrams 保持约 320px 高,让 before/after 并排时不需要滚动。
- Diagram 内 module labels 使用 `text-xs uppercase tracking-wider`;它们应像 schematic,不像 UI。
- 唯一脚本是 Tailwind CDN 和 Mermaid ESM import。除此之外 report 是 static;不要 app code,不要 Mermaid 自身渲染以外的 interactivity。
## 首选推荐区
一个更大的 card。Candidate name、一句话说明为什么、指向该 card 的 anchor link。仅此而已。
## 语气
平实的语言,简洁;但 architectural nouns 和 verbs 必须来自 `/codebase-design` skill。简洁不是术语漂移的借口。
**Use exactly:** module, interface, implementation, depth, deep, shallow, seam, adapter, leverage, locality.
**Never substitute:** component, service, unit(当你指 module 时);API, signature(当你指 interface 时);boundary(当你指 seam 时);layer, wrapper(当你指 module 时)。
合适的措辞:
- "Order intake module is shallow - interface nearly matches the implementation."
- "Pricing leaks across the seam."
- "Deepen: one interface, one place to test."
- "Two adapters justify the seam: HTTP in prod, in-memory in tests."
**Wins bullets** 要用 glossary terms 命名收益:*"locality: bugs concentrate in one module"*、*"leverage: one interface, N call sites"*、*"interface shrinks; implementation absorbs the wrappers"*。不要写 *"easier to maintain"* 或 *"cleaner code"*;这些词不在 glossary 中,不能挣到自己的位置。
不要 hedging,不要 throat-clearing,不要 "it's worth noting that..."。一句话如果能变 bullet,就变 bullet。一个 bullet 如果能删,就删。一个 term 不在 `/codebase-design` glossary 中,就先找 glossary 里的词,而不是发明新词。