Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nodejs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-nodejs)
---
name: nodejs
description: Node.js runtime — event loop and blocking, async patterns and error handling, streams and backpressure, worker threads, memory and GC, graceful shutdown, config and env handling, security (prototype pollution, ReDoS), diagnostics. Use for Node.js services and scripts (Node.js, event loop, streams, async, graceful shutdown).
metadata:
category: languages-frameworks
---
# Node.js
## Purpose
Write Node.js code that keeps the event loop free and fails predictably.
**Use when:** any Node.js server or script.
**Not for:** browser code.
## Inputs
- Code, runtime metrics.
## Outputs
- Code and review findings for runtime behaviour.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "node.js"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Event loop.** Keep CPU work off the loop (workers, chunking); watch event loop delay.
Done when no sync heavy work on hot paths.
2. **Errors.** Await every promise; handle rejections; no floating promises.
Done when lint rule enforces.
3. **Streams.** Use `pipeline` with backpressure for large data.
Done when memory is bounded.
4. **Lifecycle.** Graceful shutdown: stop accepting, drain, close pools with timeout.
Done when SIGTERM handled.
## Best practices
- Use `AbortSignal` for cancellation and timeouts.
- Validate env at startup.
## Common mistakes
- `JSON.parse` of huge payloads on the loop.
- Unbounded `Promise.all` fan-out.
## Example
CSV export via `pipeline(dbCursor, transform, res)` with backpressure; memory flat at 80 MB for 2M rows.
## Reusable prompt
```text
Apply the Node.js skill (.agents/skills/nodejs/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Review the Node.js code for event-loop blocking, promise handling, backpressure and graceful shutdown.
Return: Code and review findings for runtime behaviour..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```