[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EB13MQWSSFDEE11GGZ9WQ1":3,"skill-same:01M7EB13MQWSSFDEE11GGZ9WQ1":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":42},"01M7EB13MQWSSFDEE11GGZ9WQ1","principle-model-the-domain",null,"Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.","knowttl\u002Fbstack","knowttl","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F190909824?v=4","01M7EAVH45A8N0D457MF3F8Y8N","01M7EAVH51BVBHN175WKB1DAPY",0,"MIT","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack-formal\u002Fpstack\u002Fskills\u002Fprinciple-model-the-domain\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: principle-model-the-domain\ndescription: \"Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.\"\ndisable-model-invocation: true\n---\n\n# Model the Domain\n\nEncode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.\n\nReach for:\n\n- A state machine instead of scattered booleans, phases, or lifecycle checks.\n- A typed model instead of loose parameters or repeated shape assumptions.\n- A map, registry, lookup table, or discriminated union instead of branching spread across files.\n- A reducer or command\u002Fevent model instead of ad hoc state mutations.\n- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.\n- A small module boundary that gathers repeated behavior, ownership, or invariants.\n- A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.\n- Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.\n\nDo not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.\n\nThe sign that you skipped this is a new feature that grows an existing if\u002Felse chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another sign. Phase-named modules repeat the same domain rules across steps.\n","# Model the Domain\n\nEncode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.\n\nReach for:\n\n- A state machine instead of scattered booleans, phases, or lifecycle checks.\n- A typed model instead of loose parameters or repeated shape assumptions.\n- A map, registry, lookup table, or discriminated union instead of branching spread across files.\n- A reducer or command\u002Fevent model instead of ad hoc state mutations.\n- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.\n- A small module boundary that gathers repeated behavior, ownership, or invariants.\n- A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.\n- Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.\n\nDo not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.\n\nThe sign that you skipped this is a new feature that grows an existing if\u002Felse chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another sign. Phase-named modules repeat the same domain rules across steps.\n",{"name":5,"description":7,"disable-model-invocation":23},true,"main","731d59d74f9a92ea606abe1b5c7dbec3f6eb1104","upstream\u002Fpstack-formal\u002Fpstack\u002Fskills\u002Fprinciple-model-the-domain","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack","https:\u002F\u002Fgithub.com\u002Fknowttl","2026-11-15 07:36:30",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":23},[32,35,38],{"tool":33,"command":34},"npx","npx skills add knowttl\u002Fbstack --skill principle-model-the-domain",{"tool":36,"command":37},"bunx","bunx skills add knowttl\u002Fbstack --skill principle-model-the-domain",{"tool":39,"command":40},"pnpm","pnpm dlx skills add knowttl\u002Fbstack --skill principle-model-the-domain","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack-formal\u002Fpstack\u002Fskills\u002Fprinciple-model-the-domain\u002FSKILL.md",[],[44,51,58,65,70,77],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7EB391NDZSYCJ9CTJ3VNC1S","vision","Draft and stress-test a VISION.md for a repository, then iterate with the author on an interactive review board until approved. Use on \u002Fvision or when asked to create or refine a project vision.","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fvision\u002Fskills\u002Fvision\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7EB35262G99XXG48461E4FC","principle-sequence-verifiable-units","Apply to multi-step work (sweeps, migrations, runs of similar edits) and to how you stack commits and PRs. Break work into small units that each end in a verifiable state, check each before the next, and order delivery so the sequence proves itself to a reviewer.","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack\u002Fpstack\u002Fskills\u002Fprinciple-sequence-verifiable-units\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7EB31DJX4XRXAXES3G6XMPR","principle-separate-before-serializing-shared-state","Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant.","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack\u002Fpstack\u002Fskills\u002Fprinciple-separate-before-serializing-shared-state\u002FSKILL.md",[],[],{"skillNo":66,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7EB2YZQCT7EKH3MK9YRT47J","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack\u002Fpstack\u002Fskills\u002Fprinciple-model-the-domain\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7EB2SRZBFMDPVFXHSMFY0QS","principle-minimize-reader-load","Apply when reviewing or shaping code that's hard to trace. Count layers between question and answer, and hidden state in the reader's head; collapse one-caller wrappers and shrink mutable scope.","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack\u002Fpstack\u002Fskills\u002Fprinciple-minimize-reader-load\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7EB2PG2M04BXCN1JD77SVGC","principle-encode-lessons-in-structure","Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction. Encode the rule as a lint, metadata flag, runtime check, or script instead of more text.","https:\u002F\u002Fgithub.com\u002Fknowttl\u002Fbstack\u002Fblob\u002Fmain\u002Fupstream\u002Fpstack\u002Fpstack\u002Fskills\u002Fprinciple-encode-lessons-in-structure\u002FSKILL.md",[],[]]