design-schema
Skill1 starsChanged 5 months agoMITView on GitHub
Design Postgres tables, relations, RLS policies, and tenant scoping using the data-model template. Produce a draft Supabase migration. Get approval before applying anything.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- tejastn10/workbenchtheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- tejastn10/workbench★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- build-featureSkill
- code-reviewSkill
- compliance-checkSkill
- design-architectureSkill
- design-pricingSkill
- design-uiSkill
- helpSkill
- launch-checklistSkill
- map-flowsSkill
- qa-planSkill
- scope-checkSkill
- security-auditSkill
- setup-billingSkill
- setup-deploySkill
- setup-stackSkill
- startSkill
- studio-statusSkill
- test-setupSkill
- threat-modelSkill
- validate-ideaSkill
- write-prdSkill
- write-testsSkill
The file
Files
Translate the architecture and PRD into a concrete Postgres schema with Row-Level Security policies, tenant isolation, and a ready-to-apply Supabase migration file. Non-autonomous: the full schema draft is presented and approved before any migration is applied.
Phases
- Load context — read
docs/specs/architecture.md,docs/specs/prd.md, and any existing migration files undersupabase/migrations/. If the architecture doc is missing, stop and direct to/design-architecture. - Draft tables and relations — propose each table with columns, data types, primary keys, foreign keys, and indexes. Note which tables are tenant-scoped (include a
tenant_idcolumn referencing anorganizationsortenantstable). Present the entity-relation summary for the user's review. - Design RLS policies — for every tenant-scoped table, write the RLS
ENABLE ROW LEVEL SECURITYstatement and at least a SELECT, INSERT, UPDATE, and DELETE policy usingauth.uid()and tenant scoping. Explain each policy in plain language. Flag any table that is intentionally public-read or service-role-only. - Review edge cases — check for: missing indexes on foreign keys, cascade-delete implications, enum vs. text trade-offs, and any table that stores PII (flag for encryption or masking consideration). Surface findings; get the user's decisions before locking the schema.
- Write migration draft — fill
.claude/templates/data-model.mdintodocs/specs/data-model.mdand write the migration SQL tosupabase/migrations/{timestamp}_initial_schema.sql. Show both files for approval. Do NOT runsupabase db pushor any database command until the user explicitly approves. Honor the review intensity: underfull, walk through each table and policy for sign-off; underlean, get a single confirmation before writing; undersolo, proceed and summarize after. - Apply (optional) — if the user approves application, run
supabase db pushand verify success. Report the output. Next step: point to/build-feature.
Output
docs/specs/data-model.md + supabase/migrations/{timestamp}_initial_schema.sql. Applies nothing to the database without explicit approval.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

