Logo de Data Modeling

Data Modeling

Comunidade
MartinOlivero
data-modeling

Esta habilidade deve ser usada ao projetar um esquema de banco de dados, modelar dados, escolher um banco de dados, planejar migrações ou configurar um ambiente multi-tenant para um SaaS. Frases que ativam a habilidade incluem "design the database", "model this data", "what database should I use", "schema for", "multi-tenant", "tenant isolation", "add an index", "how do I migrate", "SQL or NoSQL", "Postgres schema", "row level security" e "RLS". Por padrão, ela usa Postgres, modela o ambiente multi-tenant com segurança e aplica boas práticas de migração e indexação.

Add to TypingMind

Visão geral

Publicado porMartinOlivero
Repositóriosaas-builder
Nome da habilidadedata-modeling
Estrelas
4
Forks
2
Arquivos incluídos
1
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Arquivos incluídos: 1

    Scripts, templates e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente para leitura e nunca são executados.

  • Código aberto

    Publicada por MartinOlivero no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Data Modeling no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/MartinOlivero/saas-builder/tree/main/skills/data-modeling
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MartinOlivero/saas-builder.git /tmp/saas-builder
mkdir -p .claude/skills
cp -r /tmp/saas-builder/skills/data-modeling .claude/skills/data-modeling
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Data Modeling em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Data Modeling automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Data Modeling não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Data Modeling

This skill designs the schema your product runs on, and gets multi-tenant isolation right — the mistake that, when wrong, leaks one customer's data to another.

Analogy: the schema is the foundation and load-bearing walls of a house. You can repaint and rearrange furniture later cheaply; moving a load-bearing wall after move-in is expensive and dangerous. Get the structure right before building on it.

Discovery (max 3 questions, only if unknown)

  1. Is this multi-tenant (multiple orgs/customers sharing the app) or single-tenant?
  2. Is the data mostly relational (users, orders, invoices) or document-like/flexible?
  3. Are you on Supabase, Neon, or another Postgres host — or undecided?

Step 1 — Choose the database

