database-design
Skill1 starsChanged 4 months agoMITView on GitHub
Modelagem e design de banco de dados production-grade: normalização vs desnormalização, índices, chaves, transações e níveis de isolamento, migrations seguras e escolha SQL vs NoSQL. Use quando o usuário mencionar: "modelar banco", "schema", "normalização", "índice", "chave estrangeira", "transação", "isolamento", "migration", "SQL ou NoSQL", "query lenta", "design de tabela".
58 other projects use a version of this.
Adopted by
Most recently taken up by
- chaunsin/agent-skillstheir own version, first seen Nov 8, 2026
- kinhluan/skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- mahdy-gribkov/arcanatheir own version, first seen Nov 8, 2026
- KbWen/agentic-ostheir own version, first seen Nov 7, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use intelligent-routing, bash-linux and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 6 projects that use this
xenitV1Skillbash-linux
Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
Also in 7 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 7 projects that use this
pepebot-spaceSkillllm-application-dev
Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.
Also in 4 projects that use this
- +8 more from xenitV1
Other versions58 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 58
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- MoizIbnYousaf/Ai-Agent-Skills★ 1.1ksame name
- skillcreatorai/Ai-Agent-Skills★ 1.1ksame name
- MoizIbnYousaf/ai-agent-skills★ 1.1ksame name
- KbWen/agentic-os★ 229same name
- kid-sid/claude-spellbook★ 190same name
- xenitV1/Antigravity-Workflows★ 130same name
48 more not listed
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 repository70 other files it gives its agents.
- agent-creationSkill
- handoffSkill
- task-distributorSkill
- task-plannerSkill
- accessibilitySkill
- airbnb-designSkill
- airtable-designSkill
- atlassian-designSkill
- carbon-designSkill
- cloudscape-designSkill
- coinbase-designSkill
- discord-designSkill
- duolingo-designSkill
- figma-designSkill
- fluent-designSkill
- linear-designSkill
- material-designSkill
- meta-designSkill
- netflix-designSkill
- notion-designSkill
- nubank-designSkill
- one-ui-designSkill
- pinterest-designSkill
- polaris-designSkill
- premium-web-designSkill
- primer-designSkill
- reddit-designSkill
- revolut-designSkill
- robinhood-designSkill
- salesforce-lightning-designSkill
- slack-designSkill
- spectrum-designSkill
- spotify-designSkill
- stripe-designSkill
- tiktok-designSkill
- twitch-designSkill
- uber-base-designSkill
- vercel-geist-designSkill
- visionos-designSkill
- whatsapp-designSkill
- economicsSkill
- legal-basicsSkill
- negotiationSkill
- politicalSkill
- api-designSkill
- architectureSkill
- caching-strategiesSkill
- ci-cdSkill
- event-drivenSkill
- observabilitySkill
- payment-systemsSkill
- performanceSkill
- qaSkill
- refactoringSkill
- securitySkill
- system-designSkill
- testingSkill
- clone-websiteSkill
- graphifySkill
- remotionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 55 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
Relacional (Postgres): default. Relações, transações, queries ad-hoc, integridade.
“Common” is measured: kept by at least 6 in 10 of the 55 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Design
Você atua como engenheiro de dados. Objetivo: schemas corretos, íntegros e performáticos — o banco costuma sobreviver à aplicação, então errar aqui é caro. Integridade primeiro, performance com medição, nunca por palpite.
Princípios
- Normalize por padrão, desnormalize por medição — comece em 3ª forma normal (sem redundância); só desnormalize com um gargalo de leitura comprovado.
- Integridade no banco, não só na app — FKs,
NOT NULL,UNIQUE,CHECK. O banco é a última linha de defesa contra dado inválido. - Índice serve query, não tabela — crie índices a partir das queries reais (WHERE/JOIN/ORDER BY), não "por via das dúvidas". Índice acelera leitura e desacelera escrita.
- Transações para invariantes — o que precisa ser tudo-ou-nada vai numa transação; escolha o isolamento conscientemente.
- Migrations são código — versionadas, reversíveis, testadas, aplicadas de forma segura (sem lock longo em prod).
Normalização (as que importam)
| Forma | Regra | Evita |
| 1NF | Valores atômicos, sem repeating groups | Listas em coluna |
| 2NF | Sem dependência parcial de chave composta | Redundância parcial |
| 3NF | Sem dependência transitiva (campo depende só da PK) | Anomalia de update |
Desnormalização deliberada (contadores, colunas calculadas, tabelas de leitura) só quando: leitura domina, o custo de join dói e você aceita manter a cópia sincronizada.
Índices — o essencial
-- Índice composto: ordem importa (WHERE igualdade primeiro, depois range/order)
CREATE INDEX idx_orders_user_created ON orders (user_id, created_at DESC);
-- Cobre: WHERE user_id = ? ORDER BY created_at DESC → sem sort extra- Regra da leftmost prefix: índice
(a,b,c)serve queries pora,a,b,a,b,c— não porbsozinho. - Covering index: se o índice contém todas as colunas da query, o banco nem toca a tabela.
- Cuidado: cada índice custa escrita e espaço; FKs geralmente precisam de índice; use
EXPLAIN/EXPLAIN ANALYZEpara confirmar uso.
Transações & isolamento
| Nível | Previne | Custo |
| Read Committed (default PG) | Dirty read | Permite non-repeatable/phantom |
| Repeatable Read | + non-repeatable read | Mais locks/aborts |
| Serializable | Tudo (como se serial) | Maior contenção/retry |
- Escolha pelo invariante: transferência de saldo precisa de forte; listagem tolera fraco.
- Idempotência + retry para lidar com deadlock/serialization failure (o banco pode abortar; tente de novo).
- Mantenha transações curtas; nada de I/O externo dentro de transação.
Migrations seguras (zero-downtime)
- Expand → migrate → contract: adicione coluna nova (nullable) → backfill em lotes → passe a usar → remova a antiga depois.
- Evite operações que travam a tabela inteira em prod (ex: adicionar coluna com default em bancos antigos, criar índice sem
CONCURRENTLYno Postgres). - Toda migration tem
upedowntestados.
SQL vs NoSQL (escolha por acesso, não por moda)
- Relacional (Postgres): default. Relações, transações, queries ad-hoc, integridade. Cobre 90% dos casos.
- Documento (Mongo): dados aninhados que sempre são lidos juntos, schema flexível.
- Chave-valor (Redis): cache, sessão, contadores, filas.
- Coluna larga (Cassandra): escrita massiva, séries temporais, escala horizontal com padrão de acesso fixo.
- Grafo (Neo4j): relações profundas (recomendação, fraude).
Recursos externos
| Recurso | O que pegar |
| Use The Index, Luke | Como índices funcionam e como escrever queries que os usam. |
| PostgreSQL Docs | Referência de tipos, índices, isolamento, EXPLAIN. |
| Designing Data-Intensive Applications | Modelos de dados, storage engines, transações distribuídas. |
| PostgreSQL — Explain | Ler planos de execução. |
| Database normalization (guia) | Formas normais com exemplos. |
Do / Don't
| Do | Don't |
| 3NF por padrão | Desnormalizar por palpite |
| Índice a partir da query real | Índice "por precaução" |
| FK/CHECK/NOT NULL no banco | Integridade só na app |
| Migration expand→contract | ALTER que trava a tabela em prod |
EXPLAIN ANALYZE antes de otimizar | Adivinhar o gargalo |
Checklist
- Schema em 3NF (desnormalização só com gargalo medido)
- Constraints de integridade no banco (FK, NOT NULL, UNIQUE, CHECK)
- Índices derivados das queries reais, verificados com EXPLAIN
- Isolamento escolhido por invariante; transações curtas + retry
- Migrations reversíveis, seguras (sem lock longo), testadas
- Tipo de banco escolhido pelo padrão de acesso
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.

