Community编程与开发github.com

mcollina/node

提供Node.js与TypeScript开发的最佳实践,涵盖类型剥离、异步模式、错误处理、流、模块、测试、性能、缓存、日志等。用于设置原生TypeScript支持的Node.js项目、配置类型剥离、编写无需构建步骤的Node 22+ TypeScript代码。

node 是什么?

该技能专注于为Node.js开发者提供与TypeScript结合的最佳实践,尤其针对Node 22+的原生TypeScript支持。它详细指导如何配置`--experimental-strip-types`实现类型剥离,从而消除传统构建步骤,允许直接运行`.ts`文件。技能覆盖了从项目初始化(tsconfig.json配置、package.json脚本)到高级模式(异步编程、错误处理、优雅关闭、流处理、模块解析)的完整开发栈。此外,还包含测试(处理不稳定测试)、性能优化、缓存策略、日志记录和环境配置等生产级实践。该技能适用于Claude Code、Cursor等AI编码助手,帮助开发者避免重复造轮子,直接应用经过验证的Node.js TypeScript模式,特别适合希望简化构建流程、提升代码质量和开发效率的团队。

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

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

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

文档

node 是做什么的?

为Node.js与TypeScript开发提供领域特定的最佳实践,涵盖类型剥离、异步模式、错误处理、流、模块、测试、性能、缓存、日志等。用于设置原生TypeScript支持的Node.js项目、配置类型剥离(--experimental-strip-types)、编写无需构建步骤的Node 22+ TypeScript代码,或当用户提到‘Node原生TypeScript’、‘类型剥离’、‘Node 22 TypeScript’、‘无需编译的.ts文件’、‘ts-node替代方案’时,或需要Node.js中的错误处理、优雅关闭、不稳定测试、性能分析或环境配置指导时使用。帮助配置tsconfig.json以实现类型剥离、设置package.json脚本、处理模块解析和导入扩展,并在整个Node.js栈中应用稳健的模式。

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/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.

mcollina/typescript-magician

Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict typing, type errors, `infer`, `extends`, conditional types, mapped types, template literal types, branded/opaque types, or utility types like `Partial`, `Record`, `ReturnType`, and `Awaited`.

相关技能