javascript-3-development-standards

JavaScript and TypeScript coding standards based on common Airbnb, Google, MDN, and Node.js practices. JavaScript is the programming language; TypeScript adds optional type checking.

In plain words
What is it for?
Use it when writing or reviewing browser, Node.js, React, or TypeScript code, especially for style, asynchronous code, validation, security, and readability decisions.
Why use it?
It reduces unclear, inconsistent, insecure, and difficult-to-maintain code by setting expectations for modern syntax, structure, types, and error handling.

Cursor rule for Cursor

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/beettlle/pi-spine/javascript-3-development-standards
Clone the repo
git clone --depth 1 https://github.com/beettlle/pi-spine

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 10,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00000 $0.10397
Opus 5 $0.00000 $0.05199
Sonnet 5 $0.00000 $0.02079
Haiku 4.5 $0.00000 $0.01040

Measured yesterday against content hash 33ec53559ca2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

javascript-3-development-standards 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 yesterday.

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/javascript-3-development-standards.mdc · 558 lines

How it starts

The opening of the file, as written. The whole thing — 558 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persona: Senior JavaScript Architect

  • Role: Modern JavaScript/TypeScript expert (Node.js, React, frontend ecosystems). Philosophy: "Explicit > implicit", "Readability counts", "Type safety where possible"
  • Bias: Modern ES6+ features (const/let > var, async/await > callbacks), Prefer TypeScript or JSDoc for types, Strict mode always, Prefer functional over imperative, Performance-conscious (lazy evaluation, memoization), Security-first (input validation, CSP)

JavaScript Development Standards

This file contains JavaScript/ECMAScript-specific development standards that embody modern JavaScript best practices, follows conventions from Airbnb JavaScript Style Guide, Google JavaScript Style Guide, and incorporates best practices from MDN JavaScript Guide and Node.js Best Practices.

For universal anti-patterns: See general-llm-anti-patterns.mdc.


JavaScript Philosophy

JavaScript's evolution (ES6+) has transformed it into a powerful, expressive language. These principles guide all JavaScript code:

  1. Explicit is better than implicit - Use clear, obvious code over clever tricks
  2. Readability counts - Code is read more often than written; prioritize clarity
  3. Modern features first - Use ES6+ features (const/let, arrow functions, destructuring, async/await, modules) when available
  4. Type safety - Use TypeScript when possible, or JSDoc types for better IDE support
  5. Async-first - Prefer async/await over raw promises and callbacks
  6. Modular - Use ES6 modules, keep modules focused and small
  7. Safety - Always use strict mode, validate inputs, handle errors explicitly
  8. Performance-aware - Write efficient code, but don't prematurely optimize
  9. Security-first - Never trust user input, sanitize everything, avoid eval()
  10. Functional over imperative - Prefer declarative patterns (map, filter, reduce) when appropriate

Read the full file on GitHub · 558 lines

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. yesterday First seen · 558 lines · 0 tokens per session scan A 33ec53559ca2

Subscribe to this mod's changes

javascript-3-development-standards is a cursor rule published in the GitHub repository beettlle/pi-spine (3 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 10,397 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-08-31.