supabase-typed-mutations — Claude Code rule for Supabase typing
The supabase-typed-mutations Claude Code rule adds Database types to Supabase insert, update, and upsert calls. It applies while an agent works with these mutations.
AGPL-3.0 ★ 1,120 updated 2026-11-16
.cursor/rules/supabase-typed-mutations.mdcWhat supabase-typed-mutations does
The rule requires Supabase mutation calls to use types that match their table. It uses the Insert and Update types under Database['public']['Tables'].
Import Database from @/app/api/database.types. For a projects update, the rule points to Database['public']['Tables']['projects']['Update']; inserts use the matching Insert type. The referenced types file must exist at that import path.
What it helps with
- type Supabase inserts for a table
- use the matching type for table updates
- add table types to
upsertcalls
Example prompts for the agent
- Add the
Databasetype to the Supabaseinsertcall forprojects. - Check that the
projectsupdate uses itsUpdatetype fromDatabase. - Type this Supabase
upsertcall using the table’sDatabasetype.
How to install supabase-typed-mutations
Manually: put the files in place
.cursor/rules/supabase-typed-mutations.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/supabase-typed-mutations.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/supabase-typed-mutations.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/supabase-typed-mutations.mdManually: put the files in place
.clinerules/supabase-typed-mutations.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about supabase-typed-mutations
How do I install supabase-typed-mutations in Claude Code?
Add the rule file at .claude/rules/supabase-typed-mutations.md.
What does supabase-typed-mutations do?
It requires Supabase insert, update, and upsert calls to use matching types from Database.
What does supabase-typed-mutations need to work?
The project needs the Database type file at @/app/api/database.types.