yugabytedb-schema-designlisted
Install: claude install-skill srinivasa-vasu/agent-skills
# YugabyteDB Schema Design Best Practices
This skill covers **how to design schemas well** for YugabyteDB: the design patterns that make a schema performant in a distributed SQL environment.
## Two Modes
- **Design mode**: the user is designing or changing tables and indexes. Use the reference files
below and the golden rules.
- **Review mode**: the user wants an *existing* database reviewed: live (you may connect) or offline
(they have, or can produce, a schema dump / stats export / statements file). Read
`references/review-mode.md` first. It covers the bundle, safety rules, the scripts, how to triage
the analyzer's findings, and the rollout runbook. Never run DDL or `ANALYZE` against the user's
database. Changes go into two phased change sets with their rollbacks: `changes-minimal.sql`
(access paths and waste) and `changes-ideal.sql` (also removes write hot spots), rendered from the
triaged `findings.json` so the SQL always matches the report; where the two sets differ, the
report shows both, and a finding's `"profile"` moves it between them. With statements
(`pg_stat_statements` or tserver `:13000/statements`), the analyzer also checks each query's
conditions against the PK and indexes, weighted by calls and mean time; its proposed indexes go
in the runnable `workload` phase. A statements file spanning several databases needs
`--database NAME`. Every change is checked against the end state: no proposal duplicates an
existing index, a reshaped p