[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A7Z8Z6DDWNZTJ52F8HGS00":3,"skill-same:01M7A7Z8Z6DDWNZTJ52F8HGS00":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":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7A7Z8Z6DDWNZTJ52F8HGS00","typescript-best-practices",null,"TypeScript best practices. Use when reading or editing any .ts or .tsx file.","am-will\u002Fgooey-pi","am-will","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42459108?v=4","01M6DGTYZDSE8HR73NQBJ31689","am.will","01M7A7TJ263XAJ06M4HD6MTTJD",974,"MIT","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpstack\u002Ftypescript-best-practices\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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; this skill grounds it in TypeScript syntax.\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 creation. |\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`. `any` disables type checking everywhere it touches. |\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; this skill grounds it in TypeScript syntax.\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 creation. |\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`. `any` disables type checking everywhere it touches. |\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","f63b9cfa707488880eeb9f47984fbf383e397322",".agents\u002Fskills\u002Fpstack\u002Ftypescript-best-practices",87,"https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi","https:\u002F\u002Fgithub.com\u002Fam-will","Context Engineer, Developer, Husband, Father","2026-10-25 13:02:03",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add am-will\u002Fgooey-pi --skill typescript-best-practices",{"tool":38,"command":39},"bunx","bunx skills add am-will\u002Fgooey-pi --skill typescript-best-practices",{"tool":41,"command":42},"pnpm","pnpm dlx skills add am-will\u002Fgooey-pi --skill typescript-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpstack\u002Ftypescript-best-practices\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fpatterns.md","REFERENCE","参考文档",8695,"https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpstack\u002Ftypescript-best-practices\u002Freferences\u002Fpatterns.md",[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},"01M7A8040XWQF3KCYT7G12G1TA","prime-work-schedules","Create, inspect, edit, pause, resume, run, and delete durable GooeyPi scheduled tasks. Use when the user asks to schedule recurring or one-time work in the current project or thread. Use rlm-heartbeat instead for temporary internal polling while actively working.","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002Fassets\u002Fskills\u002Fprime-work-schedules\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},"01M7A7ZYRC65CS56VJV4CVKWFV","prime-work-browser","Drive the GooeyPi in-app browser for this thread with the browser_* tools - open tabs, navigate, read pages, click, type, scroll, screenshot, and extract data. Use when the user asks to open, test, inspect, or interact with a website or a local dev server inside GooeyPi.","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002Fassets\u002Fskills\u002Fprime-work-browser\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},"01M7A7ZV00WXP2QFC5YPDJXTNV","gooeypi-computer-use","Drive native applications on macOS, Windows, or Linux through the separately installed TryCUA driver CLI.","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002Fassets\u002Fskills\u002Fgooeypi-computer-use\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},"01M7A7ZNTPXAJ17VX4MTAND91G","verify-gooeypi","Launch and drive the GooeyPi desktop (Electron) app to prove user-facing behavior — sidebar navigation, Settings, and Capabilities — capturing screenshots and ARIA snapshots. Reach for this when verifying a GooeyPi UI change or confirming the app still works end to end.","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.cursor\u002Fskills\u002Fverify-gooeypi\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},"01M7A7ZK9FBXTZC33HEAJ4C3HW","review-pr-viability","Review a pull request or issue for value, implementation quality, maintainability, regression risk, and reliance on upstream changes.","https:\u002F\u002Fgithub.com\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Freview-pr-viability\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},"01M7A7ZDK2B6KE9ZE33GS4V180","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\u002Fam-will\u002Fgooey-pi\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpstack\u002Fwhy\u002FSKILL.md",[],[]]