database-schema-designer
Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes…
Skill by OneWave-AI
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/onewave-ai-database-schema-designer
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend, data, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/database-schema-designer
What's inside
- Skill name
database-schema-designer- Description
- Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes driven by real query patterns, ERDs, and reversible migration scripts - with PostgreSQL (including Supabase) as the default and MySQL, SQLite, and MongoDB supported. Use when the user wants to model data for a new app or feature, review or fix an existing schema, choose keys or indexes, plan multi-tenancy, normalize or denormalize, or write CREATE TABLE statements or migrations, even if they just describe their app and ask "how should I store this". For moving data between database providers, use database-migrator.
- License
- MIT
- Instructions
- 58 lines in SKILL.md · view on GitHub
Files (5)
- SKILL.md
- other-engines.md · references/
- output-format.md · references/
- postgres.md · references/
- schema-templates.md · references/
SKILL.md (first lines)
# Database Schema Designer
Design a schema that enforces the data's rules in the database and makes the app's real queries fast.
## Workflow
1. **Collect requirements.** Get from the conversation or codebase, and ask only for what blocks the design:
- Engine and version (default: PostgreSQL 18; check `docker-compose.yml`, ORM config, or Supabase project if present)
- Entities and how they relate, in plain language
- The 5-10 most frequent or most important queries, including filters and sort order
- Volume and growth (rows per table per year), read/write mix
- Tenancy (single app, multi-tenant by organization), retention, audit, and compliance needs (PII, deletion requests)
- ORM or migration tool in use (Prisma, Drizzle, Rails, Django, Alembic, Supabase migrations, plain SQL)
2. **Model entities and relationships.** List entities, attributes, and cardinality (1:1, 1:N, N:M). Normalize to 3NF by default; denormalize only for a named query that needs it, and say which.
3. **Choose keys and types** using [references/postgres.md](references/postgres.md) (or [references/other-engines.md](references/other-engines.md) for MySQL, SQLite, MongoDB). Defaults for Postgres: `bigint generated always as identity` or `uuid DEFAULT uuidv7()` primary keys, `text` over `varchar(n)`, `timestamptz` for every timestamp, `numeric` for money.
4. **Encode the rules as constraints.** `NOT NULL` wherever a value is required, `UNIQUE` for natural keys, `CHECK` for ranges and allowed values, foreign keys with a deliberate `ON DELETE` choice for each. Data rules that live only in app code get broken by the next script or admin fix.
5. **Derive indexes from the queries in step 1**, not from a checklist. For each query, name the index that serves it. Index every foreign key column you join or cascade on (Postgres does not do this automatically). Do not add an index a `UNIQUE` or primary key already provides.
6. **Write the deliverable**: DDL, ERD, index rationale, and migrations with rollback, using [references/schema-templates.md](references/schema-templates.md) and the layout in [references/output-format.md](references/output-format.md). Match the user's migration tool if they have one.
7. **Verify.** If a database is available (local Postgres, Docker `postgres:18`, a Supabase branch), run the DDL, insert a few rows, and `EXPLAIN` the key queries to confirm the planned indexes are used. Otherwise, walk each query from step 1 against the schema by hand. Then check the list below.
## Checks before delivering
- Every query from step 1 is served by a stated index or is explained as a scan that is fine at the expected size.
- Every foreign key has an explicit `ON DELETE` behavior and an index on the referencing column.
- No timestamp without time zone; no floating point for money; no `varchar(255)` by habit.
- `updated_at` actually updates: a `DEFAULT now()` only sets it on insert, so add a trigger or set it in the ORM.
- Uniqueness that should ignore case (emails, usernames) is enforced case-insensitively.
- Multi-tenant tables carry `tenant_id` (or `org_id`), include it in unique constraints and leading index columns, and have row-level security if the database is reachable from clients (always on Supabase).
- Migrations that touch large existing tables avoid long locks (see migration safety in [references/postgres.md](references/postgres.md)).
- Rollback scripts are real inverses, and destructive rollbacks (dropping a column with data) are called out.
## Worked example
Request: "Multi-tenant project tracker: orgs, users who can belong to several orgs, projects per org, tasks per project. The main screen lists a project's open tasks by due date."
- Entities: `orgs`, `users`, `org_members` (N:M between users and orgs with a `role`), `projects` (N:1 org), `tasks` (N:1 project, optional assignee).
- Key query: open tasks for one project ordered by due date, so a partial index `ON tasks (project_id, due_at) WHERE status <> 'done'`.
- Rules as constraints: `UNIQUE (org_id, user_id)` on `org_members`; `CHECK (role IN ('owner','admin','member'))`; `status` limited by `CHECK`; unique project name per org with `UNIQUE (org_id, name)`.
- Deletes: removing an org cascades to projects and tasks; deleting a user sets `tasks.assignee_id` to null instead of deleting tasks.
- Tenancy: `tasks` carries `org_id` so row-level security can check membership without a join through `projects`, and a composite foreign key `(project_id, org_id) -> projects (id, org_id)` keeps the two consistent.
The full DDL for this example is in [references/schema-templates.md](references/schema-templates.md).
## Failure modes
- Designing tables before knowing the queries, then indexing every column "just in case". Each index slows every write.
- Postgres `ENUM` types for values that will change. Adding a value is easy, but removing or renaming one is painful; a `CHECK` constraint or lookup table is easier to evolve.
- Soft deletes (`deleted_at`) added everywhere by default. They leak into every query and unique constraint. Use them where there is a real restore or audit need, and pair them with partial unique indexes.
- Polymorphic foreign keys (`commentable_type` + `commentable_id`) that the database cannot enforce. Prefer separate nullable FKs with a `CHECK` that exactly one is set, or separate tables.
- Storing structured, queried fields inside `jsonb`. JSON is for sparse or truly variable attributes; anything you filter, join, or constrain on deserves a column.From OneWave-AI/claude-skills, MIT.
More from OneWave-AI/claude-skills
- 0.625score
scout-pro
OneWave-AI
Enhanced skill navigator that maps conversation history, recommends multi-skill chains, identifies patterns from past usage, and learns from session outcomes.
SkillAFreshness: A★ 373Claude Code +9 - 0.623score
gillby-water
OneWave-AI
Plan Florida boating, fishing, paddling, surf and beach outings using Gillby's sourced marine forecasts, tides, coastal places and vessel-aware tools.
SkillAFreshness: A★ 373Claude Code +9 - 0.620score
scout
OneWave-AI
Analyzes current conversation context to recommend the best skills and subagents for the task at hand.
SkillAFreshness: A★ 373Claude Code +9 - 0.592score
devils-advocate
OneWave-AI
Argues the strongest honest case against a decision, plan, belief, hire, pricing move, strategy, or piece of work the user is leaning toward.
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
bookkeeping-close
OneWave-AI
Runs small and midsize business bookkeeping operations - categorizes bank and card transactions to a chart of accounts, reconciles a bank or card statement…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
landing-page-copywriter
OneWave-AI
Writes conversion-focused landing page copy - headlines, subheads, value propositions, feature and benefit blocks, social proof, FAQs, and CTA button text -…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
csv-excel-merger
OneWave-AI
Merges, appends, joins, and deduplicates multiple CSV, TSV, and Excel files (including multi-sheet workbooks) with pandas - mapping mismatched column names to…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
code-review-pro
OneWave-AI
Performs a deep code review of files, modules, a diff, or a branch - finding security vulnerabilities (mapped to OWASP Top 10:2025), correctness bugs…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
crm-data-cleanup
OneWave-AI
Cleans up CRM data from HubSpot, Salesforce, Pipedrive, Zoho, Close, Attio, or any CRM CSV export.
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
bi-measure-builder
OneWave-AI
Writes, explains, debugs, and optimizes BI calculations - Power BI / Fabric DAX measures and calculated columns, Tableau calculated fields…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
design-export-repair
OneWave-AI
Fixes broken decks/PDFs exported from Claude's "Design" feature (or similar AI deck generators) — cut-off or clipped text, wrong/substituted fonts, and…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
jev-eval
OneWave-AI
Build and run a labelled eval set for a System One model (Jev, Von, or any typed-decision config), then sweep criteria wordings and thresholds against it.
SkillBFreshness: B★ 373Claude Code +9
Signals
- Stars
- 373
- Forks
- 60
- Open issues
- 1
- Last commit (this folder)
- Sep 23, 2026 (1 month ago)
- Last release
- Jun 8, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/OneWave-AI/claude-skills
- Website
- www.onewave-ai.com
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from OneWave-AI
- 0.625score
scout-pro
OneWave-AI
Enhanced skill navigator that maps conversation history, recommends multi-skill chains, identifies patterns from past usage, and learns from session outcomes.
SkillAFreshness: A★ 373Claude Code +9 - 0.623score
gillby-water
OneWave-AI
Plan Florida boating, fishing, paddling, surf and beach outings using Gillby's sourced marine forecasts, tides, coastal places and vessel-aware tools.
SkillAFreshness: A★ 373Claude Code +9 - 0.620score
scout
OneWave-AI
Analyzes current conversation context to recommend the best skills and subagents for the task at hand.
SkillAFreshness: A★ 373Claude Code +9 - 0.592score
csv-excel-merger
OneWave-AI
Merges, appends, joins, and deduplicates multiple CSV, TSV, and Excel files (including multi-sheet workbooks) with pandas - mapping mismatched column names to…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
code-review-pro
OneWave-AI
Performs a deep code review of files, modules, a diff, or a branch - finding security vulnerabilities (mapped to OWASP Top 10:2025), correctness bugs…
SkillBFreshness: B★ 373Claude Code +9 - 0.592score
bi-measure-builder
OneWave-AI
Writes, explains, debugs, and optimizes BI calculations - Power BI / Fabric DAX measures and calculated columns, Tableau calculated fields…
SkillBFreshness: B★ 373Claude Code +9
Cite this page
database-schema-designer skill. Agent Mart. https://agentmart.dev/skills/onewave-ai-database-schema-designer (last updated 2026-10-24)