[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C4KC7FAVZXC4N0F4MG7MCZ":3,"skill-same:01M6C4KC7FAVZXC4N0F4MG7MCZ":64},{"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":22,"linkOnly":23,"markdownContent":24,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M6C4KC7FAVZXC4N0F4MG7MCZ","principle-model-the-domain",null,"WHEN invalid states or repeated domain rules complicate logic; NOT clear local transformations; represent invariants and ownership directly.","mintuz\u002Fskills","mintuz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F447031?v=4","01M6BVWJYSVR4XQC9AQCEMWQRG","Adam Bulmer","01M6C4DCXKNYZB281YB3PZDJJG",35,"MIT","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fprinciple\u002Fskills\u002Fprinciple-model-the-domain\u002FSKILL.md",[],[19,20,21],"principle model the domain","model","Rules","2026-11-10 10:12:30",false,"---\nname: principle-model-the-domain\ndescription: \"WHEN invalid states or repeated domain rules complicate logic; NOT clear local transformations; represent invariants and ownership directly.\"\n---\n\n# Model The Domain\n\nRepresent legal states, transitions and ownership directly, so invalid states and scattered rules have nowhere to live.\n\nIdentify legal states, forbidden combinations, transitions, ownership and access patterns. Choose the smallest structure that expresses them: variants for alternatives, a transition model for lifecycle, a map for keyed lookup, a queue for ordered work.\n\nCarry required data with its state: pending, failed(error), complete(receipt). Centralise transition rules instead of synchronising flags across consumers. Group repeated domain knowledge under one owner; execution phases alone do not define ownership.\n\nParse or migrate persisted and external representations into the model. Types cannot retroactively make stored invalid states valid.\n\nVerify allowed and rejected transitions through the public behaviour, including restoration and failure. Keep boring local code when a proposed abstraction removes no invalid state, repeated rule or lifecycle risk. No framework is required.\n\nDistinct from: `principle-type-system-discipline` (making the compiler enforce distinctions the model already names), `principle-parse-at-the-boundary` (untrusted or persisted data enters and must be validated), `principle-derive-from-one-owner` (one fact computed or stored in two places).\n\nDone: each state carries its data; transitions are centralised; allowed and rejected transitions are tested.\n","# Model The Domain\n\nRepresent legal states, transitions and ownership directly, so invalid states and scattered rules have nowhere to live.\n\nIdentify legal states, forbidden combinations, transitions, ownership and access patterns. Choose the smallest structure that expresses them: variants for alternatives, a transition model for lifecycle, a map for keyed lookup, a queue for ordered work.\n\nCarry required data with its state: pending, failed(error), complete(receipt). Centralise transition rules instead of synchronising flags across consumers. Group repeated domain knowledge under one owner; execution phases alone do not define ownership.\n\nParse or migrate persisted and external representations into the model. Types cannot retroactively make stored invalid states valid.\n\nVerify allowed and rejected transitions through the public behaviour, including restoration and failure. Keep boring local code when a proposed abstraction removes no invalid state, repeated rule or lifecycle risk. No framework is required.\n\nDistinct from: `principle-type-system-discipline` (making the compiler enforce distinctions the model already names), `principle-parse-at-the-boundary` (untrusted or persisted data enters and must be validated), `principle-derive-from-one-owner` (one fact computed or stored in two places).\n\nDone: each state carries its data; transitions are centralised; allowed and rejected transitions are tested.\n",{"name":5,"description":7},"main","4e0a12b5048eac78a3ace4feee657873cdd530ef","src\u002Fprinciple\u002Fskills\u002Fprinciple-model-the-domain",7,"https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills","https:\u002F\u002Fgithub.com\u002Fmintuz","http:\u002F\u002Fwww.mintuz.com","Working at @monzo, Previously worked at Moonpig, @booking and @bbc","2026-11-13 19:21:11",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add mintuz\u002Fskills --skill principle-model-the-domain",{"tool":42,"command":43},"bunx","bunx skills add mintuz\u002Fskills --skill principle-model-the-domain",{"tool":45,"command":46},"pnpm","pnpm dlx skills add mintuz\u002Fskills --skill principle-model-the-domain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fprinciple\u002Fskills\u002Fprinciple-model-the-domain\u002FSKILL.md",true,[50,56,60],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"manifest.json","REFERENCE","参考文档",49,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FPlatform\u002FLegacy-ASP.NET\u002Fskills\u002Flegacy-aspnet\u002Fmanifest.json",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fmigration.md",6665,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FPlatform\u002FLegacy-ASP.NET\u002Fskills\u002Flegacy-aspnet\u002Freferences\u002Fmigration.md",{"path":61,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fpatterns.md",12871,"https:\u002F\u002Fgithub.com\u002Fmanagedcode\u002Fdotnet-skills\u002Fblob\u002Fmain\u002Fcatalog\u002FPlatform\u002FLegacy-ASP.NET\u002Fskills\u002Flegacy-aspnet\u002Freferences\u002Fpatterns.md",[65,88,111,124,145,162],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":79,"publishedAt":22},"01M6C4PDGB6ZZWBS35N3DF7PZZ","xstate","WHEN React state changes in response to an external answer — async submit, in-flight or loading flags, retries, cancellation, polling, optimistic updates, stale responses — or to an interaction with an interruptible middle, such as a drag or a gesture; or WHEN building, reviewing, testing, or visualising XState 5 actors and @xstate\u002Freact integrations; NOT for a value one event sets completely, such as a text draft, a focus flag, or a plain open and closed toggle; models typed lifecycles and renders legal Mermaid stateDiagram-v2 charts.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Fxstate\u002FSKILL.md",[71,76],{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":77,"categoryName":78,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000009","前端开发",[67,80,81,82,83,84,85,86,87],"react","text","state","integrations","Charts","mermaid","testing","open",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":102,"publishedAt":22},"01M6C4PB6VVC2X19B63B7YNH0T","web-design","WHEN refining UI layout, typography, color, or polish; NOT code implementation; provides concise principles for intentional, legible design.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Fweb-design\u002FSKILL.md",[94,99],{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",{"categoryNo":100,"categoryName":101,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000015","视觉设计",[103,104,105,106,107,108,109,110],"web","design","web design","code implementation","polish","ui","typography","code",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":118,"publishedAt":22},"01M6C4P8D92GJDA49V7X1CZXEV","tailwind","USE WHEN writing, fixing or reviewing styling in a project that uses Tailwind CSS, even a one-class change or a request that does not name Tailwind: colours, focus rings, spacing, class names chosen by a prop, map or CVA variants, theme tokens and dark mode in the Tailwind stylesheet or tailwind.config, setup or upgrades (if unsure whether the project uses Tailwind, check package.json or the main stylesheet first); NOT WHEN writing plain CSS or Sass in a project without Tailwind; produces class names Tailwind can find, syntax for the installed major version, visible focus indicators, and no unrequested dependency or invented brand value.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Ftailwind\u002FSKILL.md",[117],{"categoryNo":100,"categoryName":101,"taxonomyType":74,"taxonomyTypeDesc":75},[119,120,121,122,104,123],"Tailwind","libraries","component","css","design systems",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":133,"publishedAt":22},"01M6C4P5VWQ69Q32DA0634GDJY","refactoring","WHEN you need a plan to refactor, restructure, or clean up working code and the test result is known, either green or a recorded failing set; NOT for new feature delivery or any behavior change; reversible-baseline safety with prioritized improvements.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Frefactoring\u002FSKILL.md",[130],{"categoryNo":131,"categoryName":132,"taxonomyType":74,"taxonomyTypeDesc":75},"01JBSEEDCAT000000000000007","代码审查",[126,134,135,136,137,138,139,140,141,142,110,143,144],"Safety","baseline","refactor","behavior","change","plan","new feature","SET","up","feature delivery","test",{"skillNo":146,"name":80,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":152,"publishedAt":22},"01M6C4P345APEFEX00J8T7QMXQ","USE WHEN changing the logic, data, props, state, Effects or rendered text of a React component, hook or page, even a one-line change; NOT WHEN the request is styling only (class names, Tailwind, CSS, dark mode, spacing, shadows) or tests only, or when it models submit, in-flight, loading, retry or failure states, even for a named React form (xstate covers that, including its React wiring); applies React 19 composition, state, Effect, structure, API and performance rules with only the project's installed libraries.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Freact\u002FSKILL.md",[150,151],{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},{"categoryNo":77,"categoryName":78,"taxonomyType":74,"taxonomyTypeDesc":75},[80,110,122,119,153,86,154,155,156,157,158,82,144,159,160,161],"performance","hooks","components","architecture","api","react components","state management","styling","management",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":170,"publishedAt":22},"01M6C4P0DK385QBG3B3S86TQV2","react-testing","USE WHEN writing, fixing or reviewing a React Testing Library test for a component, hook or context provider, even one small test, or when asked for an end-to-end journey inside a Vitest or React Testing Library suite; NOT WHEN changing the component itself (react), testing XState actors or @xstate\u002Freact (xstate), or writing a Playwright or Cypress test; covers renderHook, providers, async results, forms and false-pass anti-patterns, and declines end-to-end journeys with the testable slices.","https:\u002F\u002Fgithub.com\u002Fmintuz\u002Fskills\u002Fblob\u002Fmain\u002Fsrc\u002Fweb\u002Fskills\u002Freact-testing\u002FSKILL.md",[168,169],{"categoryNo":72,"categoryName":73,"taxonomyType":74,"taxonomyTypeDesc":75},{"categoryNo":77,"categoryName":78,"taxonomyType":74,"taxonomyTypeDesc":75},[171,86,80,172,154,173,174,175,155,176,177,158],"react testing","anti-patterns","e2e","library","testing library","Providers","context"]