[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72T3R3S8GFAAPEJK3S2P69E":3,"skill-same:01M72T3R3S8GFAAPEJK3S2P69E":50},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M72T3R3S8GFAAPEJK3S2P69E","typescript",null,"TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.","iberi22\u002Fskills","iberi22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10615454?v=4","01M72SQ2NXAA3GW0FSH053A5ES","Brahyan Belalcazar","01M72SQ2PYCH0SSA1K61NGEHDV",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fgentleman-typescript\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: typescript\ndescription: >\n  TypeScript strict patterns and best practices.\n  Trigger: When writing TypeScript code - types, interfaces, generics.\nlicense: Apache-2.0\nmetadata:\n  author: gentleman-programming\n  version: \"1.0\"\nupdated: \"2026-04-23\"\n---\n\n## Const Types Pattern\n\nPrefer a const object + derived type over a bare string union when the values are also needed at runtime. Follow the repo's existing convention where it differs.\n\n```typescript\n\u002F\u002F ✅ Const object first, then extract type\nconst STATUS = {\n  ACTIVE: \"active\",\n  INACTIVE: \"inactive\",\n  PENDING: \"pending\",\n} as const;\n\ntype Status = (typeof STATUS)[keyof typeof STATUS];\n\n\u002F\u002F ❌ Avoid when values are needed at runtime: bare union\ntype Status = \"active\" | \"inactive\" | \"pending\";\n```\n\n**Why?** Single source of truth, runtime values, autocomplete, easier refactoring.\n\n## Flat Interfaces\n\nPrefer named interfaces over inline nested object types.\n\n```typescript\n\u002F\u002F ✅ One level depth, nested objects → dedicated interface\ninterface UserAddress {\n  street: string;\n  city: string;\n}\n\ninterface User {\n  id: string;\n  name: string;\n  address: UserAddress;  \u002F\u002F Reference, not inline\n}\n\ninterface Admin extends User {\n  permissions: string[];\n}\n\n\u002F\u002F ❌ Avoid: inline nested objects\ninterface User {\n  address: { street: string; city: string };\n}\n```\n\n## Never Use `any`\n\n```typescript\n\u002F\u002F ✅ Use unknown for truly unknown types\nfunction parse(input: unknown): User {\n  if (isUser(input)) return input;\n  throw new Error(\"Invalid input\");\n}\n\n\u002F\u002F ✅ Use generics for flexible types\nfunction first\u003CT>(arr: T[]): T | undefined {\n  return arr[0];\n}\n\n\u002F\u002F ❌ NEVER\nfunction parse(input: any): any { }\n```\n\n## Utility Types\n\n```typescript\nPick\u003CUser, \"id\" | \"name\">     \u002F\u002F Select fields\nOmit\u003CUser, \"id\">              \u002F\u002F Exclude fields\nPartial\u003CUser>                 \u002F\u002F All optional\nRequired\u003CUser>                \u002F\u002F All required\nReadonly\u003CUser>                \u002F\u002F All readonly\nRecord\u003Cstring, User>          \u002F\u002F Object type\nExtract\u003CUnion, \"a\" | \"b\">     \u002F\u002F Extract from union\nExclude\u003CUnion, \"a\">           \u002F\u002F Exclude from union\nNonNullable\u003CT | null>         \u002F\u002F Remove null\u002Fundefined\nReturnType\u003Ctypeof fn>         \u002F\u002F Function return type\nParameters\u003Ctypeof fn>         \u002F\u002F Function params tuple\n```\n\n## Type Guards\n\n```typescript\nfunction isUser(value: unknown): value is User {\n  return (\n    typeof value === \"object\" &&\n    value !== null &&\n    \"id\" in value &&\n    \"name\" in value\n  );\n}\n```\n\n## Import Types\n\n```typescript\nimport type { User } from \".\u002Ftypes\";\nimport { createUser, type Config } from \".\u002Futils\";\n```\n\n## Keywords\ntypescript, ts, types, interfaces, generics, strict mode, utility types\n","## Const Types Pattern\n\nPrefer a const object + derived type over a bare string union when the values are also needed at runtime. Follow the repo's existing convention where it differs.\n\n```typescript\n\u002F\u002F ✅ Const object first, then extract type\nconst STATUS = {\n  ACTIVE: \"active\",\n  INACTIVE: \"inactive\",\n  PENDING: \"pending\",\n} as const;\n\ntype Status = (typeof STATUS)[keyof typeof STATUS];\n\n\u002F\u002F ❌ Avoid when values are needed at runtime: bare union\ntype Status = \"active\" | \"inactive\" | \"pending\";\n```\n\n**Why?** Single source of truth, runtime values, autocomplete, easier refactoring.\n\n## Flat Interfaces\n\nPrefer named interfaces over inline nested object types.\n\n```typescript\n\u002F\u002F ✅ One level depth, nested objects → dedicated interface\ninterface UserAddress {\n  street: string;\n  city: string;\n}\n\ninterface User {\n  id: string;\n  name: string;\n  address: UserAddress;  \u002F\u002F Reference, not inline\n}\n\ninterface Admin extends User {\n  permissions: string[];\n}\n\n\u002F\u002F ❌ Avoid: inline nested objects\ninterface User {\n  address: { street: string; city: string };\n}\n```\n\n## Never Use `any`\n\n```typescript\n\u002F\u002F ✅ Use unknown for truly unknown types\nfunction parse(input: unknown): User {\n  if (isUser(input)) return input;\n  throw new Error(\"Invalid input\");\n}\n\n\u002F\u002F ✅ Use generics for flexible types\nfunction first\u003CT>(arr: T[]): T | undefined {\n  return arr[0];\n}\n\n\u002F\u002F ❌ NEVER\nfunction parse(input: any): any { }\n```\n\n## Utility Types\n\n```typescript\nPick\u003CUser, \"id\" | \"name\">     \u002F\u002F Select fields\nOmit\u003CUser, \"id\">              \u002F\u002F Exclude fields\nPartial\u003CUser>                 \u002F\u002F All optional\nRequired\u003CUser>                \u002F\u002F All required\nReadonly\u003CUser>                \u002F\u002F All readonly\nRecord\u003Cstring, User>          \u002F\u002F Object type\nExtract\u003CUnion, \"a\" | \"b\">     \u002F\u002F Extract from union\nExclude\u003CUnion, \"a\">           \u002F\u002F Exclude from union\nNonNullable\u003CT | null>         \u002F\u002F Remove null\u002Fundefined\nReturnType\u003Ctypeof fn>         \u002F\u002F Function return type\nParameters\u003Ctypeof fn>         \u002F\u002F Function params tuple\n```\n\n## Type Guards\n\n```typescript\nfunction isUser(value: unknown): value is User {\n  return (\n    typeof value === \"object\" &&\n    value !== null &&\n    \"id\" in value &&\n    \"name\" in value\n  );\n}\n```\n\n## Import Types\n\n```typescript\nimport type { User } from \".\u002Ftypes\";\nimport { createUser, type Config } from \".\u002Futils\";\n```\n\n## Keywords\ntypescript, ts, types, interfaces, generics, strict mode, utility types\n",{"name":5,"license":15,"updated":24,"metadata":25,"description":28},"2026-04-23",{"author":26,"version":27},"gentleman-programming","1.0","TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.\n","main","688810f2886d212632acf81e532b24e483dd8b98","skills\u002Fgeneral\u002Fgentleman-typescript","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills","https:\u002F\u002Fgithub.com\u002Fiberi22","Senior WEB Full-Stack","2026-10-12 02:46:21",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add iberi22\u002Fskills --skill typescript",{"tool":42,"command":43},"bunx","bunx skills add iberi22\u002Fskills --skill typescript",{"tool":45,"command":46},"pnpm","pnpm dlx skills add iberi22\u002Fskills --skill typescript","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fgeneral\u002Fgentleman-typescript\u002FSKILL.md",true,[],[51,58,65,71,77,83],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M72TWQEQD46ZC9TRBAABF78P","web-design-guidelines","MIT","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M72TWMQFTYD08DGXVAXRPPEB","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M72TVQMS3HCTX18C8T97WTQQ","studio-coach","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fstudio-coach\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72TVNA2PR9RZW0ZAXYP1G6J","src-generator","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsrc-generator\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M72TVEJHHB6SAT3R3TY9MJKS","sqlite-pro","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Fsqlite-pro\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":54,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M72TVC2EVBHQHCX96VTTYKB8","rigor-evaluator","Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore\u002Ffeatures.json file, to decide which features are ready to ship.","https:\u002F\u002Fgithub.com\u002Fiberi22\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftools\u002Frigor-evaluator\u002FSKILL.md",[],[]]