Communitygithub.com

mcollina/typescript-magician

设计复杂的泛型类型,将 `any` 类型重构为严格的替代方案,创建类型守卫和工具类型,并解决 TypeScript 编译器错误。

typescript-magician 是什么?

这是一个专门用于 TypeScript 类型系统的 AI 技能,名为“TypeScript 魔法师”。它的核心能力是设计和实现复杂的泛型类型,帮助开发者将不安全的 `any` 类型重构为严格的类型替代方案,创建类型守卫和实用工具类型,并诊断和修复 TypeScript 编译器错误。该技能特别擅长处理高级类型特性,包括条件类型、映射类型、模板字面量类型、标记/不透明类型,以及 `infer`、`extends` 关键字。它还支持常用的工具类型如 `Partial`、`Record`、`ReturnType` 和 `Awaited`。该技能适用于主流的 AI 编程助手,如 Claude Code、Cursor 和 Codex,能够显著提升 TypeScript 开发中的类型安全性和代码质量。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mcollina/skills/tree/main/skills/typescript-magician

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

typescript-magician 是做什么的?

设计复杂的泛型类型,将 any 类型重构为严格的替代方案,创建类型守卫和工具类型,并解决 TypeScript 编译器错误。当用户询问有关 TypeScript (TS) 类型、泛型、类型推断、类型守卫、移除 any 类型、严格类型化、类型错误、infer、extends、条件类型、映射类型、模板字面量类型、标记/不透明类型或工具类型(如 Partial、Record、ReturnType 和 Awaited)时使用。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

mcollina/documentation

Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages). Use when a user needs to write or reorganize docs, structure a tutorial vs. a how-to guide, build reference docs or API documentation, create explanation pages, choose between Diátaxis documentation types, or improve existing documentation structure. Trigger terms include: documentation structure, Diátaxis, tutorials vs how-to guides, organize docs, user guide, reference docs, technical writing.

mcollina/fastify-best-practices

Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify application — including defining routes, implementing plugins, setting up JSON Schema validation, handling errors, optimising performance, managing authentication, configuring CORS and security headers, integrating databases, working with WebSockets, and deploying to production. Covers the full Fastify request lifecycle (hooks, serialization, logging with Pino) and TypeScript integration via strip types. Trigger terms: Fastify, Node.js server, REST API, API routes, backend framework, fastify.config, server.ts, app.ts.

mcollina/node

Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.

mcollina/nodejs-core

Debugs native module crashes, optimizes V8 performance, configures node-gyp builds, writes N-API/node-addon-api bindings, and diagnoses libuv event loop issues in Node.js. Use when working with C++ addons, native modules, binding.gyp, node-gyp errors, segfaults, memory leaks in native code, V8 optimization/deoptimization, libuv thread pool tuning, N-API or NAN bindings, build system failures, or any Node.js internals below the JavaScript layer.

相关技能