Agent Native

auditing-warehouse-view-health

Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.

by PostHogOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (PostHog)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
244c70dpinned Oct 9, 2026
Context cost
about 1,400 tokenswhen the skill loads
GitHub stars
40,191on posthog/posthog
Scripts
None found

What it does

“Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks "which of my views are broken?", "why is this materialized view failing?", "are any of my views wasting compute?", or wants a one-shot triage of view health. For source/sync health use `auditing-warehouse-source-health`.”
The author's description, from SKILL.md

Generated summary from the skill's own text

Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources. The skill retrieves active failures via the health endpoint, surfaces HogQL errors in view definitions, and optionally recommends cleanup candidates for views that are never queried.

When to use it

  • User asks which materialized views are broken or failing
  • Need to triage materialized view errors after schema or HogQL changes
  • Dashboards backed by materialized views are stale or erroring
  • Checking for unused materialized views that consume unnecessary storage and compute

When not to

  • Diagnosing source or sync pipeline failures, use source-health skill instead
  • Fixing batch export or transformation issues, route to those product teams
  • Editing or deleting views without explicit user confirmation

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add posthog/posthog --skill auditing-warehouse-view-health

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install posthog/posthog auditing-warehouse-view-health@244c70d066c0b441e3b8cc6875f914c5e09c42b3

Installs the commit we checked (244c70d).

Copy by hand

Download the folder at 244c70d and put it in .claude/skills/auditing-warehouse-view-health for Claude Code and in .agents/skills/auditing-warehouse-view-health for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 244c70d

Claude Code plugin

/plugin install posthog@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "auditing-warehouse-view-health" by PostHog.

Source, pinned to commit 244c70d066c0b441e3b8cc6875f914c5e09c42b3:
https://github.com/posthog/posthog/tree/244c70d066c0b441e3b8cc6875f914c5e09c42b3/products/data_warehouse/skills/auditing-warehouse-view-health

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/auditing-warehouse-view-health/ for Claude Code and .agents/skills/auditing-warehouse-view-health/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/posthog/auditing-warehouse-view-health-posthog

SKILL.md at the pin

---
name: auditing-warehouse-view-health
description: >
  Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and
  flag unused or stale materialized views that cost storage and compute. Use when the user asks "which of my views are
  broken?", "why is this materialized view failing?", "are any of my views wasting compute?", or wants a one-shot
  triage of view health. For source/sync health use `auditing-warehouse-source-health`.
---

# Auditing data warehouse view health

This skill produces a project-wide audit of **materialized views** (materialized saved queries) in the data warehouse
— which ones are failing, and which are materialized but unused. Use it when the user wants a summary of view health,
not a deep-dive on one failure.

The same underlying endpoint (`data-warehouse-data-health-issues-retrieve`) also reports source, sync, batch-export,
and transformation issues. Source and sync health is covered by `auditing-warehouse-source-health`. Destinations
(batch exports) and transformations are owned by other products — surface them if they appear, but route them to the
relevant team rather than diagnosing here.

## When to use this skill

- "Which of my views are broken?" / "Why is this materialized view failing?"
- "Are any of my materialized views wasting compute?"
- Reviewing view health after a HogQL or schema change
- Dashboards backed by materialized views are stale or erroring

## Available tools

| Tool                                         | Purpose                                                             |
| -------------------------------------------- | ------------------------------------------------------------------- |
| `data-warehouse-data-health-issues-retrieve` | One-shot: all failed/degraded items across the whole pipeline       |
| `view-list`                                  | All saved queries / materialized views with status and latest_error |
| `view-run-history`                           | Run history for a specific materialized view                        |

Filter the `data-health-issues` results to the `materialized_view` type for this audit. Use `view-list` when you need
more than the active-failure summary (non-failing views, materialization flags, last-queried info) and
`view-run-history` to see the run trail for a specific view.

## What counts as a view "issue"

From the data-health endpoint, this audit cares about one of the five categories:

| `type`              | Trigger                                                       | Typical urgency |
| ------------------- | ------------------------------------------------------------- | --------------- |
| `materialized_view` | `DataWarehouseSavedQuery.is_materialized=true, status=Failed` | Medium          |

Each entry includes `id`, `name`, `type`, `status`, `error`, `failed_at`, and `url`.

The other categories the endpoint returns are out of scope for this skill:

- `source` / `external_data_sync` → `auditing-warehouse-source-health`
- `destination` (batch export) → owned by the batch exports / data pipelines product
- `transformation` (HogFunction) → owned by the CDP / ingestion side

Note the data-health endpoint only reports _active failures_. For views it doesn't flag:

- Non-materialized views with errors (only materialized views are reported)
- Materialized views that are healthy but unused (costing compute every run) — see Step 4

