Supabase Postgres Best Practices for Claude Code: Review an Index Proposal
Supabase's skill provides guides for PostgreSQL queries, schema design, migrations, and row-level access, including databases outside the Supabase platform.
中文Setup for Claude Code
Claude Code with the complete pinned rule set. Static recommendations need only a local schema and query. Query-plan checks require a scratch Postgres instance with representative sample data.
- Copy skills/supabase-postgres-best-practices into .claude/skills/supabase-postgres-best-practices/ and retain its references.
- Start Claude Code in a scratch project. Supply the schema, query, and expected filtering or sorting pattern.
- Invoke the skill for review and inspect any proposed migration before testing it in a local database.
Example task
Provide an orders table with customer_id and placed_at. Ask how to support the latest ten orders per customer, and request before/after query-plan checks using only a local test database.Expected result
The review proposes an index aligned with the predicate and sort, explains write/storage costs, and describes what to inspect in both query plans.
Upstream documentation
Original SKILL.md on GitHub · MIT license · Source reviewed
Frequently asked question
Is this limited to Supabase-managed databases?
No. The published recommendations apply to PostgreSQL generally. Platform-specific guidance is identifiable in its references.