Postgres by default — relational integrity, JSONB for flexible fields, full-text search, and it scales far. Don't reach for NoSQL without a proven document/scale reason. Every option below runs Postgres underneath, so the methodology in this skill (tenant_id + RLS, indexing, migrations) is identical regardless of host. Pick the host by how you're building:

  • InsForge — agentic-native. Built so an AI coding agent provisions the DB, runs migrations, sets RLS, and debugs through MCP, without you touching a dashboard. The natural fit when you build with an agent — which is exactly how this plugin runs. Batteries-included (Postgres + auth + RLS + storage + functions), open source. (Its published benchmarks claim faster/cheaper agent task completion vs Supabase — note those are first-party numbers, and it's a younger project (~5k⭐) than Supabase.)
  • Supabase — mature ecosystem. Batteries-included (Auth + RLS + Realtime + storage), RLS battle-tested at scale, huge community and docs (~104k⭐). The safe default when ecosystem maturity matters more than agent-native tooling.
  • Neon — serverless Postgres with branching/autoscaling; great for preview-per-PR databases.
  • Redis only for cache/sessions/real-time; Elasticsearch only for heavy full-text search.

Decision rule: building inside an AI agent and want it to own the backend end to end → InsForge. Want the largest, most-proven ecosystem → Supabase. Either way the schema design below is the same.

Step 2 — Model multi-tenancy (the critical decision)

Default to a shared schema with a tenant_id (org_id) column on every tenant-scoped table + Row-Level Security. Graduate to schema-per-tenant or DB-per-tenant only when a large enterprise customer demands hard isolation/compliance. Don't start there — it multiplies ops cost.

Make RLS airtight:

  • ENABLE ROW LEVEL SECURITY and FORCE ROW LEVEL SECURITY on every tenant table.
  • Set tenant context per request inside the transaction: SET LOCAL app.current_tenant = '...' — so pooled connections can't leak state between requests.
  • The application DB role must have neither SUPERUSER nor BYPASSRLS — otherwise RLS is silently skipped and isolation is an illusion.
  • RLS is the backstop for the app-layer tenant_id checks in the auth skill — defense in depth.

Step 3 — Schema discipline

  • Normalize to 3NF by default. Denormalize only for a measured read hot-path.
  • IDs: UUID/ULID for public-facing identifiers; bigint identity for internal PKs.
  • Index every foreign key and every column you filter/sort/join on. Postgres does not auto-index FKs. For tenant tables, lead a composite index with tenant_id, e.g. (tenant_id, created_at).
  • Timestamps: created_at / updated_at as timestamptz in UTC. Prefer soft delete (deleted_at) for user-facing data.
  • Push invariants into the schema: NOT NULL, CHECK, UNIQUE, FK constraints — not just app code.

Step 4 — Migrations

  • All schema changes go through versioned, forward-only migration files in source control (Supabase migrations, Prisma Migrate, or Drizzle).
  • Never edit the production DB by hand. Every change is a reviewable, replayable migration.
  • Delegation & fallback: if the InsForge skills are installed (npx skills add https://github.com/insforge/agent-skills), let insforge-cli apply migrations/RLS and insforge-debug diagnose issues — the agent operates the backend directly. If they're not, apply migrations through your host's CLI (Supabase / Drizzle / Prisma). This skill always owns the design; never block on a missing skill.

Handoff

The schema here backs the api-design resources and the auth permission model. Pass the tenant strategy to both so endpoints and policies scope correctly.

Step 5 — Rules that only show up in production

  • Money and stock invariants live in the database: triggers on the state transition, ON DELETE RESTRICT on anything financial, corrections by compensating entries. A hidden button is not a constraint.
  • The server sets derived and trusted values (price, cost, totals). The client sends the inputs.
  • One writer per state field. Two code paths writing the same flag will disagree.
  • Every pending state has a deadline, something that enforces it, and a UI that shows it.
  • Uniqueness under concurrency is a constraint (a unique or partial unique index), never a check in code. Detect the conflict by SQLSTATE, not by message text.
  • ON CONFLICT DO NOTHING is silent. Make sure a historical row cannot be the conflict.
  • A "day" belongs to a time zone. Store instants in UTC; cut periods in the tenant's zone; recompute derived date columns with their source.
  • Restore a backup once before you need it.

Field notes

references/field-notes.md holds 19 schema and data failures from production apps. The three that cost the most:

  1. A lost backend rebuilt from an export with no primary keys, truncated policies and no sequences.
  2. Stock at −420 because the only safeguard was a hidden button.
  3. Returning customers left unassigned forever by a silent ON CONFLICT DO NOTHING.

Output

Deliver: the DB choice with reason, the multi-tenancy strategy, the table definitions (DDL) with constraints and indexes, the RLS policies if multi-tenant, and the first migration file.

Reference

PostgreSQL docs (RLS, indexing), supabase/supabase (~104k⭐), insforge/insforge (~5k⭐, agentic-native), AWS "Multi-tenant data isolation with Postgres RLS", PlanetScale "Approaches to tenancy in Postgres".

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Data Modeling faz?

Esta habilidade deve ser usada ao projetar um esquema de banco de dados, modelar dados, escolher um banco de dados, planejar migrações ou configurar um ambiente multi-tenant para um SaaS. Frases que ativam a habilidade incluem "design the database", "model this data", "what database should I use", "schema for", "multi-tenant", "tenant isolation", "add an index", "how do I migrate", "SQL or NoSQL", "Postgres schema", "row level security" e "RLS". Por padrão, ela usa Postgres, modela o ambiente multi-tenant com segurança e aplica boas práticas de migração e indexação.

Por que usar Data Modeling no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Data Modeling é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Data Modeling no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/MartinOlivero/saas-builder/tree/main/skills/data-modeling. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Data Modeling?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Data Modeling?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Data Modeling com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Data Modeling é gratuita?

Sim. A habilidade é publicada no GitHub por MartinOlivero sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