## Workflow

### Step 1 — One-shot pull

Call `data-warehouse-data-health-issues-retrieve` and keep the `materialized_view` entries.

If there are no view issues, tell the user their materialized views are healthy and stop. Don't invent problems.

### Step 2 — Triage failures

Materialized view failures are usually independent of sources — a view failure is a HogQL or data issue in the view
itself (syntax error, missing table reference, type mismatch). For each failing view, surface the `error` and point
at the offending query. Use `view-run-history` if the user wants the failure trail.

An `error` that starts with `Not published:` is not a query problem. The view's data quality checks failed and the
refresh was held back. Hand off to `debugging-failed-data-quality-checks`.

### Step 3 — Present the audit

Render a prioritized report. Don't dump the raw JSON — human-readable:

```text
## Materialized view health — 2 issues

### 🟠 Materialized views (2)
- monthly_revenue — view failed (syntax error in HogQL: 'FORM' instead of 'FROM')
- active_users_30d — view failed (missing table reference)

Both are HogQL issues in the view definitions — independent of your sources. Want me to open one?
```

### Step 4 — Go beyond active failures (when asked)

**Unused materialized views:**
Call `view-list`. Materialized views cost storage and compute every run. If any are marked materialized but haven't
been queried lately, surface them as cleanup candidates (the data is available via `view-list`; unmaterialize via
`view-unmaterialize`).

Only run this extra check if the user explicitly asks for a broader audit.

### Step 5 — Offer the next step

End the audit with a clear hand-off — e.g. "Want me to open `monthly_revenue` and fix the HogQL?" Never apply fixes
autonomously from an audit; confirm explicitly before editing or unmaterializing a view.

## Important notes

- **The audit is read-only.** Never call destructive tools (e.g. `view-unmaterialize`, `view-delete`) from the audit
  flow without explicit confirmation.
- **Empty = healthy.** Don't pad an empty audit with hypothetical issues. "No view issues found" is a good answer.
- **View failures are usually self-contained.** Unlike source failures, a failed materialized view rarely cascades —
  it's a query problem in that view. Don't imply a broader outage.
- **Sources, syncs, destinations, and transformations are out of scope here.** They share the data-health endpoint
  but belong to other audits/products — route, don't diagnose.

From posthog/posthog at 244c70d, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 244c70d

Files

1 file, 6.0 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 244c70d

Also in

The same SKILL.md content appears in these places too. We list it once and credit the oldest public source.

All 50 skills from PostHog

More from PostHog

  • analyzing-experiment-session-replays

    This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.

    Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago

  • analyzing-offline-evaluations

    This skill inspects and compares offline AI evaluation experiments stored in PostHog, diagnoses case-level regressions, and tracks scorer changes across…

    Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 6 days ago

  • authoring-data-quality-checks

    This skill adds data quality checks (like dbt tests) on warehouse tables, views, and HogQL metrics, supporting assertions such as not-null, uniqueness…

    Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago

  • authoring-scouts

    This skill helps engineers write, edit, and adapt PostHog Signals scouts, scheduled agents that scan projects and report findings to an inbox.

    Claude Code, Codex, Cursor +4 · about 10.6K tokens · pinned 6 days ago

  • building-a-dashboard

    This skill constructs or modifies PostHog dashboards by selecting and arranging insight tiles.

    Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago

  • configuring-experiment-analytics

    Configures how PostHog measures experiment impact by setting exposure criteria (who counts in the analysis), choosing metrics to track (mean, funnel, ratio…

    Claude Code, Codex, Cursor +4 · about 3.4K tokens · pinned 6 days ago

  • configuring-experiment-rollout

    Configures variant split and overall rollout percentage for PostHog experiments, determining who sees which test variant and what percentage of users enter…

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.6K tokens · pinned 6 days ago

  • diagnosing-experiment-health

    This skill diagnoses problems with a PostHog experiment's setup, exposures, results, and changes during its run.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 5.6K tokens · pinned 6 days ago

  • modeling-dimension-tables

    This skill builds reusable lookup tables (dimensions) like country, plan, and date for star-schema analytics on PostHog or dbt.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago

  • modeling-product-usage-metrics

    This skill helps build reusable product engagement models, retention, stickiness, and lifecycle, using either PostHog HogQL or dbt.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago

  • modeling-revenue-metrics

    Build revenue models for MRR, ARR, gross revenue, churn, ARPU, and LTV on PostHog managed revenue views or dbt marts.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.8K tokens · pinned 6 days ago

  • querying-posthog-data

    This skill teaches the agent how to query PostHog data using typed runners for product analytics or SQL for complex analysis.

    by PostHogOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use