# modeling-warehouse-foundations

modeling-warehouse-foundations sets core guidelines for building PostHog data models via native HogQL views or an external dbt setup.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 172 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-warehouse-foundations/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-warehouse-foundations

## What it does

This skill guides the design of reusable analytical models in PostHog. It structures the choice between two paths: native PostHog views managed through HogQL tools (`view-create` and `view-materialize`) or an external dbt repository organized into `staging` and `marts` layers with schema tests.

Inside the native stack, unaliased fields or `SELECT *` trigger immediate failures on `posthog:view-create`. The skill enforces explicit column aliasing, sets rules for choosing between person-level and group-level aggregation, and routes currency calculations through the built-in `convertCurrency()` function.

PostHog provides no internal dbt runner, so all dbt transformations must execute in an external CI pipeline or orchestrator.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

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

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

### Gemini CLI

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

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

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill modeling-warehouse-foundations -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-warehouse-foundations/SKILL.md

## When to use it
- choose between native HogQL views and an external dbt repository
- author valid `posthog:view-create` definitions with strict column aliases
- set up physical materialization and `sync_frequency` for heavy queries
- handle monetary metrics using the native `convertCurrency()` syntax

## Example prompts
- Help me author a materialized view in PostHog for monthly active accounts
- Show me how to organize an external dbt repository targeting PostHog data
- Write a HogQL view query with explicit column aliases and currency conversion

## 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
- [warehouse-init](https://affpapa.org/en/nevibecode/skills/warehouse-init.md) — skill · 865 installs
- [data-warehouse-experimentation](https://affpapa.org/en/nevibecode/skills/data-warehouse-experimentation.md) — skill · 283 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

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
