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.
npx agentmods add rules/anandpilania/eloquentjs/cursorrulesgit clone --depth 1 https://github.com/AnandPilania/eloquentjsWhat 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 | $0.01036 | $0.01036 |
| Opus 5 | $0.00518 | $0.00518 |
| Sonnet 5 | $0.00207 | $0.00207 |
| Haiku 4.5 | $0.00104 | $0.00104 |
Grade A, and why
cursorrules 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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
EloquentJS — Cursor Rules
Project Tech Stack
- Runtime: Node.js (ESM,
"type": "module") - ORM: EloquentJS (
@eloquentjs/core) - Database: PostgreSQL via
@eloquentjs/pgsql(or MongoDB via@eloquentjs/mongodb) - Validation:
@eloquentjs/validator - REST API:
@eloquentjs/api(Express/Fastify) - GraphQL:
@eloquentjs/graphql - Realtime:
@eloquentjs/realtime
Code Style Rules
Imports
- Always use ESM imports (
import, notrequire) - Import from package names, not file paths for EloquentJS packages
- Default export for Model classes; named exports for utilities
// ✅ Correct
import { Model } from '@eloquentjs/core'
import { v } from '@eloquentjs/validator'
import User from './models/User.js'
// ❌ Wrong
const { Model } = require('@eloquentjs/core')
Model files
- One model per file in
app/models/ - PascalCase filename matching class name
- Always declare
static table,static fillable, andstatic casts - Soft deletes: add
static softDeletes = true(never delete rows in user-facing apps)
// ✅ Standard model structure
export default class Product extends Model {
static table = 'products'
static fillable = ['name', 'price', 'sku', 'category_id']
static hidden = []
static casts = { price: 'decimal:2', in_stock: 'boolean', tags: 'array' }
static softDeletes = true
category() { return this.belongsTo(Category) }
static scopeInStock(qb) { return qb.where('in_stock', true) }
}
Querying
- Always
awaitquery results - Use
.with()for any relations accessed after fetching - Use
findOrFail()when record absence should be an error - Use
paginate()for list endpoints (never.all()without limit in production)
// ✅
const product = await Product.findOrFail(id)
const page = await Product.inStock().with('category').paginate(page, 20)
// ❌
const product = Product.find(id) // missing await
const all = await Product.all() // dangerous in production
Validation
- Always validate before
create()orupdate() - Use
@eloquentjs/validatorfluent schema for complex validation - Use
schema.parseAsync()when rules includeunique()orexists()
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.
- 2d ago First seen · 127 lines · 1,036 tokens per session scan A 6b0c983f3864
cursorrules is a cursor rule published in the GitHub repository AnandPilania/eloquentjs (74 stars, last pushed 27d ago), licensed MIT. It adds 1,036 tokens to every session, about $0.0052 per session on Opus 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-08-30.
Other cursor rules, from other repositories
family-instance-domain-actions
Family instance domain action implementation patterns.
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
as-contract-cast-smell
// ❌ WRONG — bypasses the family ContractSerializer seam const contract = JSON.parse(raw) as Contract; const contract = JSON.parse(raw) as Contract .
no-family-vocabulary-in-framework
The framework domain (packages/1-framework) carries no family- or target-specific vocabulary — types, fields, hooks, or strategy values. Enforced by the no-family-vocabulary Biome plugin plus lint:framework-vocabulary.
declarative-config
Prefer declarative configuration over hardcoded logic.
no-barrel-files
Avoid barrel files and unnecessary re-exports.