[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ES12GT9WD9NE2X3M1B29ZZ":3,"skill-same:01M7ES12GT9WD9NE2X3M1B29ZZ":48},{"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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7ES12GT9WD9NE2X3M1B29ZZ","type-discipline",null,"Apply when designing types or data shapes, reviewing a signature, or handling outside data, in any language. Make wrong states fail early: in the compiler for typed languages, in validated runtime contracts for untyped ones.","Ventorius\u002Fven-stack","Ventorius","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5689509?v=4","01M7ERRDPQ5YXCNXJZWEKQNP50","Sebastian Basznianin","01M7ERRDQ9S0ZD9YMH1RN1WVP7",0,"MIT","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Ftype-discipline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: type-discipline\ndescription: \"Apply when designing types or data shapes, reviewing a signature, or handling outside data, in any language. Make wrong states fail early: in the compiler for typed languages, in validated runtime contracts for untyped ones.\"\nmetadata:\n  layer: L2\n  source: cursor\u002Fplugins@1e5c90a:pstack\u002Fskills\u002Fprinciple-type-system-discipline\u002FSKILL.md\n  license: MIT\n---\n\n# Type Discipline\n\nMake wrong programs fail early: at compile time in a typed language, at the edge in an untyped one. `ven-profile get stack.typed` says which section applies; mixed repos use both.\n\n**Why:** Every state the code can represent is a state some caller will eventually build. A check that runs on every call beats a rule that lives in a reviewer's head.\n\n## Typed languages\n\n- **Make illegal states unrepresentable.** Model variants as a sum type (tagged union, enum with data, sealed hierarchy), not a record of optional fields. A report with a `published` flag and an optional publish date admits \"published, no date\"; model it as draft, or published with a date. If a comment has to explain which field combinations are valid, split the type.\n- **Construct, don't restrict.** Build the type from the values you want instead of carving them out of a looser one: a non-empty list is a first item plus the rest; a valid range is a start plus a length.\n- **Give meaning its own type.** An account id and a widget id may share a primitive but get distinct nominal types. Validate once when the value is made; trust it after.\n- **Outside data is untyped until parsed.** Request bodies, files, environment, arguments and stored rows go through a parse function that returns the model or an error.\n- **Don't lie to the compiler.** Every cast, unchecked coercion or non-null assertion is a crash waiting for input. Prove the fact (validate, narrow, refine the model), or trace the cast to the edge and parse there.\n- **Let the compiler enforce exhaustiveness.** A match over a sum type must stop compiling when a variant is added, so the compiler lists every place to update. No silent default arm.\n- **Derive from the source of truth.** When a schema file, migration or generated client owns a shape, derive the type from it instead of keeping a parallel copy.\n- **Strengthen only where partiality shows.** A runtime assertion or \"can't happen\" throw marks a type that is too weak; move that check into the type, then stop. Summing an empty list has an answer, so it takes any list; the first item of an empty list has none, so it demands a non-empty one.\n\n## Untyped languages: contract discipline\n\nSame goals, enforced at runtime and by tests:\n\n- **Validate every input against a schema.** Parse once with a declared schema or a validating constructor; on failure, raise with the field and the reason. Never coerce silently.\n- **One shape after parsing.** Downstream code sees one form of each value: no \"string or list\", no \"missing and empty mean the same\".\n- **Tag variants.** Each record carries a kind field; dispatch through a table that raises on an unknown kind, plus a test that walks every kind.\n- **Guard public entry points.** Assert preconditions where a module is called from outside, not in every helper inside it.\n- **Make values through one door.** A factory that checks the invariant is the only way to build the value; nothing else assembles raw records.\n- **Use the checker the repo has.** If the profile has `commands.typecheck`, annotate the code you touch and run it.\n\n**Stop:** Types track what each caller must handle, not every fact about the data. If nothing would crash or need a check without the stronger type, keep the plain one.\n","# Type Discipline\n\nMake wrong programs fail early: at compile time in a typed language, at the edge in an untyped one. `ven-profile get stack.typed` says which section applies; mixed repos use both.\n\n**Why:** Every state the code can represent is a state some caller will eventually build. A check that runs on every call beats a rule that lives in a reviewer's head.\n\n## Typed languages\n\n- **Make illegal states unrepresentable.** Model variants as a sum type (tagged union, enum with data, sealed hierarchy), not a record of optional fields. A report with a `published` flag and an optional publish date admits \"published, no date\"; model it as draft, or published with a date. If a comment has to explain which field combinations are valid, split the type.\n- **Construct, don't restrict.** Build the type from the values you want instead of carving them out of a looser one: a non-empty list is a first item plus the rest; a valid range is a start plus a length.\n- **Give meaning its own type.** An account id and a widget id may share a primitive but get distinct nominal types. Validate once when the value is made; trust it after.\n- **Outside data is untyped until parsed.** Request bodies, files, environment, arguments and stored rows go through a parse function that returns the model or an error.\n- **Don't lie to the compiler.** Every cast, unchecked coercion or non-null assertion is a crash waiting for input. Prove the fact (validate, narrow, refine the model), or trace the cast to the edge and parse there.\n- **Let the compiler enforce exhaustiveness.** A match over a sum type must stop compiling when a variant is added, so the compiler lists every place to update. No silent default arm.\n- **Derive from the source of truth.** When a schema file, migration or generated client owns a shape, derive the type from it instead of keeping a parallel copy.\n- **Strengthen only where partiality shows.** A runtime assertion or \"can't happen\" throw marks a type that is too weak; move that check into the type, then stop. Summing an empty list has an answer, so it takes any list; the first item of an empty list has none, so it demands a non-empty one.\n\n## Untyped languages: contract discipline\n\nSame goals, enforced at runtime and by tests:\n\n- **Validate every input against a schema.** Parse once with a declared schema or a validating constructor; on failure, raise with the field and the reason. Never coerce silently.\n- **One shape after parsing.** Downstream code sees one form of each value: no \"string or list\", no \"missing and empty mean the same\".\n- **Tag variants.** Each record carries a kind field; dispatch through a table that raises on an unknown kind, plus a test that walks every kind.\n- **Guard public entry points.** Assert preconditions where a module is called from outside, not in every helper inside it.\n- **Make values through one door.** A factory that checks the invariant is the only way to build the value; nothing else assembles raw records.\n- **Use the checker the repo has.** If the profile has `commands.typecheck`, annotate the code you touch and run it.\n\n**Stop:** Types track what each caller must handle, not every fact about the data. If nothing would crash or need a check without the stronger type, keep the plain one.\n",{"name":5,"metadata":24,"description":7},{"layer":25,"source":26,"license":15},"L2","cursor\u002Fplugins@1e5c90a:pstack\u002Fskills\u002Fprinciple-type-system-discipline\u002FSKILL.md","main","e57e3dd5c8aec0fe40658397aee9fd9b1d77bb60","plugins\u002Fven\u002Fskills\u002Ftype-discipline","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack","https:\u002F\u002Fgithub.com\u002FVentorius","Heavy testing believer. Workflow automation fan. Fullstack JS developer.","2026-11-04 04:05:46",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Ventorius\u002Fven-stack --skill type-discipline",{"tool":40,"command":41},"bunx","bunx skills add Ventorius\u002Fven-stack --skill type-discipline",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Ventorius\u002Fven-stack --skill type-discipline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Ftype-discipline\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7ES1P06ZPAGTT7YS4V6MS32","yeet","Take every local change green through the repo's own checks, slice it into conventional commits, push, and with --pr open a pull request on the code host. Use only when the user explicitly asks to yeet, or to commit and push everything; never on your own initiative.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7ES1JHVQEN3YYMRZEBM2E79","write-docs","Write or update documentation from the code: gather facts, pick the shape for the reader, write it plain, and prove every command and path in it. Use when asked to document a repo, module or feature, or to bring stale docs up to date.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Fwrite-docs\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7ES1DD3YVMF1MY7D51R6516","why","Find why code is shaped the way it is (design rationale, trade-offs, regressions, odd thresholds) from history, tickets, docs and chat, citing every claim and stating its confidence. Use for 'why does X work this way', 'why did we pick Y', or before changing code whose purpose is unclear.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7ES18XVRZGQ0V1BBZH63Q8W","verify","Prove a change works with the check that matches its type, do the read-back, and log the pass against the exact tree. Use when a change is ready to call done, before review, commit or stopping, and whenever ven-decisions end refuses an unverified tree.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Fverify\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7ES15Z3W8QTJH4CRAJ53D2G","unslop","Cut AI writing tells (filler, model vocabulary, metaphor nouns, hedging, formatting tics) from text while keeping every fact. Use when editing or checking any prose before it ships: docs, PR bodies, reports, skill text.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Funslop\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7ES0Z32K0TKGZXXZSWRQY5D","to-tickets","Slice a spec into vertical tickets, each a complete brief a coder can finish without asking anything, with dependencies and file overlaps marked. Use after to-spec, when the user asks for tickets, or before handing work to coders.","https:\u002F\u002Fgithub.com\u002FVentorius\u002Fven-stack\u002Fblob\u002Fmain\u002Fplugins\u002Fven\u002Fskills\u002Fto-tickets\u002FSKILL.md",[],[]]