normalization-patterns
Database normalization/denormalization pattern library. An extension skill for data-modeler that provides 1NF-BCNF criteria, functional dependency analysis, step-by-step normalization procedures, strategic denormalization patterns, and common domain ERD templates. Use when data modeling involves 'normalization', 'denormalization', 'ERD patterns', 'functional dependencies', 'table splitting', 'relationship design', etc. Note: DDL generation and query optimization are outside the scope of this skill.
Best use case
normalization-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Database normalization/denormalization pattern library. An extension skill for data-modeler that provides 1NF-BCNF criteria, functional dependency analysis, step-by-step normalization procedures, strategic denormalization patterns, and common domain ERD templates. Use when data modeling involves 'normalization', 'denormalization', 'ERD patterns', 'functional dependencies', 'table splitting', 'relationship design', etc. Note: DDL generation and query optimization are outside the scope of this skill.
Teams using normalization-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/normalization-patterns/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How normalization-patterns Compares
| Feature / Agent | normalization-patterns | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Database normalization/denormalization pattern library. An extension skill for data-modeler that provides 1NF-BCNF criteria, functional dependency analysis, step-by-step normalization procedures, strategic denormalization patterns, and common domain ERD templates. Use when data modeling involves 'normalization', 'denormalization', 'ERD patterns', 'functional dependencies', 'table splitting', 'relationship design', etc. Note: DDL generation and query optimization are outside the scope of this skill.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Normalization Patterns — Normalization/Denormalization Pattern Library
Normalization rules, denormalization strategies, and domain-specific ERD patterns used by the data-modeler agent during data modeling.
## Target Agent
`data-modeler` — Directly applies the normalization rules and ERD patterns from this skill to data model designs.
## Normalization Stage Identification & Transformation
### 1NF (First Normal Form)
**Rule**: Every column must contain atomic (indivisible) values.
| Violation Pattern | Problem | Solution |
|------------------|---------|----------|
| Multi-value column | `tags = "java,python,go"` | Separate table (M:N) |
| Repeating groups | `phone1, phone2, phone3` | Separate table (1:N) |
| Composite values | `address = "123 Main St, City, State"` | Split into street/city/state columns |
### 2NF (Second Normal Form)
**Prerequisite**: Satisfies 1NF
**Rule**: Remove partial functional dependencies — separate columns that depend on only part of a composite primary key.
| Violation Example | Dependency | Solution |
|------------------|------------|----------|
| `order_details(order_id, product_id, product_name, quantity)` | product_name depends only on product_id | Separate into products table |
### 3NF (Third Normal Form)
**Prerequisite**: Satisfies 2NF
**Rule**: Remove transitive functional dependencies — a non-key column must not determine another non-key column.
| Violation Example | Dependency | Solution |
|------------------|------------|----------|
| `employees(id, dept_id, dept_name, dept_head)` | dept_name, dept_head transitively depend on dept_id | Separate into departments table |
### BCNF (Boyce-Codd Normal Form)
**Rule**: Every determinant must be a candidate key.
| Violation Example | Problem | Solution |
|------------------|---------|----------|
| `enrollment(student, course, professor)` where professor -> course | Professor is a determinant but not a candidate key | Separate into professor-course table |
## Normalization Decision Flowchart
```
Data Analysis
├─ Atomic value violation? -> 1NF transformation
├─ Composite key & partial dependency? -> 2NF transformation
├─ Transitive dependency? -> 3NF transformation
├─ Non-candidate-key determinant? -> BCNF transformation
└─ Performance requirements -> Review strategic denormalization
```
## Strategic Denormalization Patterns
### When to Denormalize?
- When the read-to-write ratio is very high
- Frequent queries requiring 5+ JOINs
- When real-time aggregation/statistics are needed
- Dashboard/report-specific data
### Denormalization Pattern Catalog
| Pattern | Description | Suitable For | Trade-offs |
|---------|-------------|-------------|------------|
| **Derived column** | Store computed values (`total_price`) | Frequent sum lookups | Requires sync on update |
| **Duplicated column** | Copy frequently used FK target columns | Avoiding JOINs | Data inconsistency risk |
| **Pre-joined table** | Materialize join results as physical table | Reports/dashboards | Storage space, update complexity |
| **History snapshot** | Preserve point-in-time data (`order_address`) | Storing address at time of order | Storage space |
| **Counter column** | `likes_count`, `comments_count` | Real-time count display | Concurrency handling |
| **JSON/JSONB** | Unstructured extension data | Settings, metadata | Indexing limitations |
## Common Domain ERD Patterns
### E-Commerce
```
users ──1:N──> orders ──1:N──> order_items
│ │
└──1:N──> addresses products
└──1:N──> reviews ──N:1──────┘
│
products ──N:M──> categories (via product_categories)
products ──1:N──> product_images
products ──1:N──> product_variants
```
Core tables:
- `users` (id, email, name, password_hash, created_at)
- `products` (id, name, description, base_price, status)
- `orders` (id, user_id, status, total, shipping_address_snapshot)
- `order_items` (id, order_id, product_id, variant_id, quantity, unit_price)
### SaaS Multi-Tenant
```
tenants ──1:N──> users ──N:M──> roles (via user_roles)
│ │
└──1:N──> subscriptions permissions ──N:M──> roles
└──1:N──> [domain tables] (tenant_id FK)
```
Key point: Include `tenant_id` in all business tables; apply RLS (Row Level Security)
### Social Network
```
users ──N:M──> users (via follows: follower_id, following_id)
│
└──1:N──> posts ──1:N──> comments
│ └──N:M──> tags (via post_tags)
│ └──1:N──> likes (user_id + post_id UNIQUE)
└──1:N──> messages (sender_id, receiver_id)
```
### CMS/Blog
```
users ──1:N──> posts ──N:M──> tags (via post_tags)
│
└──1:N──> comments (self-referencing: parent_id)
└──1:N──> media
└──1:1──> post_meta (SEO, OG tags, etc.)
```
## Relationship Patterns
### 1:1 Relationship
- Large table splitting (frequently used columns vs rarely used columns)
- Optional extension (`user` + `user_profile`)
- Implementation: FK + UNIQUE constraint
### 1:N Relationship
- Most common relationship type
- Self-referencing: category trees, comment threads (`parent_id`)
- Implementation: FK on the child table
### M:N Relationship
- Junction table required
- Junction table may include additional attributes (`created_at`, `role`, `quantity`)
- Naming: `{table1}_{table2}` or a meaningful name (`enrollments`)
## Common Column Patterns
### Default Timestamps
Include in all tables:
- `id` — UUID or BIGINT AUTO_INCREMENT
- `created_at` — TIMESTAMPTZ DEFAULT NOW()
- `updated_at` — TIMESTAMPTZ, auto-updated via trigger
### Soft Delete
- `deleted_at` — TIMESTAMPTZ NULL (NULL means not deleted)
- All queries include `WHERE deleted_at IS NULL` condition
- Enables restoration and serves as audit trail
### Status Management
- `status` — ENUM or VARCHAR
- State transition rules must be documented (which states can transition to which)
- If history is needed, use a separate `status_history` table
### Internationalization
- Strategy 1: Column extension (`name_ko`, `name_en`, `name_ja`)
- Strategy 2: Translation table (`product_translations`: product_id, locale, name, description)
- Strategy 2 recommended (no schema changes needed when adding languages)Related Skills
risk-response-patterns
risk response strategy pattern library. response-strategist and monitoring-planner agent risk response plan establishto do when reference. 'risk response', 'mitigation strategy', 'response plan' request when usage. However, insurance design legal risk specialistdocument scope outside.
rhetoric-patterns
numbercompany pattern library. speech-writer and debate-preparer agent persuasioncapability speech and buildingto do when reference. 'numbercompany', ' structure', 'persuasion technique' request when usage. However, actual presentation nature training scope outside.
kpi-dashboard-patterns
KPI dashboard design pattern. analyst agent core indicator analysisand executive-summarizer management reporting dashboard compositionto do when reference. 'KPI analysis', 'dashboard design', ' indicator' request when usage. However, actualtime BI whensystem building scope outside.
diagram-patterns
Mermaid diagram pattern library. diagram-maker agent technical document diagram writingto do when reference verifydone pattern . 'diagram pattern', 'Mermaid template', ' diagram pattern' request when usage. However, actual un-degree specialistperson tool work scope outside.
code-example-patterns
technical document code example pattern library. doc-writer agent code example, writingto do when reference. 'code example pattern', ' code writing' request when usage. However, actual code file test execution scope outside.
claim-drafting-patterns
Strategic drafting patterns and claim scope design guide for patent claims. The 'claim-drafter' and 'patent-reviewer' agents must use this skill's drafting patterns, terminology rules, and dependent claim strategies when writing or verifying claims. Used for 'claim drafting', 'claim scope design', 'dependent claim strategy', etc. Note: Overall patent orchestration or prior art search is outside the scope of this skill.
sdk-design-patterns
SDK/API client design patterns: builder pattern, interceptor chain, retry strategy, type-safe design, error handling, and pagination wrapper guide. Use this skill for requests involving 'SDK design', 'client patterns', 'retry strategy', 'interceptor', 'builder pattern', 'SDK error handling', 'type safety', 'SDK architecture', etc. Enhances sdk-developer's SDK design capabilities. Note: API spec parsing, test authoring, and documentation are outside the scope of this skill.
openapi-spec-patterns
OpenAPI 3.x spec analysis patterns, schema normalization, authentication method mapping, pagination/error pattern extraction, and GraphQL/gRPC spec interpretation guide. Use this skill for requests involving 'OpenAPI', 'Swagger', 'spec analysis', 'schema normalization', 'API authentication', 'pagination patterns', 'GraphQL schema', 'gRPC proto', etc. Enhances spec-parser's spec analysis capabilities. Note: SDK code generation and test authoring are outside the scope of this skill.
data-validation-patterns
Migration data validation patterns: row count comparison, checksums, sampling validation, FK integrity, and business rule validation query design guide. Use this skill for requests involving 'data validation', 'migration validation', 'checksum', 'row count comparison', 'integrity validation', 'regression testing', 'Go/No-Go checklist', etc. Enhances validation-engineer's validation design capabilities. Note: schema mapping and rollback planning are outside the scope of this skill.
query-optimization-patterns
SQL/NoSQL query optimization pattern, execution plan analysis, index strategy, N+1 resolution etc. database performance optimization guide. 'query optimization', 'execution plan', 'EXPLAIN', 'index ', 'N+1 ', 'slow query', 'slow query', 'DB performance' etc. database query performance improvement this for. bottleneck-analystand optimization-engineerof DB performance analysis -ize. , before system profilingthis benchmark execution this of scope .
test-design-patterns
Patterns for effective test design, including boundary value analysis, equivalence partitioning, state transition testing, and other systematic test case derivation methodologies. Use this skill for 'test design', 'test case derivation', 'boundary value analysis', 'equivalence partitioning', 'state transition testing', 'pairwise', 'test matrix', and other test design tasks. Enhances the test design capabilities of test-strategist and unit-tester. Note: test infrastructure setup and CI/CD configuration are outside the scope of this skill.
distributed-patterns
Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.). Use this skill for 'distributed transactions', 'Saga pattern', 'CQRS', 'circuit breaker', 'event sourcing', 'distributed patterns', 'compensating transactions', 'eventual consistency', and other distributed system pattern applications. Enhances the distributed system design capabilities of communication-designer and service-architect. Note: infrastructure setup and monitoring configuration are outside the scope of this skill.