ess-npmrc-env

ess-npmrc-env is a cursor rule for Cursor from CiscoDevNet/essentials. It costs 261 tokens per session, scanned A, original, Apache-2.0.

A rule for writing environment-variable references in an npm configuration file named .npmrc. It requires the portable form ${VAR} and explains why a trailing question mark can break authentication on some npm versions.

In plain words
What is it for?
It is for configuring private npm registry credentials and running authenticated npm installs such as npm ci.
Why use it?
It helps prevent failed package installs caused by an incorrectly expanded registry token, while keeping secrets out of committed files.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for configuring private npm registry credentials and running authenticated npm installs such as npm ci.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ciscodevnet/essentials/ess-npmrc-env
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/CiscoDevNet/essentials

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 ess-npmrc-env

README.md
[![agentmods](https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-npmrc-env/github.svg)](https://agentmods.dev/rules/ciscodevnet/essentials/ess-npmrc-env)
Your own site
<a href="https://agentmods.dev/rules/ciscodevnet/essentials/ess-npmrc-env"><img src="https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-npmrc-env/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 ess-npmrc-env

Your own site · 80×15
<a href="https://agentmods.dev/rules/ciscodevnet/essentials/ess-npmrc-env"><img src="https://agentmods.dev/badge/rules/ciscodevnet/essentials/ess-npmrc-env.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 261 This file is loaded in full into every session.
When invoked 261 The same file — it is already loaded in full.
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.00261 $0.00261
Opus 5.5 $0.00104 $0.00104
Sonnet 5.5 $0.00052 $0.00052
Haiku 4.5 $0.00026 $0.00026

Measured 12d ago against content hash 35f71b76e3c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ess-npmrc-env 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 12d 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.

.cursor/rules/ess-npmrc-env.mdc · 25 lines

What it actually says

npmrc environment variables

npm replaces ${VARIABLE_NAME} in .npmrc values. The text inside the braces is the environment variable name, exactly.

//registry.example.com/:_authToken=${NPM_TOKEN}

Do not append ?.

npm 10, bundled with Node 20 and Node 22, has no optional form. It looks up a variable named NPM_TOKEN?, so exporting NPM_TOKEN leaves ${NPM_TOKEN?} unexpanded and authenticated installs fail.

//registry.example.com/:_authToken=${NPM_TOKEN?}

npm 11 and later document ? as "substitute an empty string when unset." That is still the wrong form for a required value such as an auth token: an unset variable becomes an empty token instead of a visible unreplaced placeholder. Write ${VARIABLE_NAME} so the same file works on npm 10 and later.

Keep the ${...} reference. Never paste a token into a committed .npmrc. Export the variable before npm ci.

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. 12d ago First seen · 25 lines · 261 tokens per session scan A 35f71b76e3c9

Subscribe to this mod's changes

ess-npmrc-env is a cursor rule published in the GitHub repository CiscoDevNet/essentials (7 stars, last pushed 8d ago), licensed Apache-2.0. It adds 261 tokens to every session, about $0.0010 per session on Opus 5.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-11-19.

Related

ess-npmrc-env compared with cursor rules from other repositories

ess-npmrc-env next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ess-npmrc-envCiscoDevNet/essentialsCursor rule78d agoApache-2.0A261Cursor
dashboard-testingAutomattic/wp-calypsoCursor rule13kyesterdayGPL-2.0A0Cursor
solarStahlwalker/framework-solarCursor rule212d agoMITA0Cursor
no-barrel-filesprisma/ormCursor rule48ktodayApache-2.0A0Cursor
explicit-opt-in-over-diagnosticsprisma/ormCursor rule48ktodayApache-2.0A730Cursor
no-backward-compatibilityprisma/ormCursor rule48ktodayApache-2.0A0Cursor
test-packagesprisma/ormCursor rule48ktodayApache-2.0A5Cursor