Skip to main content
subagent

supabase-schema-architect — Claude Code subagent: Supabase schemas

A subagent that designs PostgreSQL schemas in Supabase, plans migrations and writes RLS policies. Useful when your database grows and access rules need sorting out.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --agent database/supabase-schema-architect
Open on GitHub

What supabase-schema-architect does

The subagent covers three areas: schema, migrations, RLS. It designs normalized tables, relationships and indexes, prepares reversible migrations with a rollback plan, and describes Row Level Security policies with role-based access. Its tools are plain: Read, Write, Edit, Bash — it reads project files, edits them and runs commands.

The workflow runs in order: analyze the current schema, assess application requirements, write migration scripts and policies, then validate on staging and test the rollback. The reply includes a schema breakdown, new tables with columns and indexes, policies with a performance note, and implementation files — migration SQL, policy definitions, TypeScript types.

Some targets are baked into the prompt: normalization up to 3NF, snake_case naming, RLS coverage for tables holding sensitive data, migrations wrapped in transactions. Treat those as aims, not hard limits. Analyzing the current schema requires a Supabase connection over MCP; without it the agent works only with what sits in your project files.

What it helps with

  • design a normalized schema for a new feature
  • write a migration with a rollback plan that works
  • lock down tables with RLS policies without breaking access
  • lay out relationships and indexes so queries stay fast
  • generate TypeScript types for a changed schema

Example prompts for the agent

  • analyze the current Supabase schema and propose a migration for an orders table
  • write RLS policies for the profiles table so a user sees only their own row
  • draft a migration plan with rollback for renaming columns in users

How to install supabase-schema-architect

1claude-code-templates

npx claude-code-templates@latest --agent database/supabase-schema-architect

2Manually: put the files in place

.claude/agents/supabase-schema-architect.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about supabase-schema-architect

How do I install supabase-schema-architect in Claude?

Through the templates: npx claude-code-templates@latest --agent database/supabase-schema-architect. The agent file lands at .claude/agents/supabase-schema-architect.md.

What does supabase-schema-architect do?

It designs PostgreSQL schemas in Supabase, plans migrations with rollback, and writes Row Level Security policies. The output includes SQL, policy definitions and TypeScript types.

Does the agent need a Supabase MCP server?

For analyzing the current schema, yes — that step goes through MCP. Without it the agent relies only on your project files.

Similar subagents

All subagents for Data and databases →
supabase-postgres-best-practices official supabase Supabase guidelines for Postgres performance optimization. Helps developers write SQL queries, design database schemas, and configure RLS. CX Codex GP ChatGPT 40installs power-platform-architect official Tim Hanewich This skill turns business requirements, use cases, and meeting transcripts into a Power Platform solution architecture with component choices and Mermaid.js diagrams. 205installs graphql-architect VoltAgent Community Designs GraphQL schemas for microservices, federation, and distributed graphs. Use it when an API needs structured evolution or query analysis. 1,038installs recsys-pipeline-architect Seth Hobson Designs six-stage recommendation, ranking, and feed pipelines. Use it when a system must choose the top K items for a user and context. CX Codex 4,200installs ai-engineer Seth Hobson This subagent designs LLM applications, RAG systems, and AI agents. Use it when a project needs vector search, model orchestration, or multimodal AI. CX Codex 7,687installs business-analyst Seth Hobson This subagent analyzes business data and helps shape KPIs, forecasts, and financial models. Use it to turn a business question into an analysis plan and recommendations. CX Codex 3,855installs sql-pro VoltAgent Community Subagent for optimizing complex SQL queries, designing database schemas, and fixing performance bottlenecks across PostgreSQL, MySQL, SQL Server, and Oracle. 3,602installs sql-pro Seth Hobson Helps design database schemas, inspect query plans, and tune SQL for OLTP and OLAP systems. Use it for database optimization or complex analysis. CX Codex 3,602installs

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor