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/AnandPilania/eloquentjsWrote 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/anandpilania/eloquentjs/windsurfrules)<a href="https://agentmods.dev/rules/anandpilania/eloquentjs/windsurfrules"><img src="https://agentmods.dev/badge/rules/anandpilania/eloquentjs/windsurfrules/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/anandpilania/eloquentjs/windsurfrules"><img src="https://agentmods.dev/badge/rules/anandpilania/eloquentjs/windsurfrules.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.00826 | $0.00826 |
| Opus 5 | $0.00413 | $0.00413 |
| Sonnet 5 | $0.00165 | $0.00165 |
| Haiku 4.5 | $0.00083 | $0.00083 |
Grade A, and why
windsurfrules 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 — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
EloquentJS — Windsurf Rules
Stack
Node.js ESM + EloquentJS ORM + PostgreSQL/MongoDB + Express/Fastify
Packages
@eloquentjs/core— Model, QueryBuilder, Relations, Events, Casts@eloquentjs/validator— Validation (fluent schema + async DB rules)@eloquentjs/pgsql— PostgreSQL driver with pool management@eloquentjs/graphql— Auto GraphQL from models@eloquentjs/api— Auto REST CRUD routes@eloquentjs/realtime— WebSocket broadcasting@eloquentjs/cli— Scaffold and migration commands
Critical Rules
1. Always await DB calls
// Every Model method returns a Promise
const user = await User.findOrFail(id) // ✅
const user = User.findOrFail(id) // ❌ Promise, not User
2. Eager load relations
// ✅ One query per relation
const posts = await Post.with('user', 'tags', 'comments').get()
// ❌ N+1: one extra query per post
const posts = await Post.all()
for (const p of posts) { const u = await p.user() }
3. Declare fillable
// ✅ Required for create/update to work
class User extends Model {
static fillable = ['name', 'email', 'password']
}
// ❌ Empty fillable = nothing gets saved
class User extends Model {}
4. Validate before write
import { v } from '@eloquentjs/validator'
const schema = v.schema({
email: v.string().email(),
name: v.string().min(2),
})
const data = schema.parse(req.body) // throws on invalid
await User.create(data)
5. Use findOrFail for required records
// ✅ Throws ModelNotFoundException → handle as 404
const user = await User.findOrFail(req.params.id)
// ❌ Need manual null check
const user = await User.find(req.params.id)
if (!user) return res.status(404).json({ error: 'Not found' })
Model Template
import { Model } from '@eloquentjs/core'
export default class ModelName extends Model {
static table = 'table_name'
static fillable = ['field1', 'field2']
static hidden = []
static softDeletes = false
static casts = {
// field: 'boolean' | 'integer' | 'decimal:2' | 'json' | 'array' | 'date' | 'datetime'
}
// Relations
// parent() { return this.belongsTo(Parent) }
// children() { return this.hasMany(Child) }
// Scopes
// static scopeName(qb) { return qb.where(...) }
// Hooks
// static async creating(record) { }
// static async created(record) { }
}
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 · 119 lines · 826 tokens per session scan A 9f8208f0acbb
windsurfrules is a cursor rule published in the GitHub repository AnandPilania/eloquentjs (74 stars, last pushed yesterday), licensed MIT. It adds 826 tokens to every session, about $0.0041 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-09-08.
Other cursor rules, from other repositories
sql-queries-not-asts
Name built-and-lowered SQL units "queries", not "asts".
shared-plane-packages
Pattern for creating shared plane packages that serve both migration and runtime planes.
test-database-limitations
Test databases created via withDevDatabase() from @repo/test-utils use pglite (an in-memory PostgreSQL implementation via @prisma/dev). Pglite does not support PostgreSQL extensions like pgvector, pgtrgm, etc.
sql-orm-client-whole-shape-assertions
Prefer whole-result-shape assertions with explicit select projections in sql-orm-client tests.
sql-types-imports
Canonical import paths for SQL types.
postgres-lateral-patterns
PostgreSQL LATERAL and jsonagg rendering patterns.