ホーム/后端开发/node-best-practices
N

node-best-practices

by @mcollinav
4.9(15)

堅牢で高性能、保守性の高いNode.jsアプリケーションを構築するためのドメイン固有の知識とベストプラクティスを提供します。

Node.jsBackend DevelopmentExpress.jsPerformance OptimizationSecurity Best PracticesGitHub
インストール方法
npx skills add mcollina/skills --skill node-best-practices
compare_arrows

Before / After 効果比較

1
使用前

Node.jsアプリケーション開発時、コード品質にばらつきがあり、パフォーマンスのボトルネックが頻繁に発生します。統一された規範の欠如により、プロジェクトの保守と拡張が困難になります。

使用後

Node.jsのベストプラクティスに従い、堅牢で高性能なアプリケーションを構築します。コード品質と保守性を向上させ、プロジェクト開発プロセスを加速します。

description SKILL.md

node-best-practices

When to use

Use this skill whenever you are dealing with Node.js code to obtain domain-specific knowledge for building robust, performant, and maintainable Node.js applications.

TypeScript with Type Stripping

When writing TypeScript for Node.js, use type stripping (Node.js 22.6+) instead of build tools like ts-node or tsx. Type stripping runs TypeScript directly by removing type annotations at runtime without transpilation.

Key requirements for type stripping compatibility:

  • Use import type for type-only imports

  • Use const objects instead of enums

  • Avoid namespaces and parameter properties

  • Use .ts extensions in imports

Minimal example — a valid type-stripped TypeScript file:

// greet.ts
import type { IncomingMessage } from 'node:http';

const greet = (name: string): string => `Hello, ${name}!`;
console.log(greet('world'));

Run directly with:

node greet.ts

See rules/typescript.md for complete configuration and examples.

Common Workflows

For multi-step processes, follow these high-level sequences before consulting the relevant rule file:

Graceful shutdown: Register signal handlers (SIGTERM/SIGINT) → stop accepting new work → drain in-flight requests → close external connections (DB, cache) → exit with appropriate code. See rules/graceful-shutdown.md.

Error handling: Define a shared error base class → classify errors (operational vs programmer) → add async boundary handlers (process.on('unhandledRejection')) → propagate typed errors through the call stack → log with context before responding or crashing. See rules/error-handling.md.

Diagnosing flaky tests: Isolate the test with --test-only → check for shared state or timer dependencies → inspect async teardown order → add retry logic as a temporary diagnostic step → fix root cause. See rules/flaky-tests.md.

Profiling a slow path: Reproduce under realistic load → capture a CPU profile with --cpu-prof → identify hot functions → check for stream backpressure or unnecessary serialisation → validate improvement with a benchmark. See rules/profiling.md and rules/performance.md.

How to use

Read individual rule files for detailed explanations and code examples:

Weekly Installs404Repositorymcollina/skillsGitHub Stars1.5KFirst SeenJan 31, 2026Security AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled oncodex388opencode385github-copilot384gemini-cli383kimi-cli377amp377

forumユーザーレビュー (0)

レビューを書く

効果
使いやすさ
ドキュメント
互換性

レビューなし

統計データ

インストール数560
評価4.9 / 5.0
バージョン
更新日2026年3月17日
比較事例1 件

ユーザー評価

4.9(15)
5
0%
4
0%
3
0%
2
0%
1
0%

この Skill を評価

0.0

対応プラットフォーム

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

タイムライン

作成2026年3月17日
最終更新2026年3月17日