pnpm

A rule that makes pnpm the only package manager for JavaScript and TypeScript projects. A package manager installs, updates, runs, and audits project dependencies.

In plain words
What is it for?
Use it when installing, updating, running, or auditing JavaScript and TypeScript dependencies, while keeping the repository's existing lockfile when needed.
Why use it?
It prevents different package managers from creating conflicting lockfiles or inconsistent dependency setups.

Cursor rule

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.

agentmods
npx agentmods add rules/kleosr/kleosrules/pnpm
Clone the repo
git clone --depth 1 https://github.com/kleosr/kleosrules
Per session 226 This file is loaded in full into every session.
When invoked 226 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
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 $0.00226 $0.00226
Opus 5 $0.00113 $0.00113
Sonnet 5 $0.00045 $0.00045
Haiku 4.5 $0.00023 $0.00023

Measured 2d ago against content hash 4c67eba5fb94, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

pnpm scanned grade C with 2 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 2d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- Do not run `curl | sh` or unknown package `postinstall` scripts. Trust `onlyBuiltDependencies` / `strictDepBuilds` when the repo already sets them. Do not invent a workspace security config for a one-line install.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Do not run `curl | sh` or unknown package `postinstall` scripts. Trust `onlyBuiltDependencies` / `strictDepBuilds` when the repo already sets them. Do not invent a workspace security config for a one-line install.
shared/rules/pnpm.mdc · 16 lines

What it actually says

pnpm

When adding, updating, running, or auditing JavaScript dependencies, use pnpm. Never npm, yarn, or bun.

  • Prefer pnpm-lock.yaml. If the repo already has only package-lock.json, yarn.lock, or bun.lockb, say so and keep that lockfile until the user asks to convert.
  • New packages must lose to stdlib, the framework, and already-installed deps first.
  • Audit with pnpm audit, not npm audit.
  • Do not run curl | sh or unknown package postinstall scripts. Trust onlyBuiltDependencies / strictDepBuilds when the repo already sets them. Do not invent a workspace security config for a one-line install.
  • packageManager in package.json, when you touch it, should name pnpm.
  • Before changing pnpm security keys or adding a JS dependency, Read SECURITY.md.
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. 2d ago First seen · 16 lines · 226 tokens per session scan C 4c67eba5fb94

Subscribe to this mod's changes

pnpm is a cursor rule published in the GitHub repository kleosr/kleosrules (2 stars, last pushed 2d ago), licensed MIT. It adds 226 tokens to every session, about $0.0011 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.