database-design
Designs database schemas, migration strategies, indexing, query optimization, and ORM patterns.
Skill by The13thNode
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/the13thnode-database-design
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: design, backend, data
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-design
What's inside
- Skill name
database-design- Description
- Designs database schemas, migration strategies, indexing, query optimization, and ORM patterns. Use when a team needs to design a data model, plan database migrations safely, optimize slow queries, choose between SQL and NoSQL, set up multi-tenancy, or implement soft delete patterns. Trigger for "design the database", "data model", "schema", "migration", "indexes", "slow queries", "Prisma", "Drizzle", "multi-tenancy", or "database architecture". Part of the Founder OS suite — the data layer hat.
- License
- MIT
- Instructions
- 307 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Database Design — Founder OS
The database schema is the hardest thing to change after launch. Get it right upfront. Every structural change after users have data costs exponentially more than designing it correctly first.
---
## Core Design Principles
1. **Normalise first, denormalise intentionally** — start with clean relational design, add denormalisation only when you have proven query performance problems
2. **Soft delete by default** — never hard-delete user data without a retention policy
3. **Audit columns on every table** — `created_at`, `updated_at`, `deleted_at`
4. **UUID primary keys** — not auto-increment integers (security + distributed systems)
5. **Foreign key constraints in the database** — don't rely on application logic alone
---
## Base Schema Pattern
```sql
-- Every table inherits this structure
CREATE TABLE [table_name] (
-- Primary key
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- Audit columns (always present)
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMPTZ, -- NULL = active, timestamp = soft deleted
-- Foreign keys (as needed)
org_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
created_by UUID REFERENCES users(id) ON DELETE SET NULL,
-- Domain columns
[column] [type] NOT NULL,
[column] [type], -- Nullable = truly optional
);
-- Auto-update updated_at on every update
CREATE TRIGGER update_[table]_updated_at
BEFORE UPDATE ON [table_name]
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();
```
---
## Multi-Tenancy Patterns
Choose based on your security and scale requirements:
### Pattern 1: Shared Database, Shared Schema (RLS)
```sql
-- Every table has org_id
-- Row Level Security filters automatically
ALTER TABLE [table] ENABLE ROW LEVEL SECURITY;
CREATE POLICY tenant_isolation ON [table]
USING (org_id = current_setting('app.current_org_id')::UUID);
-- In application: SET app.current_org_id = '[org_id]';
```
**Best for**: Startups, cost-sensitive, simpler operations
### Pattern 2: Shared Database, Separate Schemas
```sql
-- Each tenant gets their own schema
CREATE SCHEMA tenant_[org_id];
CREATE TABLE tenant_[org_id].users (...);
```
**Best for**: Mid-market, moderate isolation needs
### Pattern 3: Separate Databases
Each tenant gets their own database instance.
**Best for**: Enterprise, high compliance (HIPAA, financial), high-value contracts
---
## Common Schema Patterns
### Users & Authentication
```sql
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email TEXT UNIQUE NOT NULL,
email_verified BOOLEAN NOT NULL DEFAULT false,
name TEXT,
avatar_url TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMPTZ
);
CREATE TABLE user_sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL UNIQUE, -- Never store raw tokens
expires_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
last_used_at TIMESTAMPTZ
);
CREATE INDEX idx_sessions_user_id ON user_sessions(user_id);
CREATE INDEX idx_sessions_expires ON user_sessions(expires_at);
```
### Organizations (Multi-tenant B2B)
```sql
CREATE TABLE organizations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL,
slug TEXT UNIQUE NOT NULL, -- For URLs: acme-corp
plan TEXT NOT NULL DEFAULT 'free',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE org_members (From The13thNode/VibeCorp_PromptCEO, MIT.
More from The13thNode/VibeCorp_PromptCEO
- 0.454score
jira
The13thNode
Manages JIRA issues, projects, and workflows using Atlassian MCP.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ai-systems
The13thNode
Builds production-grade Claude Projects and CustomGPTs, improves AI output quality using meta-thinking prompts, and architects self-improving AI systems.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
api-design
The13thNode
Designs REST APIs, GraphQL schemas, OpenAPI specs, webhook systems, and API versioning strategies.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
authentication-skill
The13thNode
Implements authentication and authorisation systems including JWT, OAuth2, sessions, MFA, social login, RBAC, and refresh token rotation.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
bootstrapped-saas
The13thNode
Playbook for bootstrapped and early-stage SaaS founders based on proven case studies ($0 to $5M ARR with 6 people, and creator-to-business flywheel models).
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ceo-thinking-partner
The13thNode
The CEO's private brainstorming room and strategic sparring partner.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
change-management
The13thNode
Manages scope changes, strategic pivots, incident communication, and team alignment when direction changes.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
content-trust
The13thNode
Diagnoses why content isn't converting and fixes it using the Trust Architecture framework.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
corporate-structure
The13thNode
Prepares founders for all corporate structure and governance questions from investors.
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
design-consultation
The13thNode
Build a complete design system or major design direction from scratch.
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
compliance-audit
The13thNode
Generic compliance audit context.
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
confluence-expert
The13thNode
Write and publish PRDs, decision logs, sprint notes, and architecture docs to Confluence.
SkillDFreshness: D★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 26, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from The13thNode
- 0.454score
jira
The13thNode
Manages JIRA issues, projects, and workflows using Atlassian MCP.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
bootstrapped-saas
The13thNode
Playbook for bootstrapped and early-stage SaaS founders based on proven case studies ($0 to $5M ARR with 6 people, and creator-to-business flywheel models).
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
api-design
The13thNode
Designs REST APIs, GraphQL schemas, OpenAPI specs, webhook systems, and API versioning strategies.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
authentication-skill
The13thNode
Implements authentication and authorisation systems including JWT, OAuth2, sessions, MFA, social login, RBAC, and refresh token rotation.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ai-systems
The13thNode
Builds production-grade Claude Projects and CustomGPTs, improves AI output quality using meta-thinking prompts, and architects self-improving AI systems.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ceo-thinking-partner
The13thNode
The CEO's private brainstorming room and strategic sparring partner.
SkillDFreshness: D★ 3Claude Code +9
Cite this page
database-design skill. Agent Mart. https://agentmart.dev/skills/the13thnode-database-design (last updated 2026-10-24)