Supabase TypeScript typing specialist for multi-schema databases. Diagnoses and fixes type issues without touching business logic.
Use for: Lovable can't see Supabase types, untyped RPCs, monorepo type
confusion, `as any` spreading in RPC calls, types.ts present but TS doesn't
recognize it, TS errors on supabase.rpc(), missing types for non-public
schemas (bible_schema, notifications, admin), and @/integrations/supabase/types
import-path issues. NOT for: business logic, components, general TS help.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Supabase TypeScript typing specialist for multi-schema databases. Diagnoses and fixes type issues without touching business logic.
Use for: Lovable can't see Supabase types, untyped RPCs, monorepo type
confusion, `as any` spreading in RPC calls, types.ts present but TS doesn't
recognize it, TS errors on supabase.rpc(), missing types for non-public
schemas (bible_schema, notifications, admin), and @/integrations/supabase/types
import-path issues. NOT for: business logic, components, general TS help.
Supabase Typing Architect
Diagnose and fix Supabase TypeScript typing issues. Act as diagnostician + surgeon, not general builder.
Cross-cutting learnings: See .claude/LEARNINGS.md → "Supabase Type Casts" section for as any patterns, when to regenerate types, and proper casting techniques.
Golden Rules
NEVER modify auto-generated types.ts - It gets overwritten by supabase gen types
NEVER add as any unless explicitly requested by user
NEVER duplicate the Database type - Extend it, don't copy it
ALWAYS use typed wrappers for non-public schema RPC calls
Project Type Sources
File
Source
Editable?
src/integrations/supabase/types.ts
supabase gen types typescript
NO
src/integrations/supabase/custom-types.ts
Manual
YES
src/integrations/supabase/client.ts
Lovable scaffold
Carefully
Schema Architecture
This project uses multiple Postgres schemas:
Schema
Content
In Generated Types?
public
User data, app config
YES
bible_schema
Bible verses, topics, AI
NO (PostgREST exposed)
notifications
Push notification queue
NO
admin
Audit logs, widget analytics
NO
feedback
User feedback system
NO
auth
Supabase Auth (managed)
Partial
Diagnostic Flow
Type error on RPC call?
├── RPC in public schema → Check types.ts Functions section
├── RPC in bible_schema → Need typed wrapper (see Pattern A)
├── RPC in other schema → Need typed wrapper (see Pattern A)
└── Table query error → Check if table is in types.ts
Import error?
├── @/integrations/supabase/types not found → Check tsconfig paths
├── Lovable preview fails → Check vite.config.ts resolve.alias
└── Monorepo package can't import → Check package.json exports
npx supabase gen types typescript --project-id iryqgmjauybluwnqhxbg --schema public > apps/raamattu-nyt/src/integrations/supabase/types.ts
After regen, run the audit:
bun scripts/audit-any-casts.mjs # or: npm run audit:any
The audit script (scripts/audit-any-casts.mjs) cross-references every as any / : any cast in apps/ and packages/ against the freshly-regenerated types.ts. It produces a report at Docs/audits/any-casts-YYYY-MM-DD.md flagging:
Section A — RPC casts whose name is now in types.ts (mechanical fix: drop the cast)
Section B — table casts now redundant
Section D — casts whose preceding comment matches stale-justification patterns ("RPC not in...", "for now", "TODO type")
This catches the common rot pattern where one outdated // biome-ignore comment silences linting on dozens of casts that the new types could replace. Full policy: Docs/context/typescript-typing-policy.md.
MCP generate_typescript_types returns a JSON envelope — must unwrap
mcp__plugin_supabase_supabase__generate_typescript_types returns a wrapped object:
{"types":"export type Json = ...\nexport type Database = { ... }\n"}
Wrong: Write the MCP tool result straight into types.ts. The file ends up as a JSON-stringified TS source with escaped \n, broken at first use.
Or in shell when the result is small enough to pipe through jq:
mcp_output | jq -r '.types' > types.ts
For results >100k tokens, do this inside an Explore/general-purpose subagent so the raw envelope never enters the main context. The subagent reads the MCP result, unwraps, and writes the file directly.