nodejs-best-practices

nodejs-best-practices is a skill for Claude Code, Codex from FranRom/pupila. It costs 33 tokens per session (2,038 once invoked), scanned A, original, MIT.

A practical guide to making Node.js design choices, including frameworks, asynchronous code, security, architecture, and deployment. It explains how to choose based on the project rather than copying a fixed solution.

In plain words
What is it for?
Use it to compare frameworks, plan APIs and full-stack applications, design asynchronous code, and make security or deployment decisions.
Why use it?
It helps when several Node.js approaches could work and the right choice depends on the project, team, or deployment environment.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/franrom/pupila/nodejs-best-practices
Any agent
npx skills add FranRom/pupila --skill nodejs-best-practices
Clone the repo
git clone --depth 1 https://github.com/FranRom/pupila

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nodejs-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/franrom/pupila/nodejs-best-practices.svg)](https://agentmods.dev/skills/franrom/pupila/nodejs-best-practices)
Your own site
<a href="https://agentmods.dev/skills/franrom/pupila/nodejs-best-practices"><img src="https://agentmods.dev/badge/skills/franrom/pupila/nodejs-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,038 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.02038
Opus 5 $0.00016 $0.01019
Sonnet 5 $0.00007 $0.00408
Haiku 4.5 $0.00003 $0.00204

Measured 4d ago against content hash 9e24b6ef42d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nodejs-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/nodejs-best-practices/SKILL.md · 338 lines

How it starts

The opening of the file, as written. The whole thing — 338 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Node.js Best Practices

Principles + decision-making, Node.js 2025. THINK, don't memorize.

When to Use

Node.js architecture decisions, framework choice, async design, security, deployment.


How to Use

Teaches decision-making, not copy-paste code.

  • ASK user prefs when unclear
  • Pick framework/pattern by CONTEXT
  • Don't default same solution every time

1. Framework Selection (2025)

Decision Tree

What are you building?
│
├── Edge/Serverless (Cloudflare, Vercel)
│   └── Hono (zero-dependency, ultra-fast cold starts)
│
├── High Performance API
│   └── Fastify (2-3x faster than Express)
│
├── Enterprise/Team familiarity
│   └── NestJS (structured, DI, decorators)
│
├── Legacy/Stable/Maximum ecosystem
│   └── Express (mature, most middleware)
│
└── Full-stack with frontend
    └── Next.js API Routes or tRPC

Comparison Principles

Factor Hono Fastify Express
Best for Edge, serverless Performance Legacy, learning
Cold start Fastest Fast Moderate
Ecosystem Growing Good Largest
TypeScript Native Excellent Good
Learning curve Low Medium Low

Why these matter: Hono wins edge/serverless via zero deps + tiny runtime → fastest cold starts. Fastify wins perf via schema-based serialization → 2-3x Express throughput. Express wins on ecosystem maturity + middleware count. NestJS wins for teams needing DI/decorators/structure. Next.js/tRPC win when frontend colocated.

Selection Questions:

  1. Deployment target?
  2. Cold start critical?
  3. Team experience?
  4. Legacy code to maintain?

2. Runtime (2025)

Native TypeScript

Node.js 22+: --experimental-strip-types
├── Run .ts files directly
├── No build step needed for simple projects
└── Consider for: scripts, simple APIs

Module System

ESM (import/export)
├── Modern standard
├── Better tree-shaking
├── Async module loading
└── Use for: new projects

CommonJS (require)
├── Legacy compatibility
├── More npm packages support
└── Use for: existing codebases, some edge cases

Read the full file on GitHub · 338 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 338 lines · 33 tokens per session scan A 9e24b6ef42d7

Subscribe to this mod's changes

nodejs-best-practices is a skill published in the GitHub repository FranRom/pupila (35 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 2,038 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.