nodejs-best-practices

Select Node.js frameworks and architecture based on deployment context.

1|Updated Jul 16, 2025
One-click install
npx skills add https://github.com/AlexAlvarezAlmendros/OtpWebBack --skill nodejs-best-practices-alexalvarezalmendros
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodejs-best-practices
Source: https://github.com/AlexAlvarezAlmendros/OtpWebBack/tree/main/.agents/skills/nodejs-best-practices
Command: npx skills add https://github.com/AlexAlvarezAlmendros/OtpWebBack --skill nodejs-best-practices-alexalvarezalmendros

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Node.js projects often suffer from inconsistent decisions about frameworks, runtimes, and architectural patterns. This Skill provides principled guidance to make informed, context-driven choices rather than copying boilerplate solutions.

Core Features & Use Cases

  • Decision-tree framework selection based on deployment targets and requirements (edge, API, monolith, or full-stack).
  • Runtime and architecture guidance covering native TS, ESM vs CJS, and layered architecture patterns.
  • Security, validation, and testing principles to harden projects and improve maintainability.
  • Use Case: You’re starting a new Node.js project and must decide between Express, Fastify, or NestJS, while setting up validation, async patterns, and testing strategy.

Quick Start

Apply the decision framework at project kickoff: outline goals, constraints, and context, then select frameworks and patterns using the guidance in this Skill.

Frequently Asked Questions about nodejs-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the best Node.js framework for my project?

To choose a Node.js framework, outline your project goals, deployment targets, and constraints. Use a decision-tree approach to select between Express, Fastify, NestJS, or Hono based on whether your deployment target is edge, API, monolith, or full-stack.

What's the best way to structure a Node.js architecture for maintainability?

The best way to structure Node.js architecture is by applying a layered architecture pattern. Implementing architecture layering, error handling, and validation principles hardens projects and improves maintainability across new projects or major refactors.

When should I use NestJS vs Fastify for an API?

Choose between NestJS and Fastify by evaluating deployment targets and requirements. Use NestJS for structured full-stack or monolith architectures, while Fastify fits high-performance API contexts, guided by decision-tree framework selection criteria.

How do I implement async patterns and validation in Node.js?

Implement async patterns and validation in Node.js by encoding them into actionable architecture instructions. Applying principled guidance for architecture layering, error handling, and validation hardens projects and improves maintainability.

Does this Node.js guidance cover security and testing practices?

Yes, this Node.js guidance covers security and testing practices. It provides security, validation, and testing principles to harden projects and improve maintainability, ensuring informed, context-driven choices rather than copying boilerplate solutions.

Can I use this Node.js architecture guidance for refactoring existing projects?

Yes, you can use this Node.js architecture guidance for refactoring existing projects. It is applicable to new projects or major refactors, helping developers decide the most appropriate toolchain, runtime options, and architectural patterns for a given context.