[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M759BY4WM1SWXQN93JKCY4ZN":3,"skill-same:01M759BY4WM1SWXQN93JKCY4ZN":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":44},"01M759BY4WM1SWXQN93JKCY4ZN","3-decompose",null,"DDD loop 2 — decompose: bounded contexts, aggregates, entities, value objects and events, right-sized by sub-domain type; delta-merges on re-run. Writes docs\u002Fdomain\u002F.","baodq97\u002Fgovkit","baodq97","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50482002?v=4","01M759BJ9XC68CW9PQCFK22H1X","Bao Do","01M759BJAY1W696G8A8N841875",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: 3-decompose\ndescription: >\n  DDD loop 2 — decompose: bounded contexts, aggregates, entities, value objects and events, right-sized by sub-domain type; delta-merges on re-run. Writes docs\u002Fdomain\u002F.\ndisable-model-invocation: true\n---\n\n# Domain Decompose\n\nTurn a prose domain\u002Frequirements description into a Domain-Driven Design decomposition — bounded\ncontexts → aggregates → entities, value objects, and domain events — named in the business's\nubiquitous language; each context doubles as a candidate service boundary on the monolith →\nmicroservices path.\n\n**Strategic-then-tactical** and **hybrid**: produce a first-pass model from what you're given,\nthen ask targeted questions only where boundaries or ownership are genuinely ambiguous — don't\nre-ask what the description already settles, and never invent business rules.\n\n## Inputs\n\nA domain description: feature list, PRD, process narrative, key capabilities, actors, notable\nevents. If the user points at code instead, say this skill models from domain knowledge, not\ncode, and ask for a description (or the key capabilities and rules) — reverse-engineering a\ncodebase is out of scope.\n\n**Brownfield** (the model lives only in code, nothing written down): don't reverse it from the\ncode. Ask for a one-page sketch — main capabilities, key events (past-tense things that happen),\nany hard rules — enough for a first-pass model; step 5 refines the rest. If domain docs\u002FPRDs *do*\nexist, step 1 already picks them up.\n\n## Reference files (read as needed)\n\n- `references\u002Fddd-methodology.md` — theory and heuristics behind every step (sub-domain types,\n  boundary heuristics, aggregate\u002Fentity\u002FVO\u002Fevent criteria, naming). Read when a judgement call\n  needs grounding.\n- `references\u002Fbounded-context-canvas.md` — template + guidance for each context's `README.md`.\n- `references\u002Faggregate-design-canvas.md` — template + rules for modelling each aggregate.\n- `references\u002Foutput-template.md` — **the exact output contract** (where to write, file layout,\n  schemas, frontmatter, hard rules). Read before emitting anything.\n\n## Process\n\n### 1. Find & reconcile existing domain artifacts\nBefore modelling, look for existing domain knowledge — re-deriving it wastes effort and risks\ncontradicting what the team already agreed. Look for PRDs, specs, design docs (`docs\u002Fspecs\u002F`,\n`docs\u002F**\u002Fprd\u002F`, anything titled \"… domain model\"), code carrying a domain layer (`*\u002Fdomain\u002F`,\n`*\u002Fports\u002F`), and **this skill's own prior output** in `docs\u002Fdomain\u002F`. Treat any you find as\n**authoritative input**: build on them, preserve their names and stated rules verbatim, reconcile\nrather than re-invent. Prior `docs\u002Fdomain\u002F` output puts you in **update mode** — you're merging a\ndelta, not writing from scratch; step 6 handles it.\n\n**When two sources disagree** — e.g. a *draft* PRD models a `Fact` as `key`\u002F`value` but shipped\ncode uses `content`\u002F`source` — this is the highest-risk moment of the skill. Do **not** blend\ntheir fields into one hybrid that exists in neither source: that is invention disguised as\nreconciliation, the failure to avoid. Prefer the **running\u002Fshipped code** over a draft doc as\nauthoritative, but **always record each divergence explicitly** (source A says X, source B says Y,\nchosen Z, why) in the Conflicts section of `context-map.md` and flag it for a human. Surfacing a\nconflict is mandatory — a silently swallowed conflict is worse than an openly unresolved one.\n\n### 2. Frame the input (event-storming style)\nSkim the description and extract, in business language: **domain events** (past-tense things that\nhappen), the **commands\u002Factors** that cause them, and the recurring **nouns**. Raw material — see\nddd-methodology.md §3. Don't formalize yet.\n\n### 3. First-pass strategic decomposition\n- Group events\u002Fnouns into **bounded contexts** by the boundary heuristics — a boundary is where\n  the *language changes meaning*, cohesion high and coupling low (ddd-methodology.md §2.2, §2.5).\n- Classify each **core \u002F supporting \u002F generic** — core = competitive differentiator; generic =\n  commodity you could buy (§2.1).\n- Sketch **relationships** between contexts (upstream\u002Fdownstream, ACL, shared kernel, etc.).\n- Name the **load-bearing extraction seam** — the boundary that decouples the system most if\n  split first, often a *Published Language* artifact (an exported pack, a contract, a shared\n  document) crossing contexts. State it explicitly and consider elevating it to its own context;\n  it's usually the first service to extract on the monolith→microservices path — don't leave it\n  buried inside a large context.\n- Before finalizing the context list, run the **capability-vs-context test** on every candidate\n  (ddd-methodology.md §2.6): a context must own a domain model with real business invariants. A\n  noun cluster with none — ownership\u002Fpermissions, audit\u002Factivity-history — is a **capability of\n  existing contexts, not a context**; drop it and record it as a declined candidate with the\n  reason, including the **escalation condition** that would promote it (e.g., a regulated domain\n  making audit retention\u002Flegal-hold real invariants).\n\n### 4. First-pass tactical model (per context) — sized to the subdomain type\n**Match tactical depth to each context's subdomain type from step 3 — do not model every context\nthe same way.** Uniform aggregate\u002Fentity\u002Fevent machinery on every context is a cargo-cult smell,\nnot thoroughness: it buries the one or two areas that deserve a rich model under ceremony the\nsupporting, generic, and reference areas never needed.\n\n| Subdomain type | Tactical pattern | Aggregates? |\n|---|---|---|\n| **Core** | Full domain model — aggregates as real consistency boundaries, entities\u002FVOs\u002Fevents, invariants named from the stated rules. | **Yes** — this is where the modelling effort goes. |\n| **Supporting** | A deliberately lighter shape — transaction script \u002F active record \u002F CRUD-plus-a-calculation. Say it is lighter *on purpose*. | **Usually not** — don't impose aggregate ceremony on record-keeping. |\n| **Generic** | Buy or integrate behind a thin adapter. No domain model. | **No.** |\n| **Master-data \u002F reference** | Plain CRUD over lookup records (e.g. countries, currencies, status codes). | **No** — explicitly decline aggregates, repositories, and domain events; note why. |\n\nFor **core** contexts, identify **aggregates** (consistency boundaries) — each with its root\nentity, member **entities** (identity), **value objects** (no identity, equal by value), and the\n**domain events** it emits. Apply the aggregate rules in aggregate-design-canvas.md; name from the\nubiquitous language (see Naming below). A concept with an id, its own lifecycle\u002Fstatus, or\n(brownfield) its own table\u002Frepository is an **entity** even if it looks data-like — don't demote\nan identified concept to a value object.\n\nFor **supporting \u002F generic \u002F master-data** contexts, record the lighter pattern and the reason\n*instead of* forcing aggregates. A `model.yaml` with `aggregates: []` plus a one-line rationale\n(a transaction script, a bought adapter, or plain lookup CRUD) is the correct, complete output for\nthem — an empty aggregate list here is a deliberate right-sizing decision, not a gap.\n\nThen run an **event-flow continuity check**: every emitted domain event should have at least one\nconsumer (a handler\u002Fpolicy in some context), and every cross-context arrow on the map should\ncorrespond to an emitted event. Flag orphan emits and unconsumed events before finalizing — a\ndropped or unconsumed edge is a real modeling bug, not a stylistic gap.\n\n### 5. Ask targeted questions (only where ambiguous)\nSurface the model, then ask **only** about genuine ambiguities — batch them:\n- a term appears to mean different things in two candidate contexts (confirm the split),\n- a context's core\u002Fsupporting\u002Fgeneric classification isn't clear,\n- two pieces of state may need atomic consistency across candidate aggregates,\n- a concept's entity-vs-value-object nature is unstated,\n- an invariant is implied but never stated (ask — do **not** fabricate it).\n\nIf the description already answers something, don't ask. If nothing is ambiguous, skip to step 6.\n\n### 6. Emit the docs (create or delta-merge)\nFollow `references\u002Foutput-template.md` exactly. Detect the project's `docs\u002Fdomain` convention (or\nask if none), then check whether it **already holds generated artifacts** (`DOMAIN-NNNN`\nfrontmatter, `INDEX.md` rows, per-context `model.yaml`):\n\n- **Create mode** (empty\u002Fnew): write `context-map.md` (Mermaid map + sub-domain classification) and, per\n  context, a folder with `README.md` (Bounded Context Canvas) + `model.yaml`. Fresh docs start\n  `status: draft`, `owner: TBD`, with `DOMAIN-NNNN` ids; create `INDEX.md`.\n- **Update mode** (prior output exists): **read it first**, then merge the new model in as a\n  *delta* — same reconcile discipline as step 1, now pointed at your own past output. Reuse each\n  existing context's `DOMAIN-NNNN` id, add\u002Fupdate only what changed, **preserve human edits**\n  (escalated status, assigned owner, hand-written rules), **never delete** a context that's no\n  longer in the model — flag it instead, and record real disagreements in the Conflicts table.\n  Close with a short **changelog** (added \u002F updated \u002F preserved \u002F flagged). The exact merge rules\n  are in output-template.md §\"Delta merge\".\n\nIn `context-map.md` (either mode), **label every cross-context shared artifact with its sharing\nlevel** — Building Blocks \u002F Published Language \u002F Shared Kernel (ddd-methodology.md §2.4) — and\n**flag any shared entity or domain class as Shared Kernel coupling with a stated cost** (mutual-\nconsent change, drift risk), rather than leaving it on the map unlabeled.\n\n## Naming conventions\n\n| Element | Convention | Example |\n|---|---|---|\n| Bounded Context | capability noun | `Booking`, `Inventory` |\n| Aggregate | = its root entity | `Order` |\n| Entity | singular domain noun | `Customer` |\n| Value Object | descriptive noun, no id | `Money`, `DateRange` |\n| Command | imperative | `PlaceOrder` |\n| Domain Event | past tense | `OrderPlaced` |\n\nThe same word in two contexts is kept in both, qualified by context — that polysemy is the\n*point* of bounded contexts, not a naming clash.\n\n## Hard rules\n\n- **Length budget: `context-map.md` ≤ 180 lines**, and the first-pass context `README.md` stays a\n  sketch — `7-define` owns the canvas depth. A budget caps prose, not findings: over it, cut\n  rationale a reader can infer and anything restated from an upstream artifact — never open\n  questions, provenance, or a stated absence.\n- **Never invent business rules, invariants, or domain events.** Capture only what the user\n  stated; flag gaps rather than filling them. Naming an event the prose *implies*\n  (`AppointmentBooked` from \"patients book appointments\") is the job; inventing one for a flow the\n  input never describes (an `AppointmentCancelled` when nothing is ever cancelled) is fabrication —\n  don't. Fresh docs start `status: draft`, `owner: TBD`. In update mode,\n  **preserve** whatever a human set — never reset an escalated status, assigned owner, or\n  hand-written rule back to draft\u002FTBD. Setting status (or reverting it) is a human act, not yours.\n- Model from the **domain description, not code**.\n- **Ownership vs. audit metadata.** Model the *owning party* (user \u002F team \u002F org) as a real domain\n  relationship when the business actually has one — that ownership belongs in the model. But\n  technical audit metadata (`created_at\u002Fby`, `updated_at\u002Fby`) and tenancy isolation columns are\n  infrastructural cross-cutting concerns — do **not** add them to aggregates\u002Fentities here; they are\n  decided and applied in the data layer (the `data-model` skill).\n- Boundaries and aggregates **will change** as understanding deepens — present the model as a\n  draft to iterate, not a final truth.\n\n## Worked example\n\n**Input:** \"Students browse our course catalog and enrol in courses. Enrolment requires payment;\nwe email a receipt and a welcome message. Instructors create and publish courses.\"\n\n**First-pass contexts + classification (`context-map.md`):**\n\n```mermaid\ngraph LR\n  Enrolment -->|downstream of| Catalog\n  Enrolment -->|requests| Payments\n  Enrolment -->|publishes events to| Notifications\n```\n\n| Bounded Context | Sub-domain type | Why |\n|---|---|---|\n| Enrolment | core | the differentiating capability |\n| Catalog | supporting | needed, not differentiating |\n| Payments | generic | commodity — could be outsourced |\n| Notifications | generic | commodity |\n\n**Enrolment context (`docs\u002Fdomain\u002Fenrolment\u002Fmodel.yaml`)** — tactical block (full schema in\noutput-template.md §4):\n\n```yaml\ncontext: Enrolment\nsubdomain_type: core\naggregates:\n  - name: Enrolment\n    root: Enrolment\n    entities:\n      - { name: Enrolment, attributes: [studentId, courseId, status] }\n    value_objects:\n      - { name: Money, attributes: [amount, currency] }\n    domain_events:\n      - { name: EnrolmentRequested, payload: [studentId, courseId] }\n      - { name: EnrolmentConfirmed, payload: [enrolmentId] }\nrelationships:\n  - { to: Payments, type: downstream }\n  - { to: Catalog, type: downstream }\n```\n\nNote what the example does **not** do: it doesn't assert a rule like \"a student may enrol in at\nmost 5 courses\" because the input never said so. If that mattered, the skill would ask.\n","# Domain Decompose\n\nTurn a prose domain\u002Frequirements description into a Domain-Driven Design decomposition — bounded\ncontexts → aggregates → entities, value objects, and domain events — named in the business's\nubiquitous language; each context doubles as a candidate service boundary on the monolith →\nmicroservices path.\n\n**Strategic-then-tactical** and **hybrid**: produce a first-pass model from what you're given,\nthen ask targeted questions only where boundaries or ownership are genuinely ambiguous — don't\nre-ask what the description already settles, and never invent business rules.\n\n## Inputs\n\nA domain description: feature list, PRD, process narrative, key capabilities, actors, notable\nevents. If the user points at code instead, say this skill models from domain knowledge, not\ncode, and ask for a description (or the key capabilities and rules) — reverse-engineering a\ncodebase is out of scope.\n\n**Brownfield** (the model lives only in code, nothing written down): don't reverse it from the\ncode. Ask for a one-page sketch — main capabilities, key events (past-tense things that happen),\nany hard rules — enough for a first-pass model; step 5 refines the rest. If domain docs\u002FPRDs *do*\nexist, step 1 already picks them up.\n\n## Reference files (read as needed)\n\n- `references\u002Fddd-methodology.md` — theory and heuristics behind every step (sub-domain types,\n  boundary heuristics, aggregate\u002Fentity\u002FVO\u002Fevent criteria, naming). Read when a judgement call\n  needs grounding.\n- `references\u002Fbounded-context-canvas.md` — template + guidance for each context's `README.md`.\n- `references\u002Faggregate-design-canvas.md` — template + rules for modelling each aggregate.\n- `references\u002Foutput-template.md` — **the exact output contract** (where to write, file layout,\n  schemas, frontmatter, hard rules). Read before emitting anything.\n\n## Process\n\n### 1. Find & reconcile existing domain artifacts\nBefore modelling, look for existing domain knowledge — re-deriving it wastes effort and risks\ncontradicting what the team already agreed. Look for PRDs, specs, design docs (`docs\u002Fspecs\u002F`,\n`docs\u002F**\u002Fprd\u002F`, anything titled \"… domain model\"), code carrying a domain layer (`*\u002Fdomain\u002F`,\n`*\u002Fports\u002F`), and **this skill's own prior output** in `docs\u002Fdomain\u002F`. Treat any you find as\n**authoritative input**: build on them, preserve their names and stated rules verbatim, reconcile\nrather than re-invent. Prior `docs\u002Fdomain\u002F` output puts you in **update mode** — you're merging a\ndelta, not writing from scratch; step 6 handles it.\n\n**When two sources disagree** — e.g. a *draft* PRD models a `Fact` as `key`\u002F`value` but shipped\ncode uses `content`\u002F`source` — this is the highest-risk moment of the skill. Do **not** blend\ntheir fields into one hybrid that exists in neither source: that is invention disguised as\nreconciliation, the failure to avoid. Prefer the **running\u002Fshipped code** over a draft doc as\nauthoritative, but **always record each divergence explicitly** (source A says X, source B says Y,\nchosen Z, why) in the Conflicts section of `context-map.md` and flag it for a human. Surfacing a\nconflict is mandatory — a silently swallowed conflict is worse than an openly unresolved one.\n\n### 2. Frame the input (event-storming style)\nSkim the description and extract, in business language: **domain events** (past-tense things that\nhappen), the **commands\u002Factors** that cause them, and the recurring **nouns**. Raw material — see\nddd-methodology.md §3. Don't formalize yet.\n\n### 3. First-pass strategic decomposition\n- Group events\u002Fnouns into **bounded contexts** by the boundary heuristics — a boundary is where\n  the *language changes meaning*, cohesion high and coupling low (ddd-methodology.md §2.2, §2.5).\n- Classify each **core \u002F supporting \u002F generic** — core = competitive differentiator; generic =\n  commodity you could buy (§2.1).\n- Sketch **relationships** between contexts (upstream\u002Fdownstream, ACL, shared kernel, etc.).\n- Name the **load-bearing extraction seam** — the boundary that decouples the system most if\n  split first, often a *Published Language* artifact (an exported pack, a contract, a shared\n  document) crossing contexts. State it explicitly and consider elevating it to its own context;\n  it's usually the first service to extract on the monolith→microservices path — don't leave it\n  buried inside a large context.\n- Before finalizing the context list, run the **capability-vs-context test** on every candidate\n  (ddd-methodology.md §2.6): a context must own a domain model with real business invariants. A\n  noun cluster with none — ownership\u002Fpermissions, audit\u002Factivity-history — is a **capability of\n  existing contexts, not a context**; drop it and record it as a declined candidate with the\n  reason, including the **escalation condition** that would promote it (e.g., a regulated domain\n  making audit retention\u002Flegal-hold real invariants).\n\n### 4. First-pass tactical model (per context) — sized to the subdomain type\n**Match tactical depth to each context's subdomain type from step 3 — do not model every context\nthe same way.** Uniform aggregate\u002Fentity\u002Fevent machinery on every context is a cargo-cult smell,\nnot thoroughness: it buries the one or two areas that deserve a rich model under ceremony the\nsupporting, generic, and reference areas never needed.\n\n| Subdomain type | Tactical pattern | Aggregates? |\n|---|---|---|\n| **Core** | Full domain model — aggregates as real consistency boundaries, entities\u002FVOs\u002Fevents, invariants named from the stated rules. | **Yes** — this is where the modelling effort goes. |\n| **Supporting** | A deliberately lighter shape — transaction script \u002F active record \u002F CRUD-plus-a-calculation. Say it is lighter *on purpose*. | **Usually not** — don't impose aggregate ceremony on record-keeping. |\n| **Generic** | Buy or integrate behind a thin adapter. No domain model. | **No.** |\n| **Master-data \u002F reference** | Plain CRUD over lookup records (e.g. countries, currencies, status codes). | **No** — explicitly decline aggregates, repositories, and domain events; note why. |\n\nFor **core** contexts, identify **aggregates** (consistency boundaries) — each with its root\nentity, member **entities** (identity), **value objects** (no identity, equal by value), and the\n**domain events** it emits. Apply the aggregate rules in aggregate-design-canvas.md; name from the\nubiquitous language (see Naming below). A concept with an id, its own lifecycle\u002Fstatus, or\n(brownfield) its own table\u002Frepository is an **entity** even if it looks data-like — don't demote\nan identified concept to a value object.\n\nFor **supporting \u002F generic \u002F master-data** contexts, record the lighter pattern and the reason\n*instead of* forcing aggregates. A `model.yaml` with `aggregates: []` plus a one-line rationale\n(a transaction script, a bought adapter, or plain lookup CRUD) is the correct, complete output for\nthem — an empty aggregate list here is a deliberate right-sizing decision, not a gap.\n\nThen run an **event-flow continuity check**: every emitted domain event should have at least one\nconsumer (a handler\u002Fpolicy in some context), and every cross-context arrow on the map should\ncorrespond to an emitted event. Flag orphan emits and unconsumed events before finalizing — a\ndropped or unconsumed edge is a real modeling bug, not a stylistic gap.\n\n### 5. Ask targeted questions (only where ambiguous)\nSurface the model, then ask **only** about genuine ambiguities — batch them:\n- a term appears to mean different things in two candidate contexts (confirm the split),\n- a context's core\u002Fsupporting\u002Fgeneric classification isn't clear,\n- two pieces of state may need atomic consistency across candidate aggregates,\n- a concept's entity-vs-value-object nature is unstated,\n- an invariant is implied but never stated (ask — do **not** fabricate it).\n\nIf the description already answers something, don't ask. If nothing is ambiguous, skip to step 6.\n\n### 6. Emit the docs (create or delta-merge)\nFollow `references\u002Foutput-template.md` exactly. Detect the project's `docs\u002Fdomain` convention (or\nask if none), then check whether it **already holds generated artifacts** (`DOMAIN-NNNN`\nfrontmatter, `INDEX.md` rows, per-context `model.yaml`):\n\n- **Create mode** (empty\u002Fnew): write `context-map.md` (Mermaid map + sub-domain classification) and, per\n  context, a folder with `README.md` (Bounded Context Canvas) + `model.yaml`. Fresh docs start\n  `status: draft`, `owner: TBD`, with `DOMAIN-NNNN` ids; create `INDEX.md`.\n- **Update mode** (prior output exists): **read it first**, then merge the new model in as a\n  *delta* — same reconcile discipline as step 1, now pointed at your own past output. Reuse each\n  existing context's `DOMAIN-NNNN` id, add\u002Fupdate only what changed, **preserve human edits**\n  (escalated status, assigned owner, hand-written rules), **never delete** a context that's no\n  longer in the model — flag it instead, and record real disagreements in the Conflicts table.\n  Close with a short **changelog** (added \u002F updated \u002F preserved \u002F flagged). The exact merge rules\n  are in output-template.md §\"Delta merge\".\n\nIn `context-map.md` (either mode), **label every cross-context shared artifact with its sharing\nlevel** — Building Blocks \u002F Published Language \u002F Shared Kernel (ddd-methodology.md §2.4) — and\n**flag any shared entity or domain class as Shared Kernel coupling with a stated cost** (mutual-\nconsent change, drift risk), rather than leaving it on the map unlabeled.\n\n## Naming conventions\n\n| Element | Convention | Example |\n|---|---|---|\n| Bounded Context | capability noun | `Booking`, `Inventory` |\n| Aggregate | = its root entity | `Order` |\n| Entity | singular domain noun | `Customer` |\n| Value Object | descriptive noun, no id | `Money`, `DateRange` |\n| Command | imperative | `PlaceOrder` |\n| Domain Event | past tense | `OrderPlaced` |\n\nThe same word in two contexts is kept in both, qualified by context — that polysemy is the\n*point* of bounded contexts, not a naming clash.\n\n## Hard rules\n\n- **Length budget: `context-map.md` ≤ 180 lines**, and the first-pass context `README.md` stays a\n  sketch — `7-define` owns the canvas depth. A budget caps prose, not findings: over it, cut\n  rationale a reader can infer and anything restated from an upstream artifact — never open\n  questions, provenance, or a stated absence.\n- **Never invent business rules, invariants, or domain events.** Capture only what the user\n  stated; flag gaps rather than filling them. Naming an event the prose *implies*\n  (`AppointmentBooked` from \"patients book appointments\") is the job; inventing one for a flow the\n  input never describes (an `AppointmentCancelled` when nothing is ever cancelled) is fabrication —\n  don't. Fresh docs start `status: draft`, `owner: TBD`. In update mode,\n  **preserve** whatever a human set — never reset an escalated status, assigned owner, or\n  hand-written rule back to draft\u002FTBD. Setting status (or reverting it) is a human act, not yours.\n- Model from the **domain description, not code**.\n- **Ownership vs. audit metadata.** Model the *owning party* (user \u002F team \u002F org) as a real domain\n  relationship when the business actually has one — that ownership belongs in the model. But\n  technical audit metadata (`created_at\u002Fby`, `updated_at\u002Fby`) and tenancy isolation columns are\n  infrastructural cross-cutting concerns — do **not** add them to aggregates\u002Fentities here; they are\n  decided and applied in the data layer (the `data-model` skill).\n- Boundaries and aggregates **will change** as understanding deepens — present the model as a\n  draft to iterate, not a final truth.\n\n## Worked example\n\n**Input:** \"Students browse our course catalog and enrol in courses. Enrolment requires payment;\nwe email a receipt and a welcome message. Instructors create and publish courses.\"\n\n**First-pass contexts + classification (`context-map.md`):**\n\n```mermaid\ngraph LR\n  Enrolment -->|downstream of| Catalog\n  Enrolment -->|requests| Payments\n  Enrolment -->|publishes events to| Notifications\n```\n\n| Bounded Context | Sub-domain type | Why |\n|---|---|---|\n| Enrolment | core | the differentiating capability |\n| Catalog | supporting | needed, not differentiating |\n| Payments | generic | commodity — could be outsourced |\n| Notifications | generic | commodity |\n\n**Enrolment context (`docs\u002Fdomain\u002Fenrolment\u002Fmodel.yaml`)** — tactical block (full schema in\noutput-template.md §4):\n\n```yaml\ncontext: Enrolment\nsubdomain_type: core\naggregates:\n  - name: Enrolment\n    root: Enrolment\n    entities:\n      - { name: Enrolment, attributes: [studentId, courseId, status] }\n    value_objects:\n      - { name: Money, attributes: [amount, currency] }\n    domain_events:\n      - { name: EnrolmentRequested, payload: [studentId, courseId] }\n      - { name: EnrolmentConfirmed, payload: [enrolmentId] }\nrelationships:\n  - { to: Payments, type: downstream }\n  - { to: Catalog, type: downstream }\n```\n\nNote what the example does **not** do: it doesn't assert a rule like \"a student may enrol in at\nmost 5 courses\" because the input never said so. If that mattered, the skill would ask.\n",{"name":5,"description":24,"disable-model-invocation":25},"DDD loop 2 — decompose: bounded contexts, aggregates, entities, value objects and events, right-sized by sub-domain type; delta-merges on re-run. Writes docs\u002Fdomain\u002F.\n",true,"main","850634e254ea6a5034bf2eddad5fe95091713231","docs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit","https:\u002F\u002Fgithub.com\u002Fbaodq97","2026-09-07 14:26:00",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":25},[34,37,40],{"tool":35,"command":36},"npx","npx skills add baodq97\u002Fgovkit --skill 3-decompose",{"tool":38,"command":39},"bunx","bunx skills add baodq97\u002Fgovkit --skill 3-decompose",{"tool":41,"command":42},"pnpm","pnpm dlx skills add baodq97\u002Fgovkit --skill 3-decompose","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002FSKILL.md",[45,51,55,59],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Faggregate-design-canvas.md","REFERENCE","参考文档",3762,"https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002Freferences\u002Faggregate-design-canvas.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fbounded-context-canvas.md",1732,"https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002Freferences\u002Fbounded-context-canvas.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fddd-methodology.md",13999,"https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002Freferences\u002Fddd-methodology.md",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Foutput-template.md",9527,"https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fdocs\u002Fresearch\u002Fddd-skill-evals\u002Fskill-snapshot-pre-context-pack\u002F3-decompose\u002Freferences\u002Foutput-template.md",[64,71,78,85,92,98],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M759HTCHQJVZ4JWDA2JNPJJZ","trigger-shaped","Use when the user says \"plan a sprint retro\"; drafts retro\u002Fnotes.md for the team.","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fskill-lint\u002Ftriggering\u002Fskills\u002Ftrigger-shaped\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M759HS3E2T97ZN1ED2Z96WAJ","terse-unguarded","Step 2 — writes docs\u002Fx\u002Foutput.json quietly.","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fskill-lint\u002Ftriggering\u002Fskills\u002Fterse-unguarded\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M759HPZN28VZHKYFR754CVXT","guarded","Summarizes ledger totals into reports\u002Fmonthly.csv.","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fskill-lint\u002Ftriggering\u002Fskills\u002Fguarded\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M759HMFQAZAWFVSS3KWPCCW0","open","Draft a spec. Use when asked to \"draft a spec\" or \"write the RFC\".","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fskill-lint\u002Fdead-hint\u002Fskills\u002Fopen\u002FSKILL.md",[],[],{"skillNo":93,"name":80,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M759HJ3XX74S70PW9AR8NS66","Deploy the thing.","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fscripts\u002Ffixtures\u002Fskill-lint\u002Fdead-hint\u002Fskills\u002Fguarded\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M759HCWJN9ACRNC1JW76DR1E","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\u002FA escape valve so a strong model pays near-zero overhead.","https:\u002F\u002Fgithub.com\u002Fbaodq97\u002Fgovkit\u002Fblob\u002Fmain\u002Fplugins\u002Fswe-flow\u002Fskills\u002Fworking-discipline\u002FSKILL.md",[],[]]