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/whenlabs-org/when/cursorrulesgit clone --depth 1 https://github.com/WhenLabs-org/whenWhat 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.00964 | $0.00964 |
| Opus 5 | $0.00482 | $0.00482 |
| Sonnet 5 | $0.00193 | $0.00193 |
| Haiku 4.5 | $0.00096 | $0.00096 |
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 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.
How it starts
The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are working on nextjs-app.
Tech stack: Next.js (App Router), TypeScript, Tailwind CSS, Drizzle ORM, postgres, Vitest + playwright + testing-library, ESLint + Prettier, pnpm, Vercel, NextAuth.js, tRPC
Rules:
- Use the
app/directory; every route folder needs apage.tsxto be publicly accessible - Add
'use client'at the top of a file only when the component needs interactivity, browser APIs, hooks (useState,useEffect), or event handlers - Never import a Server Component into a Client Component — pass it as
childreninstead - Use
fetch()with Next.js extended options:{ cache: 'force-cache' }(default, static),{ cache: 'no-store' }(dynamic), or{ next: { revalidate: N } }for ISR - Use utility classes directly in markup — avoid writing custom CSS unless absolutely necessary
- Never use
@applyin component styles — it defeats the purpose of utility-first CSS and increases bundle size - Dark mode: use
dark:variant; configure strategy (classormedia) as needed - Use design tokens from the theme for consistency — avoid arbitrary values like
w-[137px]unless truly one-off - Use the dialect-specific column builders:
pgTable,mysqlTable, orsqliteTable - Use
$inferSelectand$inferInsertto derive TypeScript types from table definitions — never manually duplicate types - Use the query builder API (
db.select().from(users).where(eq(users.id, id))) for most operations - Use the relational query API (
db.query.users.findMany({ with: { posts: true } })) for nested/related data - Use
publicProcedurefor unauthenticated endpoints; createprotectedProcedurewith auth middleware for authenticated ones - Use
.query()for read operations (GET-like);.mutation()for write operations (POST/PUT/DELETE-like) - Use
.subscription()for real-time WebSocket-based data streams - Use middleware (
.use()) for cross-cutting concerns: auth checks, logging, rate limiting - Use
useSession()hook in Client Components for session data and status - Use
getServerSession(authOptions)ingetServerSidePropsor API routes for server-side session checks - Use
callbacks.jwtto enrich the JWT token with custom claims (role, userId) - Use
callbacks.sessionto expose token data to the client session object - Use
describe()to group related tests;it()ortest()for individual cases - Use
expect()assertions — prefer specific matchers (toEqual,toContain,toThrow) over generictoBeTruthy - Use
vi.mock('module')at the top of the file to mock entire modules — it is hoisted automatically - Use
vi.spyOn(object, 'method')to observe calls without replacing implementation - Use
test.describe()to group related scenarios;test()for individual cases - Use
test.beforeEachfor common setup (navigation, auth state) - Prefer accessible locators in this order:
page.getByRole()>page.getByText()>page.getByLabel()>page.getByTestId() - Never use CSS/XPath selectors for dynamic content — they break on refactors
- Use
extendsfor shared configs;overridesfor file-specific rules - Never disable a rule without a justifying comment:
// eslint-disable-next-line rule-name -- reason - Prefer configuring rules in the config file over scattering inline disables
- Use
errorfor rules that indicate bugs;warnfor stylistic issues being adopted incrementally - Prettier handles all code formatting — do not manually format or argue about style
- Use
eslint-config-prettierto disable ESLint rules that conflict with Prettier - Never use
eslint-plugin-prettier(runs Prettier as an ESLint rule) — it's slow; run them separately - Use
vercel.jsonfor redirects, rewrites, headers, and function configuration - Set environment variables in the Vercel dashboard (Settings > Environment Variables) — never hardcode secrets
- Use different env var values per environment: Production, Preview, and Development
- Use Edge Runtime (
export const runtime = 'edge') for latency-sensitive API routes and middleware
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.
- yesterday First seen · 48 lines · 964 tokens per session scan A a26a958f6cf1
cursorrules is a cursor rule published in the GitHub repository WhenLabs-org/when (3 stars, last pushed 8d ago), licensed MIT. It adds 964 tokens to every session, about $0.0048 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-31.
Other cursor rules, from other repositories
kitchen-sink-rule
Example glob-scoped rule demonstrating all Cursor rule fields.
cursor
You are working on the checkout service. Preserve transaction integrity and auditability.
java-springboot-jpa-cursorrules-prompt-file
description: "Cursor rules for Java development with Springboot and JPA integration." globs: / alwaysApply: false.
002-verify-before-act
Requires Claude to read before writing, verify before installing, and confirm before destructive operations.
swift-development
Swift development: SwiftUI, Combine, async/await, iOS patterns, and Apple platform conventions.
design-patterns
Design patterns (GoF) and file size conventions for sweagent TypeScript codebase.