# modeling-dimension-tables

modeling-dimension-tables builds star-schema dimension tables in PostHog HogQL views or dbt projects so you avoid repetitive joins across your metrics.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 174 installs · ★ 101 repo stars
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/modeling-dimension-tables/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/modeling-dimension-tables

## What it does

This skill guides the design of reusable lookup tables such as countries, plans, dates, and regions. The workflow follows three steps: sourcing records from seeds, syncs, or tracked events; structuring an aliased view with strictly one row per entity; and linking it to fact tables or persons via saved joins.

A key requirement in PostHog is relying on the built-in `convertCurrency()` function instead of generating manual FX rate tables. When pulling dimension values out of HogQL event streams, missing properties must be filtered with `isNotNull(...)` because empty checks alone leave blank keys that corrupt subsequent joins.

Static lookup views are set to slow materialization intervals like 7 or 30 days. You should review `modeling-warehouse-foundations` before running this, as downstream models for revenue, conversions, and usage rely directly on these dimensions.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-dimension-tables -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/modeling-dimension-tables/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/modeling-dimension-tables/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-dimension-tables -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/modeling-dimension-tables/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-dimension-tables -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/modeling-dimension-tables/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/modeling-dimension-tables
```

2. **Manually: put the files in place**
- File: `.github/skills/modeling-dimension-tables/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-dimension-tables -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/modeling-dimension-tables
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/modeling-dimension-tables/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-dimension-tables -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/modeling-dimension-tables/SKILL.md

## When to use it
- build reusable star-schema dimension models in PostHog or dbt
- extract entity lookups from event streams without null key leakage
- link descriptive attributes to facts via saved or person joins
- prevent query fan-outs caused by duplicate dimension primary keys

## Example prompts
- Create a `dim_country` view in PostHog derived from event properties with deduplication
- Generate a dbt dimension model for subscription plans with unique and not-null tests
- Show how to connect a region lookup to the persons table using a saved join

## Similar
- [querying-posthog-data](https://affpapa.org/en/nevibecode/skills/querying-posthog-data.md) — skill · 890 installs
- [signals-scout-replay-vision](https://affpapa.org/en/nevibecode/skills/signals-scout-replay-vision.md) — skill · 316 installs
- [dbt-projects-on-snowflake](https://affpapa.org/en/nevibecode/skills/dbt-projects-on-snowflake.md) — skill · 1 install
- [seo-posthog](https://affpapa.org/en/nevibecode/skills/seo-posthog.md) — skill · 141 installs
- [posthog-webhooks-events](https://affpapa.org/en/nevibecode/skills/posthog-webhooks-events.md) — skill · 1 install
- [posthog](https://affpapa.org/en/nevibecode/skills/posthog.md) — skill · ★ 8052 repo stars

From the same set: [posthog/ai-plugin](https://affpapa.org/en/nevibecode/by/posthog/ai-plugin.md) — 82 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
