From db-tools
This skill should be used when the user asks to "review database design", "check table normalization", "audit database schema", "verify RLS configuration", "check if tables follow 3NF", "find database anti-patterns", "审查数据库设计", "检查表规范化", "验证 RLS 配置", or mentions database design issues like redundancy or normalization.
How this skill is triggered — by the user, by Claude, or both
Slash command
/db-tools:db-design-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides comprehensive guidance for reviewing PostgreSQL/Supabase database designs. It helps identify normalization violations, anti-patterns, and Supabase-specific issues to ensure data integrity and optimal performance.
This skill provides comprehensive guidance for reviewing PostgreSQL/Supabase database designs. It helps identify normalization violations, anti-patterns, and Supabase-specific issues to ensure data integrity and optimal performance.
Start Review
↓
[1] Check PRIMARY KEY exists?
→ No → Add primary key
→ Yes ↓
[2] Check snake_case naming?
→ No → Rename
→ Yes ↓
[3] Multi-value cells? (comma-separated)
→ Yes → Violates 1NF, create junction table
→ No ↓
[4] Repeated column groups? (item1, item2, item3)
→ Yes → Violates 1NF, create child table
→ No ↓
[5] Composite PK with partial dependency?
→ Yes → Violates 2NF, split table
→ No/N/A ↓
[6] Has X_id + X_name in same table?
→ Yes → Violates 3NF, extract X to separate table
→ No ↓
[7] Foreign key columns indexed?
→ No → Add index
→ Yes ↓
[8] (Supabase) RLS enabled?
→ No → Enable RLS + add policies
→ Yes ↓
✅ Table passes review
| Check | Pass Criteria |
|---|---|
| Single value per cell? (no comma-separated lists) | ✅ |
| Table has primary key? | ✅ |
| No repeated columns? (no phone1, phone2, phone3) | ✅ |
Only check for composite primary keys
| Check | Pass Criteria |
|---|---|
| Satisfies 1NF? | ✅ |
| Each non-key column depends on entire composite key? | ✅ |
| Check | Pass Criteria |
|---|---|
| Satisfies 2NF? | ✅ |
| No dependency between non-key columns? | ✅ |
| Each non-key column determined only by primary key? | ✅ |
Execute schema inspection queries to collect:
Use scripts/check-schema.sql to perform:
For each table, ask:
Output findings in Markdown table format:
# Database Design Review Report
## Overview
| Metric | Value |
|--------|-------|
| Total Tables | X |
| Passed | X |
| Needs Fix | X |
## Structure Check Results
| Check | Status | Problem Tables | Recommendation |
|-------|--------|----------------|----------------|
| Primary Key | ✅/❌ | ... | ... |
## Normalization Results
| Table | 1NF | 2NF | 3NF | Issues |
|-------|-----|-----|-----|--------|
| ... | ✅/❌ | ✅/❌ | ✅/❌ | ... |
## Fix Recommendations
| Priority | Table | Issue | Fix |
|----------|-------|-------|-----|
| High | ... | ... | ... |
For detailed guidance, consult:
references/normalization-guide.md - Complete three normal forms guide with examplesreferences/anti-patterns.md - Common anti-patterns and how to fix themreferences/supabase-rules.md - Supabase/PostgreSQL specific rules and templatesscripts/check-schema.sql - Automated schema checking queriesNormalization in Three Sentences:
Five Design Principles:
Three Anti-Pattern Alerts:
The following cases may justify denormalization:
Principle: Normalize first, denormalize only for proven performance issues, and document the reason.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub smarticeai/smartice-plugins --plugin db-tools