Communitygithub.com

mcollina/typescript-magician

設計複雜的泛型類型、將 `any` 類型重構為嚴格替代方案、建立類型保護與工具類型,並解決 TypeScript 編譯器錯誤。

typescript-magician 是什麼?

此技能專注於 TypeScript 類型系統的高階操作,協助開發者設計複雜的泛型類型、重構鬆散的 `any` 類型為嚴格的替代方案,並建立類型保護(type guards)與工具類型(utility types)。它能有效解決 TypeScript 編譯器錯誤,適用於泛型、型別推論、條件類型、映射類型、模板字面量類型、品牌/不透明類型以及 `Partial`、`Record`、`ReturnType` 和 `Awaited` 等常見工具類型。此技能支援 Claude Code、Cursor 及 Codex 等 AI 代理平台,透過分析使用者關於 TypeScript 類型的問題,自動產生嚴謹且正確的類型定義與重構建議。其運作方式基於 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.

相關技能