agentleFS
caiaffacaiaffa/claude-code-ultimate-engineering-system/skills/node-runtime-reliability/SKILL.md

node-runtime-reliability

Skill17 starsChanged 58 days agoMITView on GitHub

Analyze Node.js services for runtime safety, concurrency correctness, memory health, timeout behavior, shutdown integrity, and production resilience.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No timeout on any HTTP client call.

    line 54

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mission

Make Node.js services trustworthy under real production load, failure, and operational stress.

When to use

  • Reviewing Node.js service reliability.
  • Investigating latency, crashes, or memory issues.
  • Designing async workflows.
  • Validating shutdown, retries, and concurrency controls.

Handoff

  • Receives from: backend-platform-engineer (implementation) or systematic-debugging (investigation).
  • Hands off to: performance-analysis (if perf issue), observability (monitoring), production-readiness (runtime config).

Node.js runtime risks

RiskSymptomDetectionFix
Event loop blockingAll requests slow simultaneouslyEvent loop lag metric > 100msMove CPU work to worker threads or separate process
Unhandled promise rejectionSilent failure, missing dataunhandledRejection handler + loggingAlways await or catch; add process handler as safety net
Memory leakRSS grows over hours/daysRSS metric trending up over 24hHeap snapshot analysis; check caches, listeners, closures
Unbounded concurrencyDependency overwhelmedConnection pool exhaustion, timeout spikesSemaphore/queue limiting concurrent requests
Missing cancellationWork continues after request abandonedCPU/memory usage without matching trafficAbortController for HTTP calls; cancel tokens for async chains
Bad shutdownJobs lost, connections leakedRestart produces duplicate work or errorsSIGTERM handler: stop accepting, drain in-flight, close pools

Shutdown implementation pattern

process.on('SIGTERM', async () => {
  server.close();                    // Stop accepting new connections
  await drainInFlightRequests();     // Wait for current requests (with timeout)
  await closeConnectionPools();      // DB, Redis, etc.
  await flushTelemetry();           // Send remaining spans/metrics
  process.exit(0);
});

Concurrency control pattern

// BAD: unbounded concurrent external calls
const results = await Promise.all(items.map(i => callExternalAPI(i)));

// GOOD: bounded concurrency
import pLimit from 'p-limit';
const limit = pLimit(10); // max 10 concurrent
const results = await Promise.all(items.map(i => limit(() => callExternalAPI(i))));

Red flags

  • No unhandledRejection handler registered.
  • Promise.all on unbounded arrays calling external services.
  • No timeout on any HTTP client call.
  • setInterval without cleanup in graceful shutdown.
  • Global mutable state shared across requests.
  • JSON.parse on user input without size limit.

Output format

  1. Runtime risk summary (critical / moderate / low)
  2. High-risk patterns found (with file/location if possible)
  3. Concurrency assessment (bounded? backpressure present?)
  4. Shutdown assessment (graceful? tested?)
  5. Memory risk (leaks, unbounded caches, growing listeners?)
  6. Resilience improvements (prioritized, concrete)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.