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/mahdibrr/awesome-nextjs-supabaseWrote 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/mahdibrr/awesome-nextjs-supabase/nextjs-supabase-production)<a href="https://agentmods.dev/rules/mahdibrr/awesome-nextjs-supabase/nextjs-supabase-production"><img src="https://agentmods.dev/badge/rules/mahdibrr/awesome-nextjs-supabase/nextjs-supabase-production/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/mahdibrr/awesome-nextjs-supabase/nextjs-supabase-production"><img src="https://agentmods.dev/badge/rules/mahdibrr/awesome-nextjs-supabase/nextjs-supabase-production.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.00393 | $0.00393 |
| Opus 5 | $0.00197 | $0.00197 |
| Sonnet 5 | $0.00079 | $0.00079 |
| Haiku 4.5 | $0.00039 | $0.00039 |
Grade A, and why
nextjs-supabase-production 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 9d 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.
What it actually says
Next.js + Supabase Production Rules
Apply these when generating or editing code. Full reference: AGENTS.md and the Production Incident Index.
Auth & sessions
await cookies()in the App Router — never read cookies synchronously.- Use the
@supabase/ssrserver client; it must read AND write cookies, or sessions die on refresh. - Refresh the session in middleware via both request and response cookies.
Middleware
- Scope the matcher with a negative lookahead so it never touches
_next/static,_next/image, or favicons. - Exclude
/auth/callbackand login routes from protection (otherwise OAuth loops).
RLS
- Enabling RLS without a
SELECTpolicy returns[], not an error. Add scoped policies; test as anon and authenticated. - Never reference a table inside its own policy via nested
EXISTS(infinite recursion) — use aSECURITY DEFINERhelper. - Index every policy predicate column; wrap as
(SELECT auth.uid())for per-statement caching.
Server Actions & caching
revalidatePath/revalidateTagmust match the exact path/tag the cached fetch used.- Render user-scoped data dynamically; revalidate only after the write commits.
Stripe
- Verify the webhook signature against the RAW body, using the environment-scoped secret.
- Make handlers idempotent (dedupe by
event.id) and short (offload long work to a queue).
Migrations
- Use preflight checks, expand-contract changes,
lock_timeout, and a rehearsed rollback.
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.
- 9d ago First seen · 38 lines · 393 tokens per session scan A 4c70dc6c256a
nextjs-supabase-production is a cursor rule published in the GitHub repository mahdibrr/awesome-nextjs-supabase (5 stars, last pushed 1mo ago), licensed MIT. It adds 393 tokens to every session, about $0.0020 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
app-router
Next.js App Router patterns, React component standards, and project structure.
svelte-5-vs-svelte-4-cursorrules-prompt-file
Cursor rules for comparing Svelte 5 and Svelte 4 development.
python-llm-ml-workflow-cursorrules-prompt-file
Cursor rules for Python LLM & ML development with workflow integration.
nativescript
NativeScript best practices and patterns for mobile applications.
python
Python best practices and patterns for modern software development with Flask and SQLite.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.