[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ENE3R4WX66WR1SNJ98F89W":3,"skill-same:01M6ENE3R4WX66WR1SNJ98F89W":72},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6ENE3R4WX66WR1SNJ98F89W","typescript-advanced-types",null,"Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.","dibstern\u002Fconduit","dibstern","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16970307?v=4","01M6ENBH1PHAQ5RZZTR2TKTRA7","David Stern","01M6ENBH5ZBECS0MFBF0F10V20",15,"MIT","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ftypescript-advanced-types\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"typescript","typescript advanced","types","typescript advanced types","Safety","applications","projects","system","template","use","master","reusable","Type Safety","type system","time","logic","type","utility","compile","safe","2026-11-10 10:12:30",false,"---\nname: typescript-advanced-types\ndescription: Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.\n---\n\n# TypeScript Advanced Types\n\nComprehensive guidance for mastering TypeScript's advanced type system including generics, conditional types, mapped types, template literal types, and utility types for building robust, type-safe applications.\n\n## When to Use This Skill\n\n- Building type-safe libraries or frameworks\n- Creating reusable generic components\n- Implementing complex type inference logic\n- Designing type-safe API clients\n- Building form validation systems\n- Creating strongly-typed configuration objects\n- Implementing type-safe state management\n- Migrating JavaScript codebases to TypeScript\n\n## Core Concepts\n\n### 1. Generics\n\n**Purpose:** Create reusable, type-flexible components while maintaining type safety.\n\n**Basic Generic Function:**\n\n```typescript\nfunction identity\u003CT>(value: T): T {\n  return value;\n}\n\nconst num = identity\u003Cnumber>(42); \u002F\u002F Type: number\nconst str = identity\u003Cstring>(\"hello\"); \u002F\u002F Type: string\nconst auto = identity(true); \u002F\u002F Type inferred: boolean\n```\n\n**Generic Constraints:**\n\n```typescript\ninterface HasLength {\n  length: number;\n}\n\nfunction logLength\u003CT extends HasLength>(item: T): T {\n  console.log(item.length);\n  return item;\n}\n\nlogLength(\"hello\"); \u002F\u002F OK: string has length\nlogLength([1, 2, 3]); \u002F\u002F OK: array has length\nlogLength({ length: 10 }); \u002F\u002F OK: object has length\n\u002F\u002F logLength(42);             \u002F\u002F Error: number has no length\n```\n\n**Multiple Type Parameters:**\n\n```typescript\nfunction merge\u003CT, U>(obj1: T, obj2: U): T & U {\n  return { ...obj1, ...obj2 };\n}\n\nconst merged = merge({ name: \"John\" }, { age: 30 });\n\u002F\u002F Type: { name: string } & { age: number }\n```\n\n### 2. Conditional Types\n\n**Purpose:** Create types that depend on conditions, enabling sophisticated type logic.\n\n**Basic Conditional Type:**\n\n```typescript\ntype IsString\u003CT> = T extends string ? true : false;\n\ntype A = IsString\u003Cstring>; \u002F\u002F true\ntype B = IsString\u003Cnumber>; \u002F\u002F false\n```\n\n**Extracting Return Types:**\n\n```typescript\ntype ReturnType\u003CT> = T extends (...args: any[]) => infer R ? R : never;\n\nfunction getUser() {\n  return { id: 1, name: \"John\" };\n}\n\ntype User = ReturnType\u003Ctypeof getUser>;\n\u002F\u002F Type: { id: number; name: string; }\n```\n\n**Distributive Conditional Types:**\n\n```typescript\ntype ToArray\u003CT> = T extends any ? T[] : never;\n\ntype StrOrNumArray = ToArray\u003Cstring | number>;\n\u002F\u002F Type: string[] | number[]\n```\n\n**Nested Conditions:**\n\n```typescript\ntype TypeName\u003CT> = T extends string\n  ? \"string\"\n  : T extends number\n    ? \"number\"\n    : T extends boolean\n      ? \"boolean\"\n      : T extends undefined\n        ? \"undefined\"\n        : T extends Function\n          ? \"function\"\n          : \"object\";\n\ntype T1 = TypeName\u003Cstring>; \u002F\u002F \"string\"\ntype T2 = TypeName\u003C() => void>; \u002F\u002F \"function\"\n```\n\n### 3. Mapped Types\n\n**Purpose:** Transform existing types by iterating over their properties.\n\n**Basic Mapped Type:**\n\n```typescript\ntype Readonly\u003CT> = {\n  readonly [P in keyof T]: T[P];\n};\n\ninterface User {\n  id: number;\n  name: string;\n}\n\ntype ReadonlyUser = Readonly\u003CUser>;\n\u002F\u002F Type: { readonly id: number; readonly name: string; }\n```\n\n**Optional Properties:**\n\n```typescript\ntype Partial\u003CT> = {\n  [P in keyof T]?: T[P];\n};\n\ntype PartialUser = Partial\u003CUser>;\n\u002F\u002F Type: { id?: number; name?: string; }\n```\n\n**Key Remapping:**\n\n```typescript\ntype Getters\u003CT> = {\n  [K in keyof T as `get${Capitalize\u003Cstring & K>}`]: () => T[K];\n};\n\ninterface Person {\n  name: string;\n  age: number;\n}\n\ntype PersonGetters = Getters\u003CPerson>;\n\u002F\u002F Type: { getName: () => string; getAge: () => number; }\n```\n\n**Filtering Properties:**\n\n```typescript\ntype PickByType\u003CT, U> = {\n  [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\ninterface Mixed {\n  id: number;\n  name: string;\n  age: number;\n  active: boolean;\n}\n\ntype OnlyNumbers = PickByType\u003CMixed, number>;\n\u002F\u002F Type: { id: number; age: number; }\n```\n\n### 4. Template Literal Types\n\n**Purpose:** Create string-based types with pattern matching and transformation.\n\n**Basic Template Literal:**\n\n```typescript\ntype EventName = \"click\" | \"focus\" | \"blur\";\ntype EventHandler = `on${Capitalize\u003CEventName>}`;\n\u002F\u002F Type: \"onClick\" | \"onFocus\" | \"onBlur\"\n```\n\n**String Manipulation:**\n\n```typescript\ntype UppercaseGreeting = Uppercase\u003C\"hello\">; \u002F\u002F \"HELLO\"\ntype LowercaseGreeting = Lowercase\u003C\"HELLO\">; \u002F\u002F \"hello\"\ntype CapitalizedName = Capitalize\u003C\"john\">; \u002F\u002F \"John\"\ntype UncapitalizedName = Uncapitalize\u003C\"John\">; \u002F\u002F \"john\"\n```\n\n**Path Building:**\n\n```typescript\ntype Path\u003CT> = T extends object\n  ? {\n      [K in keyof T]: K extends string ? `${K}` | `${K}.${Path\u003CT[K]>}` : never;\n    }[keyof T]\n  : never;\n\ninterface Config {\n  server: {\n    host: string;\n    port: number;\n  };\n  database: {\n    url: string;\n  };\n}\n\ntype ConfigPath = Path\u003CConfig>;\n\u002F\u002F Type: \"server\" | \"database\" | \"server.host\" | \"server.port\" | \"database.url\"\n```\n\n### 5. Utility Types\n\n**Built-in Utility Types:**\n\n```typescript\n\u002F\u002F Partial\u003CT> - Make all properties optional\ntype PartialUser = Partial\u003CUser>;\n\n\u002F\u002F Required\u003CT> - Make all properties required\ntype RequiredUser = Required\u003CPartialUser>;\n\n\u002F\u002F Readonly\u003CT> - Make all properties readonly\ntype ReadonlyUser = Readonly\u003CUser>;\n\n\u002F\u002F Pick\u003CT, K> - Select specific properties\ntype UserName = Pick\u003CUser, \"name\" | \"email\">;\n\n\u002F\u002F Omit\u003CT, K> - Remove specific properties\ntype UserWithoutPassword = Omit\u003CUser, \"password\">;\n\n\u002F\u002F Exclude\u003CT, U> - Exclude types from union\ntype T1 = Exclude\u003C\"a\" | \"b\" | \"c\", \"a\">; \u002F\u002F \"b\" | \"c\"\n\n\u002F\u002F Extract\u003CT, U> - Extract types from union\ntype T2 = Extract\u003C\"a\" | \"b\" | \"c\", \"a\" | \"b\">; \u002F\u002F \"a\" | \"b\"\n\n\u002F\u002F NonNullable\u003CT> - Exclude null and undefined\ntype T3 = NonNullable\u003Cstring | null | undefined>; \u002F\u002F string\n\n\u002F\u002F Record\u003CK, T> - Create object type with keys K and values T\ntype PageInfo = Record\u003C\"home\" | \"about\", { title: string }>;\n```\n\n## Advanced Patterns\n\n### Pattern 1: Type-Safe Event Emitter\n\n```typescript\ntype EventMap = {\n  \"user:created\": { id: string; name: string };\n  \"user:updated\": { id: string };\n  \"user:deleted\": { id: string };\n};\n\nclass TypedEventEmitter\u003CT extends Record\u003Cstring, any>> {\n  private listeners: {\n    [K in keyof T]?: Array\u003C(data: T[K]) => void>;\n  } = {};\n\n  on\u003CK extends keyof T>(event: K, callback: (data: T[K]) => void): void {\n    if (!this.listeners[event]) {\n      this.listeners[event] = [];\n    }\n    this.listeners[event]!.push(callback);\n  }\n\n  emit\u003CK extends keyof T>(event: K, data: T[K]): void {\n    const callbacks = this.listeners[event];\n    if (callbacks) {\n      callbacks.forEach((callback) => callback(data));\n    }\n  }\n}\n\nconst emitter = new TypedEventEmitter\u003CEventMap>();\n\nemitter.on(\"user:created\", (data) => {\n  console.log(data.id, data.name); \u002F\u002F Type-safe!\n});\n\nemitter.emit(\"user:created\", { id: \"1\", name: \"John\" });\n\u002F\u002F emitter.emit(\"user:created\", { id: \"1\" });  \u002F\u002F Error: missing 'name'\n```\n\n### Pattern 2: Type-Safe API Client\n\n```typescript\ntype HTTPMethod = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\ntype EndpointConfig = {\n  \"\u002Fusers\": {\n    GET: { response: User[] };\n    POST: { body: { name: string; email: string }; response: User };\n  };\n  \"\u002Fusers\u002F:id\": {\n    GET: { params: { id: string }; response: User };\n    PUT: { params: { id: string }; body: Partial\u003CUser>; response: User };\n    DELETE: { params: { id: string }; response: void };\n  };\n};\n\ntype ExtractParams\u003CT> = T extends { params: infer P } ? P : never;\ntype ExtractBody\u003CT> = T extends { body: infer B } ? B : never;\ntype ExtractResponse\u003CT> = T extends { response: infer R } ? R : never;\n\nclass APIClient\u003CConfig extends Record\u003Cstring, Record\u003CHTTPMethod, any>>> {\n  async request\u003CPath extends keyof Config, Method extends keyof Config[Path]>(\n    path: Path,\n    method: Method,\n    ...[options]: ExtractParams\u003CConfig[Path][Method]> extends never\n      ? ExtractBody\u003CConfig[Path][Method]> extends never\n        ? []\n        : [{ body: ExtractBody\u003CConfig[Path][Method]> }]\n      : [\n          {\n            params: ExtractParams\u003CConfig[Path][Method]>;\n            body?: ExtractBody\u003CConfig[Path][Method]>;\n          },\n        ]\n  ): Promise\u003CExtractResponse\u003CConfig[Path][Method]>> {\n    \u002F\u002F Implementation here\n    return {} as any;\n  }\n}\n\nconst api = new APIClient\u003CEndpointConfig>();\n\n\u002F\u002F Type-safe API calls\nconst users = await api.request(\"\u002Fusers\", \"GET\");\n\u002F\u002F Type: User[]\n\nconst newUser = await api.request(\"\u002Fusers\", \"POST\", {\n  body: { name: \"John\", email: \"john@example.com\" },\n});\n\u002F\u002F Type: User\n\nconst user = await api.request(\"\u002Fusers\u002F:id\", \"GET\", {\n  params: { id: \"123\" },\n});\n\u002F\u002F Type: User\n```\n\n### Pattern 3: Builder Pattern with Type Safety\n\n```typescript\ntype BuilderState\u003CT> = {\n  [K in keyof T]: T[K] | undefined;\n};\n\ntype RequiredKeys\u003CT> = {\n  [K in keyof T]-?: {} extends Pick\u003CT, K> ? never : K;\n}[keyof T];\n\ntype OptionalKeys\u003CT> = {\n  [K in keyof T]-?: {} extends Pick\u003CT, K> ? K : never;\n}[keyof T];\n\ntype IsComplete\u003CT, S> =\n  RequiredKeys\u003CT> extends keyof S\n    ? S[RequiredKeys\u003CT>] extends undefined\n      ? false\n      : true\n    : false;\n\nclass Builder\u003CT, S extends BuilderState\u003CT> = {}> {\n  private state: S = {} as S;\n\n  set\u003CK extends keyof T>(key: K, value: T[K]): Builder\u003CT, S & Record\u003CK, T[K]>> {\n    this.state[key] = value;\n    return this as any;\n  }\n\n  build(this: IsComplete\u003CT, S> extends true ? this : never): T {\n    return this.state as T;\n  }\n}\n\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  age?: number;\n}\n\nconst builder = new Builder\u003CUser>();\n\nconst user = builder\n  .set(\"id\", \"1\")\n  .set(\"name\", \"John\")\n  .set(\"email\", \"john@example.com\")\n  .build(); \u002F\u002F OK: all required fields set\n\n\u002F\u002F const incomplete = builder\n\u002F\u002F   .set(\"id\", \"1\")\n\u002F\u002F   .build();  \u002F\u002F Error: missing required fields\n```\n\n### Pattern 4: Deep Readonly\u002FPartial\n\n```typescript\ntype DeepReadonly\u003CT> = {\n  readonly [P in keyof T]: T[P] extends object\n    ? T[P] extends Function\n      ? T[P]\n      : DeepReadonly\u003CT[P]>\n    : T[P];\n};\n\ntype DeepPartial\u003CT> = {\n  [P in keyof T]?: T[P] extends object\n    ? T[P] extends Array\u003Cinfer U>\n      ? Array\u003CDeepPartial\u003CU>>\n      : DeepPartial\u003CT[P]>\n    : T[P];\n};\n\ninterface Config {\n  server: {\n    host: string;\n    port: number;\n    ssl: {\n      enabled: boolean;\n      cert: string;\n    };\n  };\n  database: {\n    url: string;\n    pool: {\n      min: number;\n      max: number;\n    };\n  };\n}\n\ntype ReadonlyConfig = DeepReadonly\u003CConfig>;\n\u002F\u002F All nested properties are readonly\n\ntype PartialConfig = DeepPartial\u003CConfig>;\n\u002F\u002F All nested properties are optional\n```\n\n### Pattern 5: Type-Safe Form Validation\n\n```typescript\ntype ValidationRule\u003CT> = {\n  validate: (value: T) => boolean;\n  message: string;\n};\n\ntype FieldValidation\u003CT> = {\n  [K in keyof T]?: ValidationRule\u003CT[K]>[];\n};\n\ntype ValidationErrors\u003CT> = {\n  [K in keyof T]?: string[];\n};\n\nclass FormValidator\u003CT extends Record\u003Cstring, any>> {\n  constructor(private rules: FieldValidation\u003CT>) {}\n\n  validate(data: T): ValidationErrors\u003CT> | null {\n    const errors: ValidationErrors\u003CT> = {};\n    let hasErrors = false;\n\n    for (const key in this.rules) {\n      const fieldRules = this.rules[key];\n      const value = data[key];\n\n      if (fieldRules) {\n        const fieldErrors: string[] = [];\n\n        for (const rule of fieldRules) {\n          if (!rule.validate(value)) {\n            fieldErrors.push(rule.message);\n          }\n        }\n\n        if (fieldErrors.length > 0) {\n          errors[key] = fieldErrors;\n          hasErrors = true;\n        }\n      }\n    }\n\n    return hasErrors ? errors : null;\n  }\n}\n\ninterface LoginForm {\n  email: string;\n  password: string;\n}\n\nconst validator = new FormValidator\u003CLoginForm>({\n  email: [\n    {\n      validate: (v) => v.includes(\"@\"),\n      message: \"Email must contain @\",\n    },\n    {\n      validate: (v) => v.length > 0,\n      message: \"Email is required\",\n    },\n  ],\n  password: [\n    {\n      validate: (v) => v.length >= 8,\n      message: \"Password must be at least 8 characters\",\n    },\n  ],\n});\n\nconst errors = validator.validate({\n  email: \"invalid\",\n  password: \"short\",\n});\n\u002F\u002F Type: { email?: string[]; password?: string[]; } | null\n```\n\n### Pattern 6: Discriminated Unions\n\n```typescript\ntype Success\u003CT> = {\n  status: \"success\";\n  data: T;\n};\n\ntype Error = {\n  status: \"error\";\n  error: string;\n};\n\ntype Loading = {\n  status: \"loading\";\n};\n\ntype AsyncState\u003CT> = Success\u003CT> | Error | Loading;\n\nfunction handleState\u003CT>(state: AsyncState\u003CT>): void {\n  switch (state.status) {\n    case \"success\":\n      console.log(state.data); \u002F\u002F Type: T\n      break;\n    case \"error\":\n      console.log(state.error); \u002F\u002F Type: string\n      break;\n    case \"loading\":\n      console.log(\"Loading...\");\n      break;\n  }\n}\n\n\u002F\u002F Type-safe state machine\ntype State =\n  | { type: \"idle\" }\n  | { type: \"fetching\"; requestId: string }\n  | { type: \"success\"; data: any }\n  | { type: \"error\"; error: Error };\n\ntype Event =\n  | { type: \"FETCH\"; requestId: string }\n  | { type: \"SUCCESS\"; data: any }\n  | { type: \"ERROR\"; error: Error }\n  | { type: \"RESET\" };\n\nfunction reducer(state: State, event: Event): State {\n  switch (state.type) {\n    case \"idle\":\n      return event.type === \"FETCH\"\n        ? { type: \"fetching\", requestId: event.requestId }\n        : state;\n    case \"fetching\":\n      if (event.type === \"SUCCESS\") {\n        return { type: \"success\", data: event.data };\n      }\n      if (event.type === \"ERROR\") {\n        return { type: \"error\", error: event.error };\n      }\n      return state;\n    case \"success\":\n    case \"error\":\n      return event.type === \"RESET\" ? { type: \"idle\" } : state;\n  }\n}\n```\n\n## Type Inference Techniques\n\n### 1. Infer Keyword\n\n```typescript\n\u002F\u002F Extract array element type\ntype ElementType\u003CT> = T extends (infer U)[] ? U : never;\n\ntype NumArray = number[];\ntype Num = ElementType\u003CNumArray>; \u002F\u002F number\n\n\u002F\u002F Extract promise type\ntype PromiseType\u003CT> = T extends Promise\u003Cinfer U> ? U : never;\n\ntype AsyncNum = PromiseType\u003CPromise\u003Cnumber>>; \u002F\u002F number\n\n\u002F\u002F Extract function parameters\ntype Parameters\u003CT> = T extends (...args: infer P) => any ? P : never;\n\nfunction foo(a: string, b: number) {}\ntype FooParams = Parameters\u003Ctypeof foo>; \u002F\u002F [string, number]\n```\n\n### 2. Type Guards\n\n```typescript\nfunction isString(value: unknown): value is string {\n  return typeof value === \"string\";\n}\n\nfunction isArrayOf\u003CT>(\n  value: unknown,\n  guard: (item: unknown) => item is T,\n): value is T[] {\n  return Array.isArray(value) && value.every(guard);\n}\n\nconst data: unknown = [\"a\", \"b\", \"c\"];\n\nif (isArrayOf(data, isString)) {\n  data.forEach((s) => s.toUpperCase()); \u002F\u002F Type: string[]\n}\n```\n\n### 3. Assertion Functions\n\n```typescript\nfunction assertIsString(value: unknown): asserts value is string {\n  if (typeof value !== \"string\") {\n    throw new Error(\"Not a string\");\n  }\n}\n\nfunction processValue(value: unknown) {\n  assertIsString(value);\n  \u002F\u002F value is now typed as string\n  console.log(value.toUpperCase());\n}\n```\n\n## Best Practices\n\n1. **Use `unknown` over `any`**: Enforce type checking\n2. **Prefer `interface` for object shapes**: Better error messages\n3. **Use `type` for unions and complex types**: More flexible\n4. **Leverage type inference**: Let TypeScript infer when possible\n5. **Create helper types**: Build reusable type utilities\n6. **Use const assertions**: Preserve literal types\n7. **Avoid type assertions**: Use type guards instead\n8. **Document complex types**: Add JSDoc comments\n9. **Use strict mode**: Enable all strict compiler options\n10. **Test your types**: Use type tests to verify type behavior\n\n## Type Testing\n\n```typescript\n\u002F\u002F Type assertion tests\ntype AssertEqual\u003CT, U> = [T] extends [U]\n  ? [U] extends [T]\n    ? true\n    : false\n  : false;\n\ntype Test1 = AssertEqual\u003Cstring, string>; \u002F\u002F true\ntype Test2 = AssertEqual\u003Cstring, number>; \u002F\u002F false\ntype Test3 = AssertEqual\u003Cstring | number, string>; \u002F\u002F false\n\n\u002F\u002F Expect error helper\ntype ExpectError\u003CT extends never> = T;\n\n\u002F\u002F Example usage\ntype ShouldError = ExpectError\u003CAssertEqual\u003Cstring, number>>;\n```\n\n## Common Pitfalls\n\n1. **Over-using `any`**: Defeats the purpose of TypeScript\n2. **Ignoring strict null checks**: Can lead to runtime errors\n3. **Too complex types**: Can slow down compilation\n4. **Not using discriminated unions**: Misses type narrowing opportunities\n5. **Forgetting readonly modifiers**: Allows unintended mutations\n6. **Circular type references**: Can cause compiler errors\n7. **Not handling edge cases**: Like empty arrays or null values\n\n## Performance Considerations\n\n- Avoid deeply nested conditional types\n- Use simple types when possible\n- Cache complex type computations\n- Limit recursion depth in recursive types\n- Use build tools to skip type checking in production\n\n## Resources\n\n- **TypeScript Handbook**: https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F\n- **Type Challenges**: https:\u002F\u002Fgithub.com\u002Ftype-challenges\u002Ftype-challenges\n- **TypeScript Deep Dive**: https:\u002F\u002Fbasarat.gitbook.io\u002Ftypescript\u002F\n- **Effective TypeScript**: Book by Dan Vanderkam\n","# TypeScript Advanced Types\n\nComprehensive guidance for mastering TypeScript's advanced type system including generics, conditional types, mapped types, template literal types, and utility types for building robust, type-safe applications.\n\n## When to Use This Skill\n\n- Building type-safe libraries or frameworks\n- Creating reusable generic components\n- Implementing complex type inference logic\n- Designing type-safe API clients\n- Building form validation systems\n- Creating strongly-typed configuration objects\n- Implementing type-safe state management\n- Migrating JavaScript codebases to TypeScript\n\n## Core Concepts\n\n### 1. Generics\n\n**Purpose:** Create reusable, type-flexible components while maintaining type safety.\n\n**Basic Generic Function:**\n\n```typescript\nfunction identity\u003CT>(value: T): T {\n  return value;\n}\n\nconst num = identity\u003Cnumber>(42); \u002F\u002F Type: number\nconst str = identity\u003Cstring>(\"hello\"); \u002F\u002F Type: string\nconst auto = identity(true); \u002F\u002F Type inferred: boolean\n```\n\n**Generic Constraints:**\n\n```typescript\ninterface HasLength {\n  length: number;\n}\n\nfunction logLength\u003CT extends HasLength>(item: T): T {\n  console.log(item.length);\n  return item;\n}\n\nlogLength(\"hello\"); \u002F\u002F OK: string has length\nlogLength([1, 2, 3]); \u002F\u002F OK: array has length\nlogLength({ length: 10 }); \u002F\u002F OK: object has length\n\u002F\u002F logLength(42);             \u002F\u002F Error: number has no length\n```\n\n**Multiple Type Parameters:**\n\n```typescript\nfunction merge\u003CT, U>(obj1: T, obj2: U): T & U {\n  return { ...obj1, ...obj2 };\n}\n\nconst merged = merge({ name: \"John\" }, { age: 30 });\n\u002F\u002F Type: { name: string } & { age: number }\n```\n\n### 2. Conditional Types\n\n**Purpose:** Create types that depend on conditions, enabling sophisticated type logic.\n\n**Basic Conditional Type:**\n\n```typescript\ntype IsString\u003CT> = T extends string ? true : false;\n\ntype A = IsString\u003Cstring>; \u002F\u002F true\ntype B = IsString\u003Cnumber>; \u002F\u002F false\n```\n\n**Extracting Return Types:**\n\n```typescript\ntype ReturnType\u003CT> = T extends (...args: any[]) => infer R ? R : never;\n\nfunction getUser() {\n  return { id: 1, name: \"John\" };\n}\n\ntype User = ReturnType\u003Ctypeof getUser>;\n\u002F\u002F Type: { id: number; name: string; }\n```\n\n**Distributive Conditional Types:**\n\n```typescript\ntype ToArray\u003CT> = T extends any ? T[] : never;\n\ntype StrOrNumArray = ToArray\u003Cstring | number>;\n\u002F\u002F Type: string[] | number[]\n```\n\n**Nested Conditions:**\n\n```typescript\ntype TypeName\u003CT> = T extends string\n  ? \"string\"\n  : T extends number\n    ? \"number\"\n    : T extends boolean\n      ? \"boolean\"\n      : T extends undefined\n        ? \"undefined\"\n        : T extends Function\n          ? \"function\"\n          : \"object\";\n\ntype T1 = TypeName\u003Cstring>; \u002F\u002F \"string\"\ntype T2 = TypeName\u003C() => void>; \u002F\u002F \"function\"\n```\n\n### 3. Mapped Types\n\n**Purpose:** Transform existing types by iterating over their properties.\n\n**Basic Mapped Type:**\n\n```typescript\ntype Readonly\u003CT> = {\n  readonly [P in keyof T]: T[P];\n};\n\ninterface User {\n  id: number;\n  name: string;\n}\n\ntype ReadonlyUser = Readonly\u003CUser>;\n\u002F\u002F Type: { readonly id: number; readonly name: string; }\n```\n\n**Optional Properties:**\n\n```typescript\ntype Partial\u003CT> = {\n  [P in keyof T]?: T[P];\n};\n\ntype PartialUser = Partial\u003CUser>;\n\u002F\u002F Type: { id?: number; name?: string; }\n```\n\n**Key Remapping:**\n\n```typescript\ntype Getters\u003CT> = {\n  [K in keyof T as `get${Capitalize\u003Cstring & K>}`]: () => T[K];\n};\n\ninterface Person {\n  name: string;\n  age: number;\n}\n\ntype PersonGetters = Getters\u003CPerson>;\n\u002F\u002F Type: { getName: () => string; getAge: () => number; }\n```\n\n**Filtering Properties:**\n\n```typescript\ntype PickByType\u003CT, U> = {\n  [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\ninterface Mixed {\n  id: number;\n  name: string;\n  age: number;\n  active: boolean;\n}\n\ntype OnlyNumbers = PickByType\u003CMixed, number>;\n\u002F\u002F Type: { id: number; age: number; }\n```\n\n### 4. Template Literal Types\n\n**Purpose:** Create string-based types with pattern matching and transformation.\n\n**Basic Template Literal:**\n\n```typescript\ntype EventName = \"click\" | \"focus\" | \"blur\";\ntype EventHandler = `on${Capitalize\u003CEventName>}`;\n\u002F\u002F Type: \"onClick\" | \"onFocus\" | \"onBlur\"\n```\n\n**String Manipulation:**\n\n```typescript\ntype UppercaseGreeting = Uppercase\u003C\"hello\">; \u002F\u002F \"HELLO\"\ntype LowercaseGreeting = Lowercase\u003C\"HELLO\">; \u002F\u002F \"hello\"\ntype CapitalizedName = Capitalize\u003C\"john\">; \u002F\u002F \"John\"\ntype UncapitalizedName = Uncapitalize\u003C\"John\">; \u002F\u002F \"john\"\n```\n\n**Path Building:**\n\n```typescript\ntype Path\u003CT> = T extends object\n  ? {\n      [K in keyof T]: K extends string ? `${K}` | `${K}.${Path\u003CT[K]>}` : never;\n    }[keyof T]\n  : never;\n\ninterface Config {\n  server: {\n    host: string;\n    port: number;\n  };\n  database: {\n    url: string;\n  };\n}\n\ntype ConfigPath = Path\u003CConfig>;\n\u002F\u002F Type: \"server\" | \"database\" | \"server.host\" | \"server.port\" | \"database.url\"\n```\n\n### 5. Utility Types\n\n**Built-in Utility Types:**\n\n```typescript\n\u002F\u002F Partial\u003CT> - Make all properties optional\ntype PartialUser = Partial\u003CUser>;\n\n\u002F\u002F Required\u003CT> - Make all properties required\ntype RequiredUser = Required\u003CPartialUser>;\n\n\u002F\u002F Readonly\u003CT> - Make all properties readonly\ntype ReadonlyUser = Readonly\u003CUser>;\n\n\u002F\u002F Pick\u003CT, K> - Select specific properties\ntype UserName = Pick\u003CUser, \"name\" | \"email\">;\n\n\u002F\u002F Omit\u003CT, K> - Remove specific properties\ntype UserWithoutPassword = Omit\u003CUser, \"password\">;\n\n\u002F\u002F Exclude\u003CT, U> - Exclude types from union\ntype T1 = Exclude\u003C\"a\" | \"b\" | \"c\", \"a\">; \u002F\u002F \"b\" | \"c\"\n\n\u002F\u002F Extract\u003CT, U> - Extract types from union\ntype T2 = Extract\u003C\"a\" | \"b\" | \"c\", \"a\" | \"b\">; \u002F\u002F \"a\" | \"b\"\n\n\u002F\u002F NonNullable\u003CT> - Exclude null and undefined\ntype T3 = NonNullable\u003Cstring | null | undefined>; \u002F\u002F string\n\n\u002F\u002F Record\u003CK, T> - Create object type with keys K and values T\ntype PageInfo = Record\u003C\"home\" | \"about\", { title: string }>;\n```\n\n## Advanced Patterns\n\n### Pattern 1: Type-Safe Event Emitter\n\n```typescript\ntype EventMap = {\n  \"user:created\": { id: string; name: string };\n  \"user:updated\": { id: string };\n  \"user:deleted\": { id: string };\n};\n\nclass TypedEventEmitter\u003CT extends Record\u003Cstring, any>> {\n  private listeners: {\n    [K in keyof T]?: Array\u003C(data: T[K]) => void>;\n  } = {};\n\n  on\u003CK extends keyof T>(event: K, callback: (data: T[K]) => void): void {\n    if (!this.listeners[event]) {\n      this.listeners[event] = [];\n    }\n    this.listeners[event]!.push(callback);\n  }\n\n  emit\u003CK extends keyof T>(event: K, data: T[K]): void {\n    const callbacks = this.listeners[event];\n    if (callbacks) {\n      callbacks.forEach((callback) => callback(data));\n    }\n  }\n}\n\nconst emitter = new TypedEventEmitter\u003CEventMap>();\n\nemitter.on(\"user:created\", (data) => {\n  console.log(data.id, data.name); \u002F\u002F Type-safe!\n});\n\nemitter.emit(\"user:created\", { id: \"1\", name: \"John\" });\n\u002F\u002F emitter.emit(\"user:created\", { id: \"1\" });  \u002F\u002F Error: missing 'name'\n```\n\n### Pattern 2: Type-Safe API Client\n\n```typescript\ntype HTTPMethod = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\ntype EndpointConfig = {\n  \"\u002Fusers\": {\n    GET: { response: User[] };\n    POST: { body: { name: string; email: string }; response: User };\n  };\n  \"\u002Fusers\u002F:id\": {\n    GET: { params: { id: string }; response: User };\n    PUT: { params: { id: string }; body: Partial\u003CUser>; response: User };\n    DELETE: { params: { id: string }; response: void };\n  };\n};\n\ntype ExtractParams\u003CT> = T extends { params: infer P } ? P : never;\ntype ExtractBody\u003CT> = T extends { body: infer B } ? B : never;\ntype ExtractResponse\u003CT> = T extends { response: infer R } ? R : never;\n\nclass APIClient\u003CConfig extends Record\u003Cstring, Record\u003CHTTPMethod, any>>> {\n  async request\u003CPath extends keyof Config, Method extends keyof Config[Path]>(\n    path: Path,\n    method: Method,\n    ...[options]: ExtractParams\u003CConfig[Path][Method]> extends never\n      ? ExtractBody\u003CConfig[Path][Method]> extends never\n        ? []\n        : [{ body: ExtractBody\u003CConfig[Path][Method]> }]\n      : [\n          {\n            params: ExtractParams\u003CConfig[Path][Method]>;\n            body?: ExtractBody\u003CConfig[Path][Method]>;\n          },\n        ]\n  ): Promise\u003CExtractResponse\u003CConfig[Path][Method]>> {\n    \u002F\u002F Implementation here\n    return {} as any;\n  }\n}\n\nconst api = new APIClient\u003CEndpointConfig>();\n\n\u002F\u002F Type-safe API calls\nconst users = await api.request(\"\u002Fusers\", \"GET\");\n\u002F\u002F Type: User[]\n\nconst newUser = await api.request(\"\u002Fusers\", \"POST\", {\n  body: { name: \"John\", email: \"john@example.com\" },\n});\n\u002F\u002F Type: User\n\nconst user = await api.request(\"\u002Fusers\u002F:id\", \"GET\", {\n  params: { id: \"123\" },\n});\n\u002F\u002F Type: User\n```\n\n### Pattern 3: Builder Pattern with Type Safety\n\n```typescript\ntype BuilderState\u003CT> = {\n  [K in keyof T]: T[K] | undefined;\n};\n\ntype RequiredKeys\u003CT> = {\n  [K in keyof T]-?: {} extends Pick\u003CT, K> ? never : K;\n}[keyof T];\n\ntype OptionalKeys\u003CT> = {\n  [K in keyof T]-?: {} extends Pick\u003CT, K> ? K : never;\n}[keyof T];\n\ntype IsComplete\u003CT, S> =\n  RequiredKeys\u003CT> extends keyof S\n    ? S[RequiredKeys\u003CT>] extends undefined\n      ? false\n      : true\n    : false;\n\nclass Builder\u003CT, S extends BuilderState\u003CT> = {}> {\n  private state: S = {} as S;\n\n  set\u003CK extends keyof T>(key: K, value: T[K]): Builder\u003CT, S & Record\u003CK, T[K]>> {\n    this.state[key] = value;\n    return this as any;\n  }\n\n  build(this: IsComplete\u003CT, S> extends true ? this : never): T {\n    return this.state as T;\n  }\n}\n\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  age?: number;\n}\n\nconst builder = new Builder\u003CUser>();\n\nconst user = builder\n  .set(\"id\", \"1\")\n  .set(\"name\", \"John\")\n  .set(\"email\", \"john@example.com\")\n  .build(); \u002F\u002F OK: all required fields set\n\n\u002F\u002F const incomplete = builder\n\u002F\u002F   .set(\"id\", \"1\")\n\u002F\u002F   .build();  \u002F\u002F Error: missing required fields\n```\n\n### Pattern 4: Deep Readonly\u002FPartial\n\n```typescript\ntype DeepReadonly\u003CT> = {\n  readonly [P in keyof T]: T[P] extends object\n    ? T[P] extends Function\n      ? T[P]\n      : DeepReadonly\u003CT[P]>\n    : T[P];\n};\n\ntype DeepPartial\u003CT> = {\n  [P in keyof T]?: T[P] extends object\n    ? T[P] extends Array\u003Cinfer U>\n      ? Array\u003CDeepPartial\u003CU>>\n      : DeepPartial\u003CT[P]>\n    : T[P];\n};\n\ninterface Config {\n  server: {\n    host: string;\n    port: number;\n    ssl: {\n      enabled: boolean;\n      cert: string;\n    };\n  };\n  database: {\n    url: string;\n    pool: {\n      min: number;\n      max: number;\n    };\n  };\n}\n\ntype ReadonlyConfig = DeepReadonly\u003CConfig>;\n\u002F\u002F All nested properties are readonly\n\ntype PartialConfig = DeepPartial\u003CConfig>;\n\u002F\u002F All nested properties are optional\n```\n\n### Pattern 5: Type-Safe Form Validation\n\n```typescript\ntype ValidationRule\u003CT> = {\n  validate: (value: T) => boolean;\n  message: string;\n};\n\ntype FieldValidation\u003CT> = {\n  [K in keyof T]?: ValidationRule\u003CT[K]>[];\n};\n\ntype ValidationErrors\u003CT> = {\n  [K in keyof T]?: string[];\n};\n\nclass FormValidator\u003CT extends Record\u003Cstring, any>> {\n  constructor(private rules: FieldValidation\u003CT>) {}\n\n  validate(data: T): ValidationErrors\u003CT> | null {\n    const errors: ValidationErrors\u003CT> = {};\n    let hasErrors = false;\n\n    for (const key in this.rules) {\n      const fieldRules = this.rules[key];\n      const value = data[key];\n\n      if (fieldRules) {\n        const fieldErrors: string[] = [];\n\n        for (const rule of fieldRules) {\n          if (!rule.validate(value)) {\n            fieldErrors.push(rule.message);\n          }\n        }\n\n        if (fieldErrors.length > 0) {\n          errors[key] = fieldErrors;\n          hasErrors = true;\n        }\n      }\n    }\n\n    return hasErrors ? errors : null;\n  }\n}\n\ninterface LoginForm {\n  email: string;\n  password: string;\n}\n\nconst validator = new FormValidator\u003CLoginForm>({\n  email: [\n    {\n      validate: (v) => v.includes(\"@\"),\n      message: \"Email must contain @\",\n    },\n    {\n      validate: (v) => v.length > 0,\n      message: \"Email is required\",\n    },\n  ],\n  password: [\n    {\n      validate: (v) => v.length >= 8,\n      message: \"Password must be at least 8 characters\",\n    },\n  ],\n});\n\nconst errors = validator.validate({\n  email: \"invalid\",\n  password: \"short\",\n});\n\u002F\u002F Type: { email?: string[]; password?: string[]; } | null\n```\n\n### Pattern 6: Discriminated Unions\n\n```typescript\ntype Success\u003CT> = {\n  status: \"success\";\n  data: T;\n};\n\ntype Error = {\n  status: \"error\";\n  error: string;\n};\n\ntype Loading = {\n  status: \"loading\";\n};\n\ntype AsyncState\u003CT> = Success\u003CT> | Error | Loading;\n\nfunction handleState\u003CT>(state: AsyncState\u003CT>): void {\n  switch (state.status) {\n    case \"success\":\n      console.log(state.data); \u002F\u002F Type: T\n      break;\n    case \"error\":\n      console.log(state.error); \u002F\u002F Type: string\n      break;\n    case \"loading\":\n      console.log(\"Loading...\");\n      break;\n  }\n}\n\n\u002F\u002F Type-safe state machine\ntype State =\n  | { type: \"idle\" }\n  | { type: \"fetching\"; requestId: string }\n  | { type: \"success\"; data: any }\n  | { type: \"error\"; error: Error };\n\ntype Event =\n  | { type: \"FETCH\"; requestId: string }\n  | { type: \"SUCCESS\"; data: any }\n  | { type: \"ERROR\"; error: Error }\n  | { type: \"RESET\" };\n\nfunction reducer(state: State, event: Event): State {\n  switch (state.type) {\n    case \"idle\":\n      return event.type === \"FETCH\"\n        ? { type: \"fetching\", requestId: event.requestId }\n        : state;\n    case \"fetching\":\n      if (event.type === \"SUCCESS\") {\n        return { type: \"success\", data: event.data };\n      }\n      if (event.type === \"ERROR\") {\n        return { type: \"error\", error: event.error };\n      }\n      return state;\n    case \"success\":\n    case \"error\":\n      return event.type === \"RESET\" ? { type: \"idle\" } : state;\n  }\n}\n```\n\n## Type Inference Techniques\n\n### 1. Infer Keyword\n\n```typescript\n\u002F\u002F Extract array element type\ntype ElementType\u003CT> = T extends (infer U)[] ? U : never;\n\ntype NumArray = number[];\ntype Num = ElementType\u003CNumArray>; \u002F\u002F number\n\n\u002F\u002F Extract promise type\ntype PromiseType\u003CT> = T extends Promise\u003Cinfer U> ? U : never;\n\ntype AsyncNum = PromiseType\u003CPromise\u003Cnumber>>; \u002F\u002F number\n\n\u002F\u002F Extract function parameters\ntype Parameters\u003CT> = T extends (...args: infer P) => any ? P : never;\n\nfunction foo(a: string, b: number) {}\ntype FooParams = Parameters\u003Ctypeof foo>; \u002F\u002F [string, number]\n```\n\n### 2. Type Guards\n\n```typescript\nfunction isString(value: unknown): value is string {\n  return typeof value === \"string\";\n}\n\nfunction isArrayOf\u003CT>(\n  value: unknown,\n  guard: (item: unknown) => item is T,\n): value is T[] {\n  return Array.isArray(value) && value.every(guard);\n}\n\nconst data: unknown = [\"a\", \"b\", \"c\"];\n\nif (isArrayOf(data, isString)) {\n  data.forEach((s) => s.toUpperCase()); \u002F\u002F Type: string[]\n}\n```\n\n### 3. Assertion Functions\n\n```typescript\nfunction assertIsString(value: unknown): asserts value is string {\n  if (typeof value !== \"string\") {\n    throw new Error(\"Not a string\");\n  }\n}\n\nfunction processValue(value: unknown) {\n  assertIsString(value);\n  \u002F\u002F value is now typed as string\n  console.log(value.toUpperCase());\n}\n```\n\n## Best Practices\n\n1. **Use `unknown` over `any`**: Enforce type checking\n2. **Prefer `interface` for object shapes**: Better error messages\n3. **Use `type` for unions and complex types**: More flexible\n4. **Leverage type inference**: Let TypeScript infer when possible\n5. **Create helper types**: Build reusable type utilities\n6. **Use const assertions**: Preserve literal types\n7. **Avoid type assertions**: Use type guards instead\n8. **Document complex types**: Add JSDoc comments\n9. **Use strict mode**: Enable all strict compiler options\n10. **Test your types**: Use type tests to verify type behavior\n\n## Type Testing\n\n```typescript\n\u002F\u002F Type assertion tests\ntype AssertEqual\u003CT, U> = [T] extends [U]\n  ? [U] extends [T]\n    ? true\n    : false\n  : false;\n\ntype Test1 = AssertEqual\u003Cstring, string>; \u002F\u002F true\ntype Test2 = AssertEqual\u003Cstring, number>; \u002F\u002F false\ntype Test3 = AssertEqual\u003Cstring | number, string>; \u002F\u002F false\n\n\u002F\u002F Expect error helper\ntype ExpectError\u003CT extends never> = T;\n\n\u002F\u002F Example usage\ntype ShouldError = ExpectError\u003CAssertEqual\u003Cstring, number>>;\n```\n\n## Common Pitfalls\n\n1. **Over-using `any`**: Defeats the purpose of TypeScript\n2. **Ignoring strict null checks**: Can lead to runtime errors\n3. **Too complex types**: Can slow down compilation\n4. **Not using discriminated unions**: Misses type narrowing opportunities\n5. **Forgetting readonly modifiers**: Allows unintended mutations\n6. **Circular type references**: Can cause compiler errors\n7. **Not handling edge cases**: Like empty arrays or null values\n\n## Performance Considerations\n\n- Avoid deeply nested conditional types\n- Use simple types when possible\n- Cache complex type computations\n- Limit recursion depth in recursive types\n- Use build tools to skip type checking in production\n\n## Resources\n\n- **TypeScript Handbook**: https:\u002F\u002Fwww.typescriptlang.org\u002Fdocs\u002Fhandbook\u002F\n- **Type Challenges**: https:\u002F\u002Fgithub.com\u002Ftype-challenges\u002Ftype-challenges\n- **TypeScript Deep Dive**: https:\u002F\u002Fbasarat.gitbook.io\u002Ftypescript\u002F\n- **Effective TypeScript**: Book by Dan Vanderkam\n",{"name":5,"description":7},"main","2390b741d6daa7385cfb01fe351f64305cda49d5",".opencode\u002Fskills\u002Ftypescript-advanced-types",2,"https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit","https:\u002F\u002Fgithub.com\u002Fdibstern","Software Engineer at Renowned, ex-Rome2Rio","2026-10-29 15:51:30",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add dibstern\u002Fconduit --skill typescript-advanced-types",{"tool":58,"command":59},"bunx","bunx skills add dibstern\u002Fconduit --skill typescript-advanced-types",{"tool":61,"command":62},"pnpm","pnpm dlx skills add dibstern\u002Fconduit --skill typescript-advanced-types","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ftypescript-advanced-types\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},".skillfish.json","REFERENCE","参考文档",264,"https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ftypescript-advanced-types\u002F.skillfish.json",[73,88,99,116,123,148],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":39},"01M6ENE9PDF6ZTQ0HN0M2NY8YN","release-notes","Drafts release notes. Fixture skill for conduit's recorded skill-loads-turn trace.","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fclaude-sdk-traces\u002Fskill-loads-turn-skills\u002Frelease-notes\u002FSKILL.md",[],[80,81,82,83,84,85,86,87],"notes","release notes","release","loads","conduit","trace","fixture skill","fixture",{"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":39},"01M6ENE72EV36TVDA9A00WHZWP","changelog-style","House style for changelog entries. Fixture skill for conduit's recorded skill-loads-turn trace.","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fclaude-sdk-traces\u002Fskill-loads-turn-skills\u002Fchangelog-style\u002FSKILL.md",[],[95,96,97,84,85,86,98,87,83],"changelog","style","changelog style","entries",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":39},"01M6ENDWT23VWB5YJBXZFBRYRZ","sveltekit-svelte5-tailwind-skill","Comprehensive integration skill for building sites with SvelteKit 2, Svelte 5, and Tailwind CSS v4","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fsveltekit-svelte5-tailwind-skill\u002FSKILL.md",[],[106,107,108,109,110,111,112,113,114,115],"sveltekit svelte5 tailwind skill","sveltekit","Tailwind","integration","only","svelte 5","Tailwind CSS","css","svelte","sites",{"skillNo":117,"name":118,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":39},"01M6ENDSRWQ1XYJECFESE5R7EH","svelte5-inspect","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fsvelte5-inspect\u002FSKILL.md",[],[122],"svelte5 inspect",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":39},"01M6ENDNVCSJ87AD76V5QTKG49","playwright-cli","Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fplaywright-cli\u002FSKILL.md",[],[130,131,132,133,134,135,136,137,138,139,140,141,24,142,143,28,144,145,146,147],"playwright","cli","playwright cli","Data Extraction","form","pages","testing","screenshots","test","web","browser","data","Bash","extract","take","test web","web testing","forms",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":39},"01M6ENDJC6HDRGJXJ3Y5PZPTWM","modern-javascript-patterns","Master ES6+ features including async\u002Fawait, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for writing clean, efficient JavaScript code. Use when refactoring legacy code, implementing modern patterns, or optimizing JavaScript applications.","https:\u002F\u002Fgithub.com\u002Fdibstern\u002Fconduit\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fmodern-javascript-patterns\u002FSKILL.md",[],[155,156,157,158,159,160,161,24,162,163,28,164,165,166,167,29,168,169,170,171],"javascript","patterns","modern javascript patterns","writing","functional","code","functional programming","refactoring","programming","refactoring legacy code","modules","async","Legacy","clean","promises","operators","es6"]