[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AWX91FMB92J1XQB7X2MTTM":3,"skill-same:01M7AWX91FMB92J1XQB7X2MTTM":52},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7AWX91FMB92J1XQB7X2MTTM","pstack-principle-boundary-discipline",null,"Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions.","flyme2bluemoon\u002Fskills","flyme2bluemoon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F37197710?v=4","01M7AWSKCXRPGZSNS26MTB5YR4","Matthew Shen","01M7AWSKE11G83QK1885PSGJ3K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-boundary-discipline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pstack-principle-boundary-discipline\ndescription: \"Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions.\"\n---\n\n# Boundary Discipline\n\nPlace validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions; the shell is thin and mechanical.\n\n**Why:** Scattered validation is noisy, redundant, and gives a false sense of safety. Validate data once at the boundary. Keep logic out of framework wiring so it can be tested without the framework.\n\n**The pattern:**\n- **At boundaries** (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.\n- **Inside the system:** typed data, error propagation, no re-validation. Trust the types.\n- **Across the boundary.** Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.\n\n**Applications:**\n\nValidation and error handling:\n- Validate config at parse time (the boundary), not inside business logic\n- Parse raw data into domain types at the boundary\n- Do not re-export transport, storage, framework, or wire types through the public surface\n- No redundant nil checks deep in call chains if the boundary already validated\n\nCode organization:\n- Business logic in pure functions with no framework dependencies\n- Parse functions: pure transforms from raw bytes to typed state\n- Prompt construction: structured state in, string out\n- Scoring and assessment: pure transforms from state to results\n\n**The tests:**\n- \"Is this data crossing a system boundary right now?\" If not, validation is redundant.\n- \"Can this be a pure function that the shell just calls?\" If yes, extract it.\n","# Boundary Discipline\n\nPlace validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions; the shell is thin and mechanical.\n\n**Why:** Scattered validation is noisy, redundant, and gives a false sense of safety. Validate data once at the boundary. Keep logic out of framework wiring so it can be tested without the framework.\n\n**The pattern:**\n- **At boundaries** (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.\n- **Inside the system:** typed data, error propagation, no re-validation. Trust the types.\n- **Across the boundary.** Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.\n\n**Applications:**\n\nValidation and error handling:\n- Validate config at parse time (the boundary), not inside business logic\n- Parse raw data into domain types at the boundary\n- Do not re-export transport, storage, framework, or wire types through the public surface\n- No redundant nil checks deep in call chains if the boundary already validated\n\nCode organization:\n- Business logic in pure functions with no framework dependencies\n- Parse functions: pure transforms from raw bytes to typed state\n- Prompt construction: structured state in, string out\n- Scoring and assessment: pure transforms from state to results\n\n**The tests:**\n- \"Is this data crossing a system boundary right now?\" If not, validation is redundant.\n- \"Can this be a pure function that the shell just calls?\" If yes, extract it.\n",{"name":5,"description":7},"main","9a28ca56870fad42cc4efa04a1d487c07a561ab1","skills\u002Fpstack\u002Fpstack-principle-boundary-discipline","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon","https:\u002F\u002Fflyme2bluemoon.github.io","Computer Science and Biology @ McGill University | making computer do cool thing","2026-10-31 13:32:13",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add flyme2bluemoon\u002Fskills --skill pstack-principle-boundary-discipline",{"tool":38,"command":39},"bunx","bunx skills add flyme2bluemoon\u002Fskills --skill pstack-principle-boundary-discipline",{"tool":41,"command":42},"pnpm","pnpm dlx skills add flyme2bluemoon\u002Fskills --skill pstack-principle-boundary-discipline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-boundary-discipline\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",234,"https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-boundary-discipline\u002Fagents\u002Fopenai.yaml",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7AWZ83KYJ9YSB4E5VQJ1K9B","unslop","Edit substantive human-facing prose to remove AI writing patterns while preserving meaning and tone.","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Funslop\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7AWZ4FJPVNRMFFJC6JSHHKQ","pstack-principle-type-system-discipline","Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, refuse to lie to the compiler, exhaust variants, derive from authoritative schemas.","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-type-system-discipline\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7AWZ11K4KET3ASESNABPE52","pstack-principle-test-behavior-not-implementation","Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value. If the test would still pass when every imported function returns undefined, rewrite the assertion or delete the test.","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-test-behavior-not-implementation\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7AWYWT47M5JG7XV6ZK6QSSX","pstack-principle-subtract-before-you-add","Apply when sequencing an addition, refactor, or rewrite. Remove dead weight, redundant validators, and stub references first, then build on the simpler base.","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-subtract-before-you-add\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7AWYTNNHNGHB583NEV888BB","pstack-principle-sequence-verifiable-units","Sequence migrations or dependent changes around meaningful verification boundaries.","https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-sequence-verifiable-units\u002FSKILL.md",[],[],{"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":94,"publishedAt":19},"01M7AWYQ2C15PV2W2V6ZVMK3ZM","pstack-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\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-separate-before-serializing-shared-state\u002FSKILL.md",[],[]]