[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M720KF1JMVXNG9S36K2KG9F1":3,"skill-same:01M720KF1JMVXNG9S36K2KG9F1":56},{"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},"01M720KF1JMVXNG9S36K2KG9F1","typescript-best-practices",null,"TypeScript best practices. Use when reading or editing any .ts or .tsx file.","BramVR\u002Fmac-agent-scripts","BramVR","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30230797?v=4","01M720C63442005A69G8VB2XS8","Bram Van Rompuy","01M720C63TQABCP40HMH3FCGFC",0,"MIT","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Ftypescript-best-practices\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: typescript-best-practices\ndescription: \"TypeScript best practices. Use when reading or editing any .ts or .tsx file.\"\n---\n\n# TypeScript best practices\n\nApply the **type-system-discipline** principle skill first.\n\n| Rule | Summary |\n|------|---------|\n| Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. |\n| Branded types | Brand primitives with `& { readonly __brand: \"X\" }` so they can't be mixed up. Validate once at the boundary. |\n| Constructive modeling | Build the shape so the illegal value can't be constructed. `[T, ...T[]]` for non-empty, `[T, T][]` for even length, `start` plus `duration` for a range. Not a runtime guard, not a wish for refinement types. |\n| Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty\u003CT>` only where the loose type forces `!`, a cast, or a \"should never happen\" throw. |\n| `unknown` over `any` | External data is `unknown`. |\n| Schemas before guards | Before hand-writing a property-by-property type guard, use the repository's runtime schema library and infer the type from the schema, such as `z.infer`. |\n| No `as` casts | Every `as` is a runtime crash waiting. Cast only after validation. |\n| Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`\u002F`instanceof` > user-defined type guard > `as`. |\n| Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. |\n| Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. |\n| `satisfies` over `as` | Validates the value without widening literal types. |\n| Boundary validation | Parse where data crosses in, into a named domain type. `Record\u003Cstring, unknown>` (however spelled) stops at that parse. Trust types inside. See the **boundary-discipline** principle skill. |\n| Schema-derived types | Reach for `Pick`\u002F`Omit`\u002F`Parameters`\u002F`ReturnType`\u002F`Awaited`\u002F`typeof` before declaring a new interface. |\n| Object args | Pass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers). |\n| Real tests | Don't mock what you can run. Prefer the framework's real test primitives with leak\u002Fdisposable checks, and verify UI in a running build. Mock only what you can't run locally. |\n| Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. |\n\nExamples: `references\u002Fpatterns.md`.\n","# TypeScript best practices\n\nApply the **type-system-discipline** principle skill first.\n\n| Rule | Summary |\n|------|---------|\n| Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. |\n| Branded types | Brand primitives with `& { readonly __brand: \"X\" }` so they can't be mixed up. Validate once at the boundary. |\n| Constructive modeling | Build the shape so the illegal value can't be constructed. `[T, ...T[]]` for non-empty, `[T, T][]` for even length, `start` plus `duration` for a range. Not a runtime guard, not a wish for refinement types. |\n| Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty\u003CT>` only where the loose type forces `!`, a cast, or a \"should never happen\" throw. |\n| `unknown` over `any` | External data is `unknown`. |\n| Schemas before guards | Before hand-writing a property-by-property type guard, use the repository's runtime schema library and infer the type from the schema, such as `z.infer`. |\n| No `as` casts | Every `as` is a runtime crash waiting. Cast only after validation. |\n| Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`\u002F`instanceof` > user-defined type guard > `as`. |\n| Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. |\n| Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. |\n| `satisfies` over `as` | Validates the value without widening literal types. |\n| Boundary validation | Parse where data crosses in, into a named domain type. `Record\u003Cstring, unknown>` (however spelled) stops at that parse. Trust types inside. See the **boundary-discipline** principle skill. |\n| Schema-derived types | Reach for `Pick`\u002F`Omit`\u002F`Parameters`\u002F`ReturnType`\u002F`Awaited`\u002F`typeof` before declaring a new interface. |\n| Object args | Pass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers). |\n| Real tests | Don't mock what you can run. Prefer the framework's real test primitives with leak\u002Fdisposable checks, and verify UI in a running build. Mock only what you can't run locally. |\n| Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. |\n\nExamples: `references\u002Fpatterns.md`.\n",{"name":5,"description":7},"main","9943359ac3d8fc05cc503d1b1ce23281450400fe","skills\u002Ftypescript-best-practices","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts","https:\u002F\u002Fgithub.com\u002FBramVR","https:\u002F\u002Fbramvanrompuy.be","Senior AI & Python engineer turning fragile AI prototypes into reliable production systems. Freelance · Belgium · EU\u002Fremote.","2026-11-10 22:43:17",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add BramVR\u002Fmac-agent-scripts --skill typescript-best-practices",{"tool":38,"command":39},"bunx","bunx skills add BramVR\u002Fmac-agent-scripts --skill typescript-best-practices",{"tool":41,"command":42},"pnpm","pnpm dlx skills add BramVR\u002Fmac-agent-scripts --skill typescript-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Ftypescript-best-practices\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",147,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Ftypescript-best-practices\u002Fagents\u002Fopenai.yaml",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fpatterns.md",9214,"https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Ftypescript-best-practices\u002Freferences\u002Fpatterns.md",[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M720KXN6XE37GD67K403G7M3","youtube-to-vault","YouTube video into a vault Source note: transcript, claim extraction, verified quotes, Markdown.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-to-vault\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M720KVSRQ8KRV7AZXCEWEDJQ","xurl","xurl X API CLI: install, auth, app choice, shortcuts, raw endpoints.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M720KRRGENBWNTDV7PYSZNNB","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M720KPRZ4YY1F3R4HB21W4K0","whatsapp","WhatsApp router: history\u002Fsearch\u002Fread\u002Fsend decisions; wacrawl read, wacli live.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhatsapp\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M720KN646WP0JRXTR6HDX9T0","what-did-i-get-done","Summarize authored commits over a user-specified time period into a concise update. Use for \"what did I get done\", \"summarize my week\", or a standup update.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhat-did-i-get-done\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwhat-did-i-get-done\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M720KK4495758N0EFWDF1W7A","wacli","WhatsApp linked-device CLI: auth, sync, search, send, live state.","https:\u002F\u002Fgithub.com\u002FBramVR\u002Fmac-agent-scripts\u002Fblob\u002Fmain\u002Fskills\u002Fwacli\u002FSKILL.md",[],[]]