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/chand1012/cursorrulesWrote 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/chand1012/cursorrules/supabase-create-functions)<a href="https://agentmods.dev/rules/chand1012/cursorrules/supabase-create-functions"><img src="https://agentmods.dev/badge/rules/chand1012/cursorrules/supabase-create-functions/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/chand1012/cursorrules/supabase-create-functions"><img src="https://agentmods.dev/badge/rules/chand1012/cursorrules/supabase-create-functions.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.00785 | $0.00785 |
| Opus 5.5 | $0.00314 | $0.00314 |
| Sonnet 5.5 | $0.00157 | $0.00157 |
| Haiku 4.5 | $0.00078 | $0.00078 |
Grade A, and why
supabase-create-functions 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 3mo 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.
This is a copy
92% identical to guidelines-for-writing-supabase-database-functions — 5 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 — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Guidelines for writing Supabase database functions globs: **/*.sql alwaysApply: false
Database: Create functions
You're a Supabase Postgres expert in writing database functions. Generate high-quality PostgreSQL functions that adhere to the following best practices:
General Guidelines
-
Default to
SECURITY INVOKER:- Functions should run with the permissions of the user invoking the function, ensuring safer access control.
- Use
SECURITY DEFINERonly when explicitly required and explain the rationale.
-
Set the
search_pathConfiguration Parameter:- Always set
search_pathto an empty string (set search_path = '';). - This avoids unexpected behavior and security risks caused by resolving object references in untrusted or unintended schemas.
- Use fully qualified names (e.g.,
schema_name.table_name) for all database objects referenced within the function.
- Always set
-
Adhere to SQL Standards and Validation:
- Ensure all queries within the function are valid PostgreSQL SQL queries and compatible with the specified context (ie. Supabase).
Best Practices
-
Minimize Side Effects:
- Prefer functions that return results over those that modify data unless they serve a specific purpose (e.g., triggers).
-
Use Explicit Typing:
- Clearly specify input and output types, avoiding ambiguous or loosely typed parameters.
-
Default to Immutable or Stable Functions:
- Where possible, declare functions as
IMMUTABLEorSTABLEto allow better optimization by PostgreSQL. UseVOLATILEonly if the function modifies data or has side effects.
- Where possible, declare functions as
-
Triggers (if Applicable):
- If the function is used as a trigger, include a valid
CREATE TRIGGERstatement that attaches the function to the desired table and event (e.g.,BEFORE INSERT).
- If the function is used as a trigger, include a valid
Example Templates
Simple Function with SECURITY INVOKER
create or replace function my_schema.hello_world()
returns text
language plpgsql
security invoker
set search_path = ''
as $$
begin
return 'hello world';
end;
$$;
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.
- 3mo ago First seen · 137 lines · 785 tokens per session scan A 1073597057b5
supabase-create-functions is a cursor rule published in the GitHub repository chand1012/cursorrules (14 stars, last pushed 12mo ago), licensed MIT. It adds 785 tokens to every session, about $0.0031 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 92% identical to guidelines-for-writing-supabase-database-functions, differing in 5 lines, and is treated as a copy.
supabase-create-functions compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| supabase-create-functionschand1012/cursorrules | Cursor rule | 14 | 12mo ago | MIT | A | 785 | Cursor |
| sql-queries-not-astsprisma/orm | Cursor rule | 48k | today | Apache-2.0 | A | 443 | Codex, Cursor |
| supabaseHelicone/helicone | Cursor rule | 6.3k | 6d ago | Apache-2.0 | A | 117 | Cursor |
| java-springboot-jpa-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 1,006 | Cursor |
| vibes-plug-backendroedyrustam/vibes-plug | Cursor rule | 131 | 5d ago | MIT | A | 0 | Cursor |
| background-workBetterTyped/hype-stack | Cursor rule | 14 | 7d ago | MIT | A | 0 | Cursor |
| windsurfrulesAnandPilania/eloquentjs | Cursor rule | 75 | 2mo ago | MIT | A | 826 | Windsurf |