8-code
Event-model each use case into slices, then author one aggregate design canvas per aggregate the slices touch — deciding what stays consistent inside one transaction and what is repaired afterwards. Use whenever a context has a defined canvas and a first-pass model.yaml and needs its aggregates designed, invariants and corrective policies pinned, or throughput/size re-checked against a boundary — invoked by ddd-flow:design or directly. The last modelling step before the model becomes code; not for writing the implementation.
- License 许可
- MIT
- 所属仓库
- baodq97/govkit
- 最近更新
- 2026-09-07
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- 8-code
- paths
- docs/domain/**
- description
- Event-model each use case into slices, then author one aggregate design canvas per aggregate the slices touch — deciding what stays consistent inside one transaction and what is repaired afterwards. Use whenever a context has a defined canvas and a first-pass model.yaml and needs its aggregates designed, invariants and corrective policies pinned, or throughput/size re-checked against a boundary — invoked by ddd-flow:design or directly. The last modelling step before the model becomes code; not for writing the implementation.
02 资源文件 4
- 参考文档references/aggregate-design-canvas.md13.7 KB
- 参考文档references/code-structure.md5.7 KB
- 参考文档references/event-modeling.md5.1 KB
- 参考文档references/worked-example.md2.4 KB
03 SKILL.md 正文
Code — what stays consistent in one transaction, and what gets repaired afterwards?
You already know event modelling, the aggregate design canvas, and the invariant-versus-corrective- policy trade-off. This skill does not re-teach that — it gives only what a strong model gets wrong by default here, plus the exact output contract the gate parses.
Step 0 — load the law
Read ../../references/RULES.md (the shared ddd-flow rules). The Aggregates, Right-size,
and Boundaries sections govern this step (with the [8]-tagged Grounding and Honesty
rules). They are the rules, not the method — do not proceed without them.
Consumes → produces
- Read:
docs/domain/<context>/README.md(the context canvas — purpose, business decisions, quality attributes),docs/domain/<context>/model.yaml(first-pass aggregates/entities/VOs/events), anddocs/domain/message-flows/(which commands cross in, and the throughput/client inputs). - Write: one
docs/domain/<context>/aggregates/<Name>.mdcanvas per aggregate the slices touch (the gate's evidence); optionally the phase-1event-model/README.mdand thecode-structure.mdstructural contract.
Output contract (what the gate parses — obey exactly)
Author every canvas to the aggregate-canvas shape in ../../references/artifact-shapes.md. Obey
the budgets (aggregate canvas ≤150, event-model/README.md ≤200, code-structure.md ≤120) and the
one marker the gate parses: any relax / eventual / not enforced wording MUST be met by a
## Corrective policies section (check 10 relaxed-without-policy, HIGH).
The one rule most often broken (echoed for salience; full set in RULES.md)
Never invent an invariant. Take invariants only from stated business rules — inferring "an invoice must have at least one line" because it sounds right manufactures a constraint the business never asked for, and unlike a missing rule a fabricated one is enforced by the code and discovered by a customer.
Done
Run ddd_check (grounding + structure gate); resolve blocking gaps; keep open_questions populated
honestly. Where a canvas contradicts model.yaml, propose the delta — 3-decompose owns that
file, never hand-edit it here. Design stops at the structural contract — no skeleton classes.
04 同仓库更多 Skills
trigger-shaped
Use when the user says "plan a sprint retro"; drafts retro/notes.md for the team.
terse-unguarded
Step 2 — writes docs/x/output.json quietly.
guarded
Summarizes ledger totals into reports/monthly.csv.
open
Draft a spec. Use when asked to "draft a spec" or "write the RFC".
guarded
Deploy the thing.
working-discipline
Thinking-checkpoint discipline for substantive implementation, debugging, or autonomous work — 21 trigger-gated items (trigger → mandatory question → evidence to produce) that cut agent error and human escalation. Use before an autonomous or long-running run, when asked to "work carefully", "double-check", "làm cẩn thận", "reduce errors", "be more autonomous", or after looping twice on the same failing fix. NOT a procedure — checkpoints fire on their triggers and demand evidence, with an N/A escape valve so a strong model pays near-zero overhead.