supabase-type-migrator

Regenerate strict Supabase types with wrapper casts for TypeScript projects.

2|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/stackconsult/RE-Engine --skill supabase-type-migrator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-type-migrator
Source: https://github.com/stackconsult/RE-Engine/tree/main/.agent/skills/supabase-type-migrator
Command: npx skills add https://github.com/stackconsult/RE-Engine --skill supabase-type-migrator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Supabase integration often yields never types or brittle inferences that cause compile-time or runtime issues. This skill regenerates strict, auto-generated Supabase types to enforce type-safety across the Database interface and DTOs.

Core Features & Use Cases

  • Wrapper types for Tables, Insert, and Update DTOs to simplify access to the generated Database interface, for example: export type Tables<T extends keyof Database['public']['Tables']> = Database['public']['Tables'][T]['Row']; export type InsertDto<T extends keyof Database['public']['Tables']> = Database['public']['Tables'][T]['Insert']; export type UpdateDto<T extends keyof Database['public']['Tables']> = Database['public']['Tables'][T]['Update'];
  • Strategies to handle never by using Wrapper Casts and Builder Casts to avoid type errors when fields are optional or missing.
  • Real-world use: improves type-safety in TypeScript projects using Supabase client APIs by ensuring strict table DTO shapes.

Quick Start

Use the supabase-type-migrator workflow to regenerate and align Supabase types in your project.

Frequently Asked Questions about supabase-type-migrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Supabase infer never types for my TypeScript table fields?

Supabase infers never types when generated Database interfaces lack strict DTOs. Regenerating types with wrapper casts for Tables, Insert, and Update DTOs eliminates never-inferred fields and restores proper type inference.

How do I generate wrapper types for Supabase Tables, Insert, and Update DTOs?

Generate wrapper types by mapping Database['public']['Tables'][T] to Row, Insert, and Update keys. This simplifies access to the generated Database interface and enforces strict type-safety across Supabase client APIs.

What's the best way to fix never type errors in Supabase TypeScript projects?

Fix never type errors by applying wrapper casts and builder casts. These strategies handle optional or missing fields in Supabase wrappers, preventing compile-time type failures and brittle runtime inferences.

Can I use this approach to align Supabase types for the public Database schema?

Yes, this approach aligns Supabase types specifically for the public Database schema. It regenerates strict auto-generated types to enforce type-safety across the Database interface and table wrappers.

When should I regenerate Supabase types to avoid runtime errors?

Regenerate Supabase types when you encounter never-inferred fields or brittle type inferences causing compile-time issues. Regenerating strict types enforces type-safety across Database interfaces and DTOs to prevent runtime errors.