AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Nodejs Backend Expert

skill-miaoge-ge-coding-agent-skills-nodejs-backend-expert · by Miaoge-Ge

Expert Node.js backends (Express/Fastify/Hono): routing, middleware, validation, auth, async, and production hardening. Trigger keywords: Node.js, Express, Fastify, Hono, REST, middleware, JWT, session, zod, async, streams, unhandled rejection, graceful shutdown, backend, server. Use for building HTTP services, structuring backends, or fixing async/error/security issues.

No reviews yet
0 installs
40 views
0.0% view→install

Install

$ agentstack add skill-miaoge-ge-coding-agent-skills-nodejs-backend-expert

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-miaoge-ge-coding-agent-skills-nodejs-backend-expert)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Nodejs Backend Expert? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Node.js Backend Expert

> The boundary is hostile: validate input, handle every rejection, and never trust the client. Keep handlers thin, push logic into services, and make the process production-safe (timeouts, health, graceful shutdown).

When to Use

  • Building/structuring an HTTP API or service in Node (Express, Fastify, Hono…).
  • Routing, middleware, input validation, auth, sessions, rate limiting.
  • Unhandled-rejection, error-propagation, streaming, or backpressure issues.
  • Project layout: transport → service → data layer.

When NOT to Use

  • Next.js server features (RSC, server actions) → nextjs-expert.
  • SQL/schema/indexing → sql-expert. API contract design → api-design-expert.
  • Deep auth threat modeling/OWASP → security-expert.

Core Principles

1. Layering

  • Handlers/controllers stay thin (parse → call service → format response). Business logic lives in services; data access is isolated and mockable.
  • Load config from env, validated at startup (zod/envalid); fail fast on missing/invalid config. No process.env.X scattered through code.

2. Async & error discipline

  • async/await throughout. Every route's thrown error must reach a central error handler — wrap async handlers (or use Fastify/Express 5 which await handlers natively).
  • Attach process.on("unhandledRejection")/"uncaughtException" to log and exit; don't swallow.
  • Validate request body/query/params at the edge with a schema; reject early with 400 and a structured error.

3. Security baseline

  • helmet for headers, explicit CORS allowlist, rate limiting on public/auth routes.
  • Hash passwords with argon2/bcrypt; sign tokens/sessions with env secrets; cookies HttpOnly+Secure+SameSite. Never log secrets, tokens, or full request bodies with PII.
  • Parameterize all DB access (no string-built SQL); cap body size.

4. Production-ready process

  • /health (liveness) + readiness; graceful shutdown on SIGTERM (stop accepting, drain in-flight, close DB pool).
  • Set server/socket timeouts. Stream large responses/uploads instead of buffering. Structured logging (pino) with request IDs.

Decision Guide

| Need | Reach for | |------|-----------| | Max performance / schema-first | Fastify | | Minimal/edge/runtime-agnostic | Hono | | Ubiquitous ecosystem / familiarity | Express (use v5 for async error handling) | | Input validation | zod / valibot at the boundary | | Heavy CPU work | worker_threads / separate service (don't block the event loop) |

Common Mistakes

  • Blocking the event loop (sync crypto/fs, big JSON, CPU loops) → stalls all requests; offload to workers/streams.
  • Unhandled async errors in Express 4 (thrown in a promise) → use a wrapper or Express 5.
  • Trusting client input (mass assignment, unvalidated query) → validate + allowlist fields.
  • Catch-and-ignore (catch (e) {}) → log with context and respond appropriately.
  • No timeouts / no shutdown → hung sockets and dropped requests on deploy.
  • Secrets in code or logs → env + secret manager; redact logs.

Examples

Central async error handling + validation (Express 5)

import express from "express";
import { z } from "zod";

const app = express();
app.use(express.json({ limit: "1mb" }));

const Body = z.object({ email: z.string().email(), name: z.string().min(1) });

app.post("/users", async (req, res) => {          // Express 5 awaits handlers
  const body = Body.parse(req.body);               // throws -> error middleware
  const user = await userService.create(body);
  res.status(201).json(user);
});

app.use((err, _req, res, _next) => {
  const status = err?.name === "ZodError" ? 400 : 500;
  if (status === 500) logger.error({ err }, "unhandled");
  res.status(status).json({ error: { message: err.message } });
});

Graceful shutdown

const server = app.listen(3000);
for (const sig of ["SIGTERM", "SIGINT"]) {
  process.on(sig, () => server.close(() => db.end().then(() => process.exit(0))));
}

See Also

  • api-design-expert — endpoint contracts, versioning, pagination.
  • sql-expert — the data layer behind services.
  • security-expert — authn/authz and OWASP hardening.
  • docker-expert / kubernetes-expert — packaging and running the service.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.