data-modeling
Skill1 starsChanged 7 months agoMITView on GitHub
Design data models: dimensional modeling, star/snowflake schemas, normalization, entity relationships, and slowly changing dimensions. Use when designing a warehouse schema, choosing between star and snowflake schemas, modeling slowly changing dimensions, normalizing or denormalizing tables, or defining entity relationships. Trigger phrases: "design a data model", "star schema", "snowflake schema", "dimensional modeling", "slowly changing dimension", "SCD type 2", "entity relationship", "normalize this", "denormalize", "fact table", "dimension table", "data warehouse schema", "ER diagram"
16 other projects use a version of this.
Adopted by
Most recently taken up by
- getditto/agent-skillstheir own version, first seen Nov 8, 2026
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
- timmywheels/skillstheir own version, first seen Nov 1, 2026
- vindreshsingh/engineering-skillstheir own version, first seen Oct 20, 2026
- MartinOlivero/saas-buildertheir own version, first seen Oct 13, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
Used with
Projects with it also use containerization, observability and 1 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.
mmondoraSkillcontainerization
Docker best practices for cloud-native applications. Multi-stage builds, distroless images, security scanning, non-root users, Cloud Run orchestration. Use when writing Dockerfiles, configuring container builds, or deploying to Cloud Run/GKE.
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 6 projects that use this
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 5 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- microsoft/rayfin★ 646same name
- microsoft/awesome-rayfin★ 108same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- jdm4pku/RE-Skills★ 26same name
- khuynh22/agent-dev-team★ 9same name
- getditto/agent-skills★ 4same name
- MartinOlivero/saas-builder★ 4same name
- bjornjee/skills★ 2same name
- mmondora/claude-skills★ 1same name
- SWEStash/swe-workflow-skills★ 1same name
6 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 repository164 other files it gives its agents.
- instrument-data-to-allotropeSkill
- literature-reviewSkill
- nextflow-developmentSkill
- scientific-problem-selectionSkill
- scvi-toolsSkill
- single-cell-rna-qcSkill
- discover-brandSkill
- enforce-voiceSkill
- generate-guidelinesSkill
- csat-reportSkill
- customer-escalationSkill
- customer-researchSkill
- draft-responseSkill
- kb-articleSkill
- sentiment-analysisSkill
- ticket-triageSkill
- analyzeSkill
- build-dashboardSkill
- create-vizSkill
- data-context-extractorSkill
- data-pipelineSkill
- etl-designSkill
- explore-dataSkill
- sql-queriesSkill
- statistical-analysisSkill
- validate-dataSkill
- write-querySkill
- accessibility-reviewSkill
- component-librarySkill
- design-critiqueSkill
- design-handoffSkill
- design-systemSkill
- frontend-designSkill
- research-synthesisSkill
- user-researchSkill
- ux-copySkill
- wireframingSkill
- Agent DevelopmentSkill
- CLAUDE.md ManagementSkill
- MCP Server BuilderSkill
- Plugin DevelopmentSkill
- Prompt EngineeringSkill
- Skill CreatorSkill
- curriculum-designSkill
- lesson-planningSkill
- quiz-generatorSkill
- study-guideSkill
- tutoringSkill
- api-designSkill
- architectureSkill
- ci-cd-pipelineSkill
- code-reviewSkill
- database-migrationSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- documentationSkill
- error-handlingSkill
- git-workflowSkill
- incident-responseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
History requirements: Do we need to track changes over time?
- Distinctive: line 40
Recommendation for most analytics use cases: Start with a star schema. It balances query performance, simplicity, and maintainability.
- Distinctive: line 122
Every warehouse needs a date dimension:
- Distinctive: line 212
Document the entity-relationship model:
- Distinctive: line 257
Create documentation that includes:
- Distinctive: line 310
Conformed dimensions: Use the same customer dimension across all fact tables.
- Distinctive: line 313
Track history where it matters: Use SCD Type 2 for attributes that affect analysis (segment, region) and Type 1 for attributes that do not …
- Very specific: line 314
Name consistently: Use fct_ prefix for facts, dim_ prefix for dimensions.
- Distinctive: line 315
Avoid nulls in dimension keys: Use a "Unknown" or "Not Applicable" row in dimensions instead of null foreign keys.
“Common” is measured: kept by at least 6 in 10 of the 15 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
Data Modeling Skill
Design data models for analytics warehouses and operational systems. Cover dimensional modeling, normalization, entity relationships, slowly changing dimensions, and schema design patterns.
Workflow
Step 1: Understand the Modeling Context
Before designing, establish:
- Purpose: OLTP (transactional) or OLAP (analytical)?
- Consumers: BI tools, SQL analysts, applications, ML pipelines?
- Query patterns: What questions will this model answer?
- Data volume: How much data and how fast is it growing?
- Update patterns: Append-only, upserts, full replacements?
- History requirements: Do we need to track changes over time?
- Performance requirements: Sub-second dashboards or batch reports?
Step 2: Choose the Modeling Approach
| Approach | Best For | Trade-offs |
| Star schema | BI/analytics, simple queries | Some redundancy, fast queries |
| Snowflake schema | Large dimensions, storage optimization | More joins, slightly slower |
| Data Vault | Enterprise-scale, auditability | Complex, requires tooling |
| Wide/flat tables | Simple reporting, single-use | Hard to maintain, high redundancy |
| Normalized (3NF) | Transactional systems, data integrity | Too many joins for analytics |
| One Big Table (OBT) | Single-metric dashboards, BI tools | Very wide, redundant, simple |
Recommendation for most analytics use cases: Start with a star schema. It balances query performance, simplicity, and maintainability.
Step 3: Identify Facts and Dimensions
Facts (Measures -- What Happened)
Facts are the measurable events of the business:
Fact Table Checklist:
- [ ] What business process does this measure?
- [ ] What is the grain? (One row per ___)
- [ ] What are the numeric measures? (amount, quantity, duration)
- [ ] What are the foreign keys to dimensions?
- [ ] Is this additive, semi-additive, or non-additive?Types of fact tables:
| Type | Description | Example |
| Transaction | One row per event | fct_orders, fct_page_views |
| Periodic snapshot | One row per entity per period | fct_daily_balances, fct_monthly_inventory |
| Accumulating snapshot | One row per process instance, updated as milestones are reached | fct_order_fulfillment (tracks ordered, shipped, delivered dates) |
| Factless fact | Records that an event occurred, no measures | fct_student_attendance, fct_promotion_coverage |
-- Transaction fact table
CREATE TABLE fct_orders (
order_key BIGINT PRIMARY KEY, -- Surrogate key
order_id VARCHAR(50) NOT NULL, -- Natural/business key
customer_key BIGINT REFERENCES dim_customers,
product_key BIGINT REFERENCES dim_products,
date_key INTEGER REFERENCES dim_date,
channel_key INTEGER REFERENCES dim_channels,
-- Measures
quantity INTEGER NOT NULL,
unit_price DECIMAL(12,2) NOT NULL,
discount_amount DECIMAL(12,2) DEFAULT 0,
gross_revenue DECIMAL(12,2) NOT NULL,
net_revenue DECIMAL(12,2) NOT NULL,
tax_amount DECIMAL(12,2) DEFAULT 0,
-- Metadata
_loaded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP()
);Dimensions (Context -- Who, What, Where, When)
Dimensions provide the context for analyzing facts:
-- Dimension table
CREATE TABLE dim_customers (
customer_key BIGINT PRIMARY KEY, -- Surrogate key
customer_id VARCHAR(50) NOT NULL, -- Natural key
customer_name VARCHAR(200),
email VARCHAR(200),
segment VARCHAR(50), -- Enterprise, SMB, Consumer
industry VARCHAR(100),
country VARCHAR(100),
region VARCHAR(50),
acquisition_channel VARCHAR(50),
first_order_date DATE,
lifetime_orders INTEGER,
lifetime_revenue DECIMAL(14,2),
is_active BOOLEAN,
-- SCD metadata
_valid_from TIMESTAMP NOT NULL,
_valid_to TIMESTAMP DEFAULT '9999-12-31',
_is_current BOOLEAN DEFAULT TRUE,
-- Audit
_loaded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP()
);Step 4: Design the Date Dimension
Every warehouse needs a date dimension:
CREATE TABLE dim_date (
date_key INTEGER PRIMARY KEY, -- YYYYMMDD format
full_date DATE NOT NULL,
day_of_week INTEGER, -- 1=Monday, 7=Sunday
day_name VARCHAR(10), -- Monday, Tuesday...
day_of_month INTEGER,
day_of_year INTEGER,
week_of_year INTEGER,
iso_week INTEGER,
month_number INTEGER,
month_name VARCHAR(10),
month_short VARCHAR(3), -- Jan, Feb...
quarter_number INTEGER,
quarter_name VARCHAR(2), -- Q1, Q2, Q3, Q4
year_number INTEGER,
year_month VARCHAR(7), -- 2024-01
year_quarter VARCHAR(7), -- 2024-Q1
fiscal_year INTEGER,
fiscal_quarter INTEGER,
is_weekend BOOLEAN,
is_holiday BOOLEAN,
holiday_name VARCHAR(100)
);Step 5: Handle Slowly Changing Dimensions (SCD)
| SCD Type | Strategy | When to Use |
| Type 0 | Never update | Fixed attributes (birth date, original sign-up date) |
| Type 1 | Overwrite | Current value is all that matters, no history needed |
| Type 2 | Add new row with validity dates | Full history tracking needed |
| Type 3 | Add previous-value column | Only need current and one prior value |
| Type 6 | Hybrid (1+2+3) | Need both current and historical in same row |
SCD Type 2 Implementation
-- Merge pattern for SCD Type 2
MERGE INTO dim_customers target
USING staging_customers source
ON target.customer_id = source.customer_id AND target._is_current = TRUE
-- Existing record with changes: close the old version
WHEN MATCHED AND (
target.segment <> source.segment
OR target.region <> source.region
OR target.is_active <> source.is_active
) THEN UPDATE SET
_valid_to = CURRENT_TIMESTAMP(),
_is_current = FALSE
-- No changes: do nothing (handled by not matching)
-- New record or changed record: insert new version
WHEN NOT MATCHED THEN INSERT (
customer_key, customer_id, customer_name, segment, region, is_active,
_valid_from, _valid_to, _is_current
) VALUES (
seq_customer_key.NEXTVAL, source.customer_id, source.customer_name,
source.segment, source.region, source.is_active,
CURRENT_TIMESTAMP(), '9999-12-31', TRUE
);
-- Also insert new versions for changed records (requires a second pass or CTE)Querying SCD Type 2
-- Current state (most common)
SELECT * FROM dim_customers WHERE _is_current = TRUE;
-- State as of a specific date
SELECT * FROM dim_customers
WHERE '2024-06-15' BETWEEN _valid_from AND _valid_to;
-- Join fact to dimension for point-in-time accuracy
SELECT f.*, d.segment, d.region
FROM fct_orders f
JOIN dim_customers d
ON f.customer_key = d.customer_key
AND f.order_date BETWEEN d._valid_from AND d._valid_to;Step 6: Define Relationships and Constraints
Document the entity-relationship model:
fct_orders
|-- customer_key -> dim_customers.customer_key
|-- product_key -> dim_products.product_key
|-- date_key -> dim_date.date_key
|-- channel_key -> dim_channels.channel_key
dim_products
|-- category_key -> dim_categories.category_key (snowflake extension)
dim_customers
|-- geography_key -> dim_geography.geography_key (snowflake extension)Cardinality:
dim_customers 1---* fct_orders (one customer, many orders)
dim_products 1---* fct_orders (one product, many orders)
dim_date 1---* fct_orders (one date, many orders)Step 7: Normalization Decisions
| Normal Form | Rule | Analytics Implication |
| 1NF | No repeating groups, atomic values | Always apply |
| 2NF | No partial key dependencies | Apply in staging |
| 3NF | No transitive dependencies | Apply in OLTP, relax in OLAP |
| Denormalized | Redundant data for query speed | Appropriate for marts and fact tables |
When to denormalize:
- Dashboard performance requires it (eliminate joins)
- BI tool cannot handle complex joins
- The dimension is small and rarely changes
- Query simplicity is more valuable than storage savings
When to keep normalized:
- Data changes frequently (avoid update anomalies)
- Storage costs matter (very large dimensions)
- Multiple fact tables reference the same dimension
Step 8: Document the Model
Create documentation that includes:
## Data Model: [Business Process]
### Overview
[1-2 paragraph description of what this model covers]
### Grain
[What one row represents in each fact table]
### Facts
| Table | Grain | Key Measures | Update Frequency |
|-------|-------|-------------|-----------------|
| fct_orders | One row per order line | revenue, quantity | Daily incremental |
### Dimensions
| Table | SCD Type | Key Attributes | Cardinality |
|-------|----------|----------------|-------------|
| dim_customers | Type 2 | segment, region | ~500K |
### Relationships
[ER diagram or relationship list]
### Known Limitations
[What this model cannot answer]Output Format
Deliver a data model design with:
- Entity-relationship diagram (text-based or visual)
- DDL statements for all tables
- Grain documentation for each fact table
- SCD strategy for each dimension
- Sample queries showing how the model answers business questions
- Naming conventions used
Examples
Example 1: E-commerce Star Schema
Fact table for orders with dimensions for customers, products, dates, channels. SCD Type 2 on customers for segment tracking. Conformed date dimension shared across all facts.
Example 2: SaaS Product Analytics
Fact tables for events (transaction grain) and daily active users (periodic snapshot). Dimensions for users, features, plans. Wide event fact with JSON properties column.
Example 3: Financial Reporting
Fact table for journal entries with dimensions for accounts (chart of accounts hierarchy), cost centers, and periods. Supports drill-down from P&L line items to individual transactions.
Best Practices
- Define the grain first. Everything else follows from a clear grain definition.
- Use surrogate keys. Integer surrogate keys perform better than natural keys for joins and enable SCD Type 2.
- Conformed dimensions. Use the same customer dimension across all fact tables. Do not create per-fact copies.
- Prefer star over snowflake. The join reduction of star schemas outweighs the storage savings of snowflake schemas in most cases.
- Model for the questions. Design the model to answer known business questions. Do not model everything just because it exists.
- Track history where it matters. Use SCD Type 2 for attributes that affect analysis (segment, region) and Type 1 for attributes that do not (display name corrections).
- Name consistently. Use
fct_prefix for facts,dim_prefix for dimensions. Use snake_case. Be descriptive. - Avoid nulls in dimension keys. Use a "Unknown" or "Not Applicable" row in dimensions instead of null foreign keys.
- Add metadata columns. Include
_loaded_at,_updated_at, and_sourceon every table. - Start simple, iterate. Build the minimum model that answers the priority questions. Add complexity only when justified by new requirements.
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.

