算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
typescript-advanced-types【设计与创意】Master TypeScript's advanced type system — generics, conditional types, mapped types, template literals, and utility types — for building type-safe Angular 21.x components, NestJS 11.x APIs, and MCP Builder integrations. Use when implementing complex type inference, type-safe API clients, branded types, DeepPartial/DeepReadonly patterns, or migrating…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Iron Law: Before applying any type pattern, READ the actual TypeScript file first. Do not suggest type changes from memory — verify the actual code (file:line) before making any claim.
Create reusable, type-flexible components while maintaining type safety. Use generic constraints (T extends HasLength) to narrow what types are accepted. Supports multiple type parameters, default types, and conditional constraints. See playbook §1 for examples.
Create types that depend on conditions: T extends string ? true : false. Supports infer for extracting type components (e.g., return type, promise type, array element type). Distributive conditional types apply over union members automatically. See playbook §2 for examples.
Transform existing types by iterating over their properties with [P in keyof T]. Supports modifiers (readonly, ?), key remapping via as, and filtering properties by type. Enables patterns like Partial<T>, Readonly<T>, and Getters<T>. See playbook §3 for examples.
Create string-based types with pattern matching: `on${Capitalize<EventName>}`. Enables type-safe event names, path builders, getter/setter name generation. Built-in helpers: Uppercase, Lowercase, Capitalize, Uncapitalize. See playbook §4 for examples.
TypeScript's built-in transformation utilities: Partial<T>, Required<T>, Readonly<T>, Pick<T,K>, Omit<T,K>, Exclude<T,U>, Extract<T,U>, NonNullable<T>, Record<K,T>. Combine with custom mapped types for DeepPartial<T> and DeepReadonly<T>. See playbook §5 and Pattern 4 for examples.
| Stack | Applicable | Notes |
|---|---|---|
| Angular 21.x | Yes | Type-safe forms, component inputs, RxJS operator types, signal types |
| NestJS 11.x | Yes | Type-safe DTOs, guards, interceptors, Prisma query result types |
| MCP Builder (TypeScript) | Yes | Type-safe tool definitions, request/response contracts |
| Flutter / Dart | No | Dart has its own type system — use the flutter-mobile skill |
| Java / Spring Boot | No | Java generics differ significantly — use the java-spring-api skill |
| Python / FastAPI | No | Use Pydantic models via the python-dev skill |
resources/implementation-playbook.md contains full patterns, checklists, and code samples covering:
infer keyword, Type Guards, Assertion Functionsunknown over any, strict mode, type testing| Combine With | When |
|---|---|
nestjs-api | Typing NestJS DTOs, guards, interceptors, Prisma result shapes with advanced utility types |
angular-spa | Typing Angular reactive forms, component inputs/outputs, RxJS pipe operators |
mcp-builder | Defining type-safe tool schemas, strongly-typed request/response contracts for MCP tools |