From cklph-nextjs
The Supabase-generated types file is the source of truth for schema. Use when touching any service, repository, query, insert, or update against the database, before adding/changing a column or table, or any time "is column X required?" comes up.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cklph-nextjs:data-modelThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Supabase generates the canonical TypeScript map. Don't re-derive it. Don't trust your memory of the
Supabase generates the canonical TypeScript map. Don't re-derive it. Don't trust your memory of the schema. Read the generated file before touching anything DB-shaped.
lib/types/database.ts — produced by:
supabase gen types typescript --linked > lib/types/database.ts
Regenerate after every migration and commit the regenerated file in the same commit as the
migration, so reviewers see schema + types together. (Codified in discipline.)
Database['public']['Tables']['<name>']['Row'] — what comes back from SELECT.Database['public']['Tables']['<name>']['Insert'] — what's required on INSERT. TypeScript marks
NOT NULL columns as required; columns with DEFAULT or NULLABLE as optional. Forget a
required column → TS yells before runtime.Database['public']['Tables']['<name>']['Update'] — all optional (partial update).Database['public']['Enums']['<name>'] — the enum literal union. Use this, never a raw string.Database['public']['Functions']['<name>'] — RPC return types.Use these types in your service signatures — never hand-roll a { name: string; … } for a row
that already has a generated type.
as Row casts when TypeScript complains — usually means the migration is committed but types
weren't regenerated. Regenerate; don't cast.lib/types/database.ts by hand — it's regenerated. Your edits get blown away.Pair with supabase-migrations (the CLI workflow that produces schema changes), architecture
(the layered structure that consumes these types), and api-routes (where service signatures
flow into route handlers).
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub chykalophia/cklph-marketplace --plugin cklph-nextjs