{"slug":"domain-modeling-3","title":"domain-modeling","summary":"Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-17T16:53:07.923738Z","repo":{"url":"https://github.com/KongFangXun/sofagent","stars":49,"forks":9,"license":"MIT","updatedAt":"2026-09-24T19:13:19Z"},"bodyHtml":"<hr>\n<h2>name: domain-modeling\ndescription: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.</h2>\n<h1>Domain Modeling</h1>\n<p>Actively build and sharpen the project's domain model as you design. This is the <em>active</em> discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely <em>reading</em> <code>CONTEXT.md</code> for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)</p>\n<h2>File structure</h2>\n<p>Most repos have a single context:</p>\n<pre><code>/\n├── CONTEXT.md\n├── docs/\n│   └── adr/\n│       ├── 0001-event-sourced-orders.md\n│       └── 0002-postgres-for-write-model.md\n└── src/\n</code></pre>\n<p>If a <code>CONTEXT-MAP.md</code> exists at the root, the repo has multiple contexts. The map points to where each one lives:</p>\n<pre><code>/\n├── CONTEXT-MAP.md\n├── docs/\n│   └── adr/                          ← system-wide decisions\n├── src/\n│   ├── ordering/\n│   │   ├── CONTEXT.md\n│   │   └── docs/adr/                 ← context-specific decisions\n│   └── billing/\n│       ├── CONTEXT.md\n│       └── docs/adr/\n</code></pre>\n<p>Create files lazily: only when you have something to write. If no <code>CONTEXT.md</code> exists, create one when the first term is resolved. If no <code>docs/adr/</code> exists, create it when the first ADR is needed.</p>\n<h2>During the session</h2>\n<h3>Challenge against the glossary</h3>\n<p>When the user uses a term that conflicts with the existing language in <code>CONTEXT.md</code>, call it out immediately. \"Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?\"</p>\n<h3>Sharpen fuzzy language</h3>\n<p>When the user uses vague or overloaded terms, propose a precise canonical term. \"You're saying 'account': do you mean the Customer or the User? Those are different things.\"</p>\n<h3>Discuss concrete scenarios</h3>\n<p>When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.</p>\n<h3>Cross-reference with code</h3>\n<p>When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: \"Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?\"</p>\n<h3>Update CONTEXT.md inline</h3>\n<p>When a term is resolved, update <code>CONTEXT.md</code> right there. Don't batch these up: capture them as they happen. Use the format in <a href=\"./CONTEXT-FORMAT.md\">CONTEXT-FORMAT.md</a>.</p>\n<p><code>CONTEXT.md</code> should be totally devoid of implementation details. Do not treat <code>CONTEXT.md</code> as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.</p>\n<h3>Offer ADRs sparingly</h3>\n<p>Only offer to create an ADR when all three are true:</p>\n<ol>\n<li><strong>Hard to reverse</strong>: the cost of changing your mind later is meaningful</li>\n<li><strong>Surprising without context</strong>: a future reader will wonder \"why did they do it this way?\"</li>\n<li><strong>The result of a real trade-off</strong>: there were genuine alternatives and you picked one for specific reasons</li>\n</ol>\n<p>If any of the three is missing, skip the ADR. Use the format in <a href=\"./ADR-FORMAT.md\">ADR-FORMAT.md</a>.</p>\n","files":[{"path":"ADR-FORMAT.md","sizeBytes":2733,"isText":true},{"path":"CONTEXT-FORMAT.md","sizeBytes":2290,"isText":true},{"path":"SKILL.md","sizeBytes":3331,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-17T16:53:36.323228Z","sha256":"9D99BED5A1175B9ED7F16920C9877B5535E1A987BC148F3BFA1C891104756C87","sizeBytes":4361},"review":null,"source":{"repositoryUrl":"https://github.com/KongFangXun/sofagent","path":"playbook/vendor/improve-codebase-architecture/upstream/domain-modeling","license":"MIT","commit":"b8c903249bf3060a4593f983647790a80479b6d3","subtreeSha":"ABD162F8B8F0FA5F8B28FE56EA2D75854AA951983B9BECFE4B4AE4042A1E88A8","lastSyncedAt":"2026-09-25T07:38:23.905161Z"},"reviewedAt":"2026-09-17T16:54:14.339935Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/KongFangXun/sofagent/tree/main/playbook/vendor/improve-codebase-architecture/upstream/domain-modeling"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kongfangxun-sofagent@llmmart"},{"target":"git","command":"git clone https://github.com/KongFangXun/sofagent.git"}]}