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.
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWrote 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.
[](https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/javascript)<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/javascript"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/javascript/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.
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/javascript"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/javascript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01250 | $0.01250 |
| Opus 5.5 | $0.00500 | $0.00500 |
| Sonnet 5.5 | $0.00250 | $0.00250 |
| Haiku 4.5 | $0.00125 | $0.00125 |
Grade A, and why
javascript scanned grade A with 1 finding 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 1mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- Default parameters: `function fetch(url, retries = 3)` — but defaults are evaluated left-to-right per call, so `function f(a, b = a * 2)` works and `function f(a = b, b)` doesn't This is a copy
100% identical to javascript — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.
JavaScript Rules
Modern Syntax
constby default,letwhen reassignment is needed, nevervar.varis function-scoped and hoisted — it creates bugs thatconst/let(block-scoped) prevent- Arrow functions for callbacks and short functions. Regular
functionfor top-level declarations and methods that needthis. Arrow functions inheritthisfrom the enclosing scope — using them as object methods breaksthisbinding - Template literals over concatenation:
`Hello ${name}`not"Hello " + name. Tagged templates (html`...`) for DSLs and sanitization - Destructure at point of use:
const { name, email } = user— but don't deeply destructure (const { address: { city } } = user) because it obscures the data source and throws on null - Optional chaining (
?.) and nullish coalescing (??) over manual checks.??only catchesnull/undefined, NOT0,"", orfalse— that's the difference from||. If you want to default on all falsy values, use||. If only null/undefined, use??
Async
async/awaitover.then()chains — flatter, readable, debuggable with stack traces..then()loses the call stack on errorstry/catchin async functions catches both sync throws and rejected promises. Butcatchat the right level — wrapping every line in try/catch is noise. Catch where you can handle the error meaningfullyPromise.all()for independent concurrent operations — runs in parallel.Promise.allSettled()when you need all results even if some fail.Promise.all()short-circuits on the first rejection and you lose the other results- Unhandled promise rejections crash Node.js (v15+) and log warnings in browsers. Always handle them: return the promise, await it, or attach
.catch() for await...offor async iterables (streams, paginated APIs). Don'tawaitinside a regularforloop when operations are independent — that serializes them unnecessarily
Functions
- Pure functions where possible: same input → same output, no side effects. Pure functions are testable without mocks, cacheable, and safe to parallelize
- Default parameters:
function fetch(url, retries = 3)— but defaults are evaluated left-to-right per call, sofunction f(a, b = a * 2)works andfunction f(a = b, b)doesn't - Return early to flatten nesting: guard clauses at the top (
if (!user) return null;), happy path at indent level 1 - Named exports for tree-shaking:
export function fetchUser()— default exports can't be tree-shaken by name and make refactoring harder (the import name is arbitrary)
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.
- 1mo ago First seen · 46 lines · 1,250 tokens per session scan A 1f1a63bc5cae
javascript is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 7mo ago), licensed MIT. It adds 1,250 tokens to every session, about $0.0050 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 100% identical to javascript, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
react-native-js
React Native JS/TS shared layer conventions.
native-android
Native Android (Kotlin/Java/Gradle) conventions.
typescript
TypeScript conventions and type safety rules.
native-ios
Native iOS conventions — verification is CI-only (no Mac locally).
cursorrules
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.