# Schema Designer

> Design normalized Postgres/Supabase schemas — tables, columns, types, keys, indexes, and constraints with consistent naming. Use when creating a new database schema, adding tables, or reviewing a data model.

- **Type:** Skill
- **Install:** `agentstack add skill-m-binimran-dev-pack-schema-designer`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [m-binimran](https://agentstack.voostack.com/s/m-binimran)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [m-binimran](https://github.com/m-binimran)
- **Source:** https://github.com/m-binimran/dev-pack/tree/main/skills/schema-designer

## Install

```sh
agentstack add skill-m-binimran-dev-pack-schema-designer
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# schema-designer

Design a Postgres schema that's correct first, fast second.

## Process
1. **List the entities and relationships** before writing SQL. State cardinality (1:1, 1:N, N:M).
2. **Normalize to 3NF** unless there's a measured reason to denormalize. Note any denormalization explicitly.
3. **Write the DDL** following the conventions below.
4. **Add indexes** for every foreign key and every column used in frequent `WHERE`/`ORDER BY`. Justify each.
5. **Add constraints** — `NOT NULL`, `CHECK`, `UNIQUE`, FK `ON DELETE` behavior. Don't leave integrity to app code.

## Conventions
- Tables: plural snake_case (`order_items`). Columns: snake_case.
- Primary key: `id uuid primary key default gen_random_uuid()` (Supabase-friendly).
- Timestamps: `created_at timestamptz not null default now()`, `updated_at timestamptz` (with a trigger).
- Foreign keys: `_id`, always with an explicit `references` + `on delete` rule.
- Money: `numeric(12,2)`, never `float`. Booleans: `is_`/`has_` prefix.

## Output
- The `create table` statements.
- The index list with a one-line reason each.
- A note on which tables need RLS (hand off to `rls-policy`) and which columns hold PII.

## Guardrails
- Don't ship a table holding user data with RLS unconsidered.
- Don't use `text` for everything — pick real types and constraints.
- For N:M, create the explicit join table; don't fake it with arrays unless justified.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [m-binimran](https://github.com/m-binimran)
- **Source:** [m-binimran/dev-pack](https://github.com/m-binimran/dev-pack)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-m-binimran-dev-pack-schema-designer
- Seller: https://agentstack.voostack.com/s/m-binimran
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
