node

node is a cursor rule for Cursor from adonai-labs/agent-runway. It costs 0 tokens per session (372 once invoked), scanned A, original, MIT.

A set of Node.js runtime and backend guidelines for configuration, process lifecycle, APIs, asynchronous errors, monitoring, and security. It applies to services, command-line tools, and background workers.

In plain words
What is it for?
Use it when building or reviewing Node.js services, APIs, workers, or CLIs that need dependable configuration, logging, health checks, and shutdown behaviour.
Why use it?
It helps prevent missing configuration, leaked secrets, unhandled failures, unsafe error responses, and processes that shut down without finishing their work.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when building or reviewing Node.js services, APIs, workers, or CLIs that need dependable configuration, logging, health checks, and shutdown behaviour.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/adonai-labs/agent-runway/node
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.

Clone the repo
git clone --depth 1 https://github.com/adonai-labs/agent-runway

Made for: Cursor.

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 node

README.md
[![agentmods](https://agentmods.dev/badge/rules/adonai-labs/agent-runway/node/github.svg)](https://agentmods.dev/rules/adonai-labs/agent-runway/node)
Your own site
<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/node"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/node/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for node

Your own site · 80×15
<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/node"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/node.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00372
Opus 5 $0.00000 $0.00186
Sonnet 5 $0.00000 $0.00074
Haiku 4.5 $0.00000 $0.00037

Measured 7d ago against content hash c917887575d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

node 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 7d 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.

src/stacks/node/node.mdc · 56 lines

What it actually says

Node.js Best Practices

Use these directives for Node.js services, APIs, workers, and CLIs.


Configuration and Environment

  • Validate required environment variables at startup and fail fast when missing.
  • Keep secrets out of source control and logs.
  • Use explicit defaults only for non-sensitive optional config.
  • Keep runtime config typed and centralised in one module.

Error Handling and Reliability

  • Handle promise rejections explicitly; avoid fire-and-forget without supervision.
  • Map unexpected errors to safe external responses; never leak stack traces to clients.
  • Use structured error classes or error codes for predictable handling.
  • Add timeout and retry policy for outbound calls where retries are safe.

Process Lifecycle

  • Handle SIGTERM and SIGINT for graceful shutdown.
  • Stop accepting new work before shutting down dependencies.
  • Close DB connections, message consumers, and HTTP servers cleanly.
  • Exit with non-zero code on unrecoverable startup failures.

Observability

  • Use structured logs (JSON or key-value) with consistent fields.
  • Include correlation/request IDs across async boundaries.
  • Emit health and readiness endpoints for services.
  • Track latency, error rates, and saturation for critical paths.

Security Basics

  • Validate all external input at boundaries.
  • Apply strict CORS, auth, and rate limiting for public endpoints.
  • Avoid dynamic code execution (eval, new Function) in production paths.
  • Keep dependencies updated and review high/critical vulnerabilities.
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. 7d ago First seen · 56 lines · 0 tokens per session scan A c917887575d3

Subscribe to this mod's changes

node is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 21d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 372 tokens. 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-09-03.