typescript-advanced
Advanced TypeScript patterns including generics, conditional types, mapped types, template literals, and type guards
npx skills add rohitg00/awesome-claude-code-toolkit --skill typescript-advanced --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# TypeScript Advanced ## Generics with Constraints ```typescript interface HasId { id: string; } function findById<T extends HasId>(items: T[], id: string): T | undefined { return items.find(item => item.id === id); } function groupBy<T, K extends string | number>( items: T[], keyFn: (item: T) => K ): Record<K, T[]> { return items.reduce((acc, item) => { const key = keyFn(item); (acc[key] ??= []).push(item); return acc; }, {} as Record<K, T[]>); } type ApiResponse<T> = { data: T; meta: { page: number; total: number }; }; async function fetchApi<T>(url: string): Promise<ApiResponse<T>> { const res = await fetch(url); return res.json(); } ``` ## Conditional Types ```typescript type IsString<T> = T extends string ? true : false; type Flatten<T> = T extends Array<infer U> ? U : T; type UnwrapPromise<T> = T extends Promise<infer U> ? UnwrapPromise<U> : T; type FunctionReturn<T> = T extends (...args: any[]) => infer R ? R : never; type ExtractRouteParams<T extends string> = T extends `${string}:${infer Param}/${infer Rest}` ? Param | ExtractRouteParams<Rest> : T extends `${string}:${infer Param}` ? Param : never; type Params = ExtractRouteParams<"/users/:userId/posts/:postId">; ``` ## Ma
- Generics with Constraints
- Conditional Types
- Mapped Types
- Discriminated Unions
- Type Guards
- Utility Type Combinations
- Anti-Patterns
- Checklist
What does the typescript-advanced skill do?
Advanced TypeScript patterns including generics, conditional types, mapped types, template literals, and type guards
How do I install it?
Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill typescript-advanced --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.