[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AWXT406SAFT4G17FPPESWX":3,"skill-same:01M7AWXT406SAFT4G17FPPESWX":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},"01M7AWXT406SAFT4G17FPPESWX","pstack-principle-foundational-thinking",null,"Apply before writing logic: choosing core types and data structures, sequencing scaffold-vs-feature work, asking what concurrent actors share. Get the data structures right so downstream code becomes obvious.","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-foundational-thinking\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pstack-principle-foundational-thinking\ndescription: \"Apply before writing logic: choosing core types and data structures, sequencing scaffold-vs-feature work, asking what concurrent actors share. Get the data structures right so downstream code becomes obvious.\"\n---\n\n# Foundational Thinking\n\n**Structural decisions** protect option value. **Code-level decisions** protect simplicity. Over-engineering is often a premature decision that closes doors. The right foundational data structure keeps doors open.\n\n**Data structures first.** Get the data shape right before writing logic. The right shape makes downstream code obvious. Define core types early, trace every access pattern, and choose structures that match the dominant paths. A data-structure change late is a rewrite. Early, it is often a one-line diff.\n\nAt code level, DRY the structure, not every line. Types and data models should converge. Three similar statements still beat a premature abstraction. Prefer explicit over clever. Test behavior and edge cases, not line counts.\n\n**Concurrency corollary.** Before sharing state between actors, ask \"what happens if another actor modifies this concurrently?\" If not \"nothing\", isolate.\n\n**Scaffold first.** If something helps every later phase, do it first. Ask \"does every subsequent phase benefit from this existing?\" CI, linting, test infrastructure, and shared types are scaffold. Sequence for option value: setup before features, tests before fixes. Keep commits small and single-purpose.\n\nEach increment should land a coherent abstraction or deepen one that exists. Do not spread a new capability across callers as special-case coordination.\n\nSubtraction comes before scaffolding: remove dead weight first, then lay foundations.\n","# Foundational Thinking\n\n**Structural decisions** protect option value. **Code-level decisions** protect simplicity. Over-engineering is often a premature decision that closes doors. The right foundational data structure keeps doors open.\n\n**Data structures first.** Get the data shape right before writing logic. The right shape makes downstream code obvious. Define core types early, trace every access pattern, and choose structures that match the dominant paths. A data-structure change late is a rewrite. Early, it is often a one-line diff.\n\nAt code level, DRY the structure, not every line. Types and data models should converge. Three similar statements still beat a premature abstraction. Prefer explicit over clever. Test behavior and edge cases, not line counts.\n\n**Concurrency corollary.** Before sharing state between actors, ask \"what happens if another actor modifies this concurrently?\" If not \"nothing\", isolate.\n\n**Scaffold first.** If something helps every later phase, do it first. Ask \"does every subsequent phase benefit from this existing?\" CI, linting, test infrastructure, and shared types are scaffold. Sequence for option value: setup before features, tests before fixes. Keep commits small and single-purpose.\n\nEach increment should land a coherent abstraction or deepen one that exists. Do not spread a new capability across callers as special-case coordination.\n\nSubtraction comes before scaffolding: remove dead weight first, then lay foundations.\n",{"name":5,"description":7},"main","9a28ca56870fad42cc4efa04a1d487c07a561ab1","skills\u002Fpstack\u002Fpstack-principle-foundational-thinking","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-foundational-thinking",{"tool":38,"command":39},"bunx","bunx skills add flyme2bluemoon\u002Fskills --skill pstack-principle-foundational-thinking",{"tool":41,"command":42},"pnpm","pnpm dlx skills add flyme2bluemoon\u002Fskills --skill pstack-principle-foundational-thinking","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-foundational-thinking\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",239,"https:\u002F\u002Fgithub.com\u002Fflyme2bluemoon\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fpstack-principle-foundational-thinking\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",[],[]]