auditing-warehouse-view-health
Skill76 starsChanged 49 days agoMITView on GitHub
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`.
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 66
Call data-warehouse-data-health-issues-retrieve and keep the materialized_view entries.
- Distinctive: line 68
If there are no view issues, tell the user their materialized views are healthy and stop.
- Very specific: line 95
Start from PostHog's suggestions: if the warehouse-suggestions-* tools are available.
- Very specific: line 108
Call view-list. Materialized views cost storage and compute every run.
- Distinctive: line 112
Only run this extra check if the user explicitly asks for a broader audit.
- Very specific: line 121
The audit is read-only: Never call destructive tools (e.g.
- Distinctive: line 123
Empty = healthy: Don't pad an empty audit with hypothetical issues.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 |
warehouse-suggestions-list | PostHog's open deprecate / materialize / certify suggestions, if any |
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-healthdestination(batch export) → owned by the batch exports / data pipelines producttransformation(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:
## 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)
Start from PostHog's suggestions if the warehouse-suggestions-* tools are available. Call
warehouse-suggestions-list with status=proposed. PostHog computes these from read usage:
- A
deprecatesuggestion names a materialized view that nobody reads. Accepting it marks the view deprecated in the data catalog. The view keeps refreshing, so it still costs compute. To stop that cost, unmaterialize the view withview-unmaterialize, after the user confirms. - A
materializesuggestion names a view that is read often enough that materializing it saves compute. Accepting it turns on materialization with the proposed refresh mode and interval.
Present them before any hand audit. Follow the reviewing-warehouse-suggestions skill to explain, change, accept or
dismiss them.
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.
Other versions1 project uses a version of this.
Word for word · 1
- PostHog/ai-plugin★ 96100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository349 other files it gives its agents.
- adding-warehouse-person-propertiesSkill
- analyzing-ai-citationsSkill
- analyzing-expensive-usersSkill
- analyzing-experiment-session-replaysSkill
- analyzing-funnel-correlationSkill
- analyzing-offline-evaluationsSkill
- analyzing-task-runsSkill
- assessing-heatmapsSkill
- auditing-endpointsSkill
- auditing-experiments-flagsSkill
- auditing-warehouse-source-healthSkill
- authoring-data-quality-checksSkill
- authoring-error-tracking-alertsSkill
- authoring-log-alertsSkill
- authoring-scoutsSkill
- building-a-dashboardSkill
- building-canvasesSkill
- building-html-canvasesSkill
- building-loopsSkill
- building-react-quill-canvasesSkill
- building-workflowsSkill
- checking-deploy-timingSkill
- checking-member-accessSkill
- choosing-trend-or-slope-viewSkill
- cleaning-up-stale-feature-flagsSkill
- composing-grid-canvasesSkill
- configuring-experiment-analyticsSkill
- configuring-experiment-rolloutSkill
- consuming-endpoints-from-client-codeSkill
- context-layer-consolidationSkill
- context-layer-dreamingSkill
- context-layer-health-checkSkill
- copying-endpoints-across-projectsSkill
- copying-flags-across-projectsSkill
- creating-ai-subscriptionSkill
- creating-an-endpointSkill
- creating-box-plot-insightsSkill
- creating-experimentsSkill
- creating-online-evaluationsSkill
- creating-replay-vision-scannersSkill
- creating-surveysSkill
- debugging-experimentsSkill
- debugging-failed-data-quality-checksSkill
- debugging-surveysSkill
- designing-email-templatesSkill
- designing-replay-vision-scannersSkill
- diagnosing-ci-and-merge-bottlenecksSkill
- diagnosing-endpoint-performanceSkill
- diagnosing-experiment-healthSkill
- diagnosing-failed-warehouse-syncsSkill
- diagnosing-missing-recordingsSkill
- diagnosing-sdk-healthSkill
- diagnosing-stacktrace-symbolicationSkill
- downloading-batch-export-filesSkill
- exploring-ai-failuresSkill
- exploring-apm-tracesSkill
- exploring-autocapture-eventsSkill
- exploring-endpoint-execution-logsSkill
- exploring-live-trafficSkill
- exploring-llm-clustersSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

