[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DHDZFFBPGV0X323GC7AS2Y":3,"skill-same:01M7DHDZFFBPGV0X323GC7AS2Y":59},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7DHDZFFBPGV0X323GC7AS2Y","typescript-best-practices",null,"Applies concrete TypeScript type, boundary, API, and test rules when reading, writing, reviewing, or refactoring .ts and .tsx files. Use to model state honestly, remove unchecked casts, derive types from authoritative schemas, and keep external validation at boundaries.","daanqq\u002Fagent-config","daanqq","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F57527208?v=4","01M72TZR3C4TYNMFAFGKK77N2K","Danila Andreev","01M7DH7G1DD6K11ETK1Y1VQ6E2",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Ftypescript-best-practices\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Ftypescript-best-practices\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: typescript-best-practices\ndescription: Applies concrete TypeScript type, boundary, API, and test rules when reading, writing, reviewing, or refactoring .ts and .tsx files. Use to model state honestly, remove unchecked casts, derive types from authoritative schemas, and keep external validation at boundaries.\nlicense: LICENSE\nmetadata:\n  source: https:\u002F\u002Fgithub.com\u002Fcursor\u002Fplugins\u002Ftree\u002F57fc467a229cf2853329f19c9e6a9fd83ddc2ea2\u002Fpstack\u002Fskills\u002Ftypescript-best-practices\n  adapted-for: claude-code, pi\n---\n\n# TypeScript best practices\n\nApply these rules with repository conventions and the existing code's real constraints. The aim is fewer invalid states and clearer boundaries, not maximum type cleverness.\n\n| Rule | Decision |\n| --- | --- |\n| Discriminated unions | Model variants with one literal discriminant when optional fields or booleans allow contradictory states. |\n| Constructive modeling | Choose a representation that makes the important illegal value hard to construct. Use `NonEmpty\u003CT>`, pairs, ranges, or branded primitives only when a real caller otherwise needs a cast, assertion, or repeated guard. |\n| Simplest total type | Keep the looser type while all operations remain total. Strengthen inputs or widen outputs only where partiality reaches a caller. |\n| `unknown` at external boundaries | Treat parsed JSON, RPC, IPC, storage, environment, and untyped library data as `unknown`; parse or narrow once where it enters. |\n| Unchecked casts | Remove `as` casts that merely silence the compiler. A boundary cast is acceptable only after the code validates the full claim or a library limitation makes the assertion unavoidable and locally justified. |\n| Narrowing order | Prefer discriminants, `in`, `typeof` or `instanceof`, then an honest type guard. Use an assertion only after those options fail for a concrete reason. |\n| Exhaustiveness | Make variant handling fail the build when a new case is unhandled, usually with an inline `never` assignment. |\n| `satisfies` | Prefer `satisfies` when a value must conform to a type without widening its literals. |\n| Schema-derived types | Derive from generated or authoritative types with `Pick`, `Omit`, `Parameters`, `ReturnType`, `Awaited`, or `typeof` before duplicating a shape. |\n| Object parameters | Prefer an object when positional arguments are easy to swap or the call has several optional settings. Keep positional arguments for small conventional APIs and measured hot paths. |\n| Boundary errors | Parse and translate errors at the system edge. Keep internal domain functions typed and direct instead of revalidating the same shape down the call chain. |\n| Tests | Test behavior through the owning interface with the narrowest real executable path. Use mocks only for boundaries that cannot run locally or are intentionally isolated. |\n| Telemetry | Follow the repository logger and diagnostics conventions. Include stable identifiers and actionable context; do not add ad hoc shipped `console.log` calls. |\n\nRead [`references\u002Fpatterns.md`](references\u002Fpatterns.md) when implementing one of these patterns or judging an exception.\n\n## Review posture\n\n- Match the repository's established discriminant, brand, error, and schema conventions before inventing another.\n- Flag a type issue only when it enables a real invalid state, hides boundary uncertainty, forces assertions, or spreads knowledge across callers.\n- Prefer a small local improvement over a type-system rewrite unrelated to the requested change.\n- Do not weaken a truthful runtime possibility merely to obtain a narrower type.\n- When a framework or generated API forces a cast, keep it at one boundary and explain the non-obvious reason if the code cannot make it evident.\n","# TypeScript best practices\n\nApply these rules with repository conventions and the existing code's real constraints. The aim is fewer invalid states and clearer boundaries, not maximum type cleverness.\n\n| Rule | Decision |\n| --- | --- |\n| Discriminated unions | Model variants with one literal discriminant when optional fields or booleans allow contradictory states. |\n| Constructive modeling | Choose a representation that makes the important illegal value hard to construct. Use `NonEmpty\u003CT>`, pairs, ranges, or branded primitives only when a real caller otherwise needs a cast, assertion, or repeated guard. |\n| Simplest total type | Keep the looser type while all operations remain total. Strengthen inputs or widen outputs only where partiality reaches a caller. |\n| `unknown` at external boundaries | Treat parsed JSON, RPC, IPC, storage, environment, and untyped library data as `unknown`; parse or narrow once where it enters. |\n| Unchecked casts | Remove `as` casts that merely silence the compiler. A boundary cast is acceptable only after the code validates the full claim or a library limitation makes the assertion unavoidable and locally justified. |\n| Narrowing order | Prefer discriminants, `in`, `typeof` or `instanceof`, then an honest type guard. Use an assertion only after those options fail for a concrete reason. |\n| Exhaustiveness | Make variant handling fail the build when a new case is unhandled, usually with an inline `never` assignment. |\n| `satisfies` | Prefer `satisfies` when a value must conform to a type without widening its literals. |\n| Schema-derived types | Derive from generated or authoritative types with `Pick`, `Omit`, `Parameters`, `ReturnType`, `Awaited`, or `typeof` before duplicating a shape. |\n| Object parameters | Prefer an object when positional arguments are easy to swap or the call has several optional settings. Keep positional arguments for small conventional APIs and measured hot paths. |\n| Boundary errors | Parse and translate errors at the system edge. Keep internal domain functions typed and direct instead of revalidating the same shape down the call chain. |\n| Tests | Test behavior through the owning interface with the narrowest real executable path. Use mocks only for boundaries that cannot run locally or are intentionally isolated. |\n| Telemetry | Follow the repository logger and diagnostics conventions. Include stable identifiers and actionable context; do not add ad hoc shipped `console.log` calls. |\n\nRead [`references\u002Fpatterns.md`](references\u002Fpatterns.md) when implementing one of these patterns or judging an exception.\n\n## Review posture\n\n- Match the repository's established discriminant, brand, error, and schema conventions before inventing another.\n- Flag a type issue only when it enables a real invalid state, hides boundary uncertainty, forces assertions, or spreads knowledge across callers.\n- Prefer a small local improvement over a type-system rewrite unrelated to the requested change.\n- Do not weaken a truthful runtime possibility merely to obtain a narrower type.\n- When a framework or generated API forces a cast, keep it at one boundary and explain the non-obvious reason if the code cannot make it evident.\n",{"name":5,"license":25,"metadata":26,"description":7},"LICENSE",{"source":27,"adapted-for":28},"https:\u002F\u002Fgithub.com\u002Fcursor\u002Fplugins\u002Ftree\u002F57fc467a229cf2853329f19c9e6a9fd83ddc2ea2\u002Fpstack\u002Fskills\u002Ftypescript-best-practices","claude-code, pi","main","178d05efe89baa1a18c4761f2c6e65a462c5d15e","common\u002Fskills\u002Ftypescript-best-practices",0,"https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config","https:\u002F\u002Fgithub.com\u002Fdaanqq","2026-11-03 14:54:56",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add daanqq\u002Fagent-config --skill typescript-best-practices",{"tool":42,"command":43},"bunx","bunx skills add daanqq\u002Fagent-config --skill typescript-best-practices",{"tool":45,"command":46},"pnpm","pnpm dlx skills add daanqq\u002Fagent-config --skill typescript-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Ftypescript-best-practices\u002FSKILL.md",true,[50,53],{"path":25,"resourceType":25,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":16},"许可证",1067,{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fpatterns.md","REFERENCE","参考文档",3881,"https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Ftypescript-best-practices\u002Freferences\u002Fpatterns.md",[60,68,76,85,93,100],{"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":64,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":20},"01M7DHF8YSDYAQY30ED9KK7WVZ","why","Investigates why code, a threshold, guard, workflow, or design decision exists. Use for historical rationale, regressions, postmortems, legacy removal, rejected alternatives, and product or operational constraints. Separates direct evidence from inference and reports unavailable sources. Use how for runtime mechanics.","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fwhy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":20},"01M7DHF1512M5RCGNFXQB9RT0J","show-me-your-work","Keeps a compact, reviewable TSV decision trail for long-running, multi-phase, delegated, or unattended work. Use when the user will review the work after a pause, when hypotheses or pivots must remain auditable, or when another skill needs a canonical evidence log.","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fshow-me-your-work\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fshow-me-your-work\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":20},"01M7DHEPZKK657FJNY27KWERPE","frontend-design","Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Ffrontend-design\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":20},"01M7DHEKCZ18A0MSB7CW3DHRWY","background-terminals","Run and manage long-lived shell commands in background terminals. Use for dev servers, watchers, streaming builds, and other commands that should keep running while the agent continues working.","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fbackground-terminals\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fpi\u002Fagent\u002Fskills\u002Fbackground-terminals\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":20},"01M7DHE9GW32YPQ8F31CGYJZXJ","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M7DHCFYK2CH2C7X4KYEVT6QS","prove-it-works","Verifies completed work against the real artifact and behavior rather than a build, cached representation, tool summary, or agent self-report. Use before declaring an implementation, fix, migration, generated artifact, configuration change, or delegated task complete.","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Fprove-it-works\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdaanqq\u002Fagent-config\u002Fblob\u002Fmain\u002Fcommon\u002Fskills\u002Fprove-it-works\u002FSKILL.md",[],[]]