[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HRBAC431X9H1D435YT52WX":3,"skill-same:01M6HRBAC431X9H1D435YT52WX":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"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":6,"updatedAt":50,"install":51,"resources":64},"01M6HRBAC431X9H1D435YT52WX","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.","welflau\u002Fai-dev-system","welflau","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7010385?v=4","01M6HPTDGF18RFY07M229P8CTM","01M6HPTDMRMZCJPYBFEA9XVVYT",3,"MIT","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fjavascript-typescript\u002Fskills\u002Ftypescript-advanced-types\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"typescript","advanced","typescript advanced","types","typescript advanced types","applications","projects","system","template","master","Safety","type system","time","utility","Type Safety","compile","Utilities","safe","implementing","for","when","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```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```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```typescript\nfunction merge\u003CT, U>(obj1: T, obj2: U): T & U {\n  return { ...obj1, ...obj2 };\n}\n\nconst merged = merge(\n  { name: \"John\" },\n  { age: 30 }\n);\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```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```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```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```typescript\ntype TypeName\u003CT> =\n  T extends string ? \"string\" :\n  T extends number ? \"number\" :\n  T extends boolean ? \"boolean\" :\n  T extends undefined ? \"undefined\" :\n  T extends Function ? \"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```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```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```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```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```typescript\ntype EventName = \"click\" | \"focus\" | \"blur\";\ntype EventHandler = `on${Capitalize\u003CEventName>}`;\n\u002F\u002F Type: \"onClick\" | \"onFocus\" | \"onBlur\"\n```\n\n**String Manipulation:**\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```typescript\ntype Path\u003CT> = T extends object\n  ? { [K in keyof T]: K extends string\n      ? `${K}` | `${K}.${Path\u003CT[K]>}`\n      : 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\u003C\n    Path extends keyof Config,\n    Method extends keyof Config[Path]\n  >(\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          params: ExtractParams\u003CConfig[Path][Method]>;\n          body?: ExtractBody\u003CConfig[Path][Method]>;\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>(\n    key: K,\n    value: T[K]\n  ): Builder\u003CT, S & Record\u003CK, T[K]>> {\n    this.state[key] = value;\n    return this as any;\n  }\n\n  build(\n    this: IsComplete\u003CT, S> extends true ? this : never\n  ): 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> =\n  [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```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```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```typescript\nfunction merge\u003CT, U>(obj1: T, obj2: U): T & U {\n  return { ...obj1, ...obj2 };\n}\n\nconst merged = merge(\n  { name: \"John\" },\n  { age: 30 }\n);\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```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```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```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```typescript\ntype TypeName\u003CT> =\n  T extends string ? \"string\" :\n  T extends number ? \"number\" :\n  T extends boolean ? \"boolean\" :\n  T extends undefined ? \"undefined\" :\n  T extends Function ? \"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```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```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```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```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```typescript\ntype EventName = \"click\" | \"focus\" | \"blur\";\ntype EventHandler = `on${Capitalize\u003CEventName>}`;\n\u002F\u002F Type: \"onClick\" | \"onFocus\" | \"onBlur\"\n```\n\n**String Manipulation:**\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```typescript\ntype Path\u003CT> = T extends object\n  ? { [K in keyof T]: K extends string\n      ? `${K}` | `${K}.${Path\u003CT[K]>}`\n      : 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\u003C\n    Path extends keyof Config,\n    Method extends keyof Config[Path]\n  >(\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          params: ExtractParams\u003CConfig[Path][Method]>;\n          body?: ExtractBody\u003CConfig[Path][Method]>;\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>(\n    key: K,\n    value: T[K]\n  ): Builder\u003CT, S & Record\u003CK, T[K]>> {\n    this.state[key] = value;\n    return this as any;\n  }\n\n  build(\n    this: IsComplete\u003CT, S> extends true ? this : never\n  ): 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> =\n  [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","18d0e63d1313ca87098f614aa7c1e2dcf6de79c7","backend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fjavascript-typescript\u002Fskills\u002Ftypescript-advanced-types",1,"https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system","https:\u002F\u002Fgithub.com\u002Fwelflau","2026-11-12 14:55:20",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add welflau\u002Fai-dev-system --skill typescript-advanced-types",{"tool":57,"command":58},"bunx","bunx skills add welflau\u002Fai-dev-system --skill typescript-advanced-types",{"tool":60,"command":61},"pnpm","pnpm dlx skills add welflau\u002Fai-dev-system --skill typescript-advanced-types","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fjavascript-typescript\u002Fskills\u002Ftypescript-advanced-types\u002FSKILL.md",true,[],[66,91,118,143,163,187],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":71,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":90},"01M6HS9Z4B0YA8CJCS2Y2F04Y3","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fwebapp-testing\u002FSKILL.md",[],[75,76,77,78,79,80,81,82,83,84,85,86,23,87,88,89,37],"testing","webapp testing","webapp","frontend","screenshots","playwright","web","debugging","toolkit","browser","ui","logs","behavior","local","with","2026-11-11 15:11:14",{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":90},"01M6HRAGMG7JF0HXYHMA5QHS8A","internal-comms","A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Finternal-comms\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Finternal-comms\u002FSKILL.md",[],[99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],"internal comms","comms","status","help","SET","write","use","reports","me","incident","leadership","project","resources","communications","internal communications","formats","sort","my","updates",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":122,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":39},"01M6HSTDP4M3JFXEBK91VFB4PA","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Fweb-artifacts-builder\u002FSKILL.md",[],[126,81,127,128,129,78,130,131,132,133,134,135,136,137,105,138,139,140,141,37,142],"web artifacts builder","artifacts","artifacts builder","builder","css","components","react","routing","state management","state","file","Tailwind","single-file","simple","ui components","multi","single",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":147,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":39},"01M6HSDXH0JSP8R3QTNY9XZ8HN","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Ffrontend-design\u002FSKILL.md",[],[78,151,152,130,81,131,132,153,154,155,127,156,23,157,105,158,159,160,161,89,162,38],"design","frontend design","react components","create","code","examples","landing","ui design","pages","aesthetics","web ui","generic",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":167,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":39},"01M6HSA77QYVP7A72HREGTDN2C","algorithmic-art","Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Falgorithmic-art\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Falgorithmic-art\u002FSKILL.md",[],[171,172,173,154,155,174,175,176,177,105,178,179,180,181,89,182,183,184,185,186,38],"algorithmic art","Art","algorithmic","flow","js","work","interactive","generative art","exploration","systems","users","Existing","request","generative","copyright","fields",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":70,"licenseFileUrl":191,"sourceHtmlUrl":192,"categories":193,"keywords":194,"publishedAt":39},"01M6HS9HE0X390Y6RQKTY1YNGJ","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Ftheme-factory\u002FSKILL.md",[],[195,196,197,198,83,199,127,103,200,201,157,202,203,159,204,89,205,206,207,37,208,209],"theme factory","factory","theme","docs","generate","fly","slides","styling","artifact","themes","you","fonts","can","apply","new"]