manage-dashboard-widgets

Guides shipping and updating PostHog dashboard widget types across backend and frontend registries.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill manage-dashboard-widgets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: manage-dashboard-widgets
Source: https://github.com/PostHog/posthog-foss/tree/main/.agents/skills/manage-dashboard-widgets
Command: npx skills add https://github.com/PostHog/posthog-foss --skill manage-dashboard-widgets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog engineers adding or modifying dashboard widget tiles must coordinate many files across backend registries, Pydantic config contracts, OpenAPI codegen, frontend catalogs, and Storybook, and missing any step breaks CI or ships an incomplete widget.

Core Features & Use Cases

  • Ship a new widget_type: Mandatory intake flow, then an ordered checklist covering WIDGET_SPECS registry, Pydantic config models, run_widgets permissions, frontend catalog, registry, edit modal, and tests.
  • Update a shipped type: Routing tables for config, query, layout, RBAC, tile filter bar, and throttle changes without re-running new-type intake.
  • Platform invariants enforcement: Rules for registry-driven RBAC, WidgetCard compound composition, Pydantic config SSOT with hogli build:openapi codegen, and the no-chart-widgets policy.
  • Use Case: An engineer asked to add an error tracking trends widget runs the intake spec confirmation, follows checklist sections 1 through 8, runs hogli build:openapi, and verifies with the schema parity and registry tests before opening the PR.

Quick Start

Ask the assistant to help you ship a new PostHog dashboard widget type or update an existing one, and it will route you through intake or the update checklist.

Frequently Asked Questions about manage-dashboard-widgets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new widget type to a PostHog dashboard?

Run the mandatory widget intake first to lock the spec, then follow the new-type checklist: add a Pydantic config model in widget_specs/configs.py, a run_* function, a WidgetSpec registry entry, frontend catalog and registry entries, an edit modal, and tests. Finish with hogli build:openapi and dedicated Storybook stories.

How do I update an existing PostHog dashboard widget config?

Skip intake and identify the type from EXPECTED_WIDGET_TYPES in widget_registry.py, then use the routing table in managing-existing-widgets.md to find the primary files for config, query, layout, or RBAC changes. Run the schema parity tests and hogli build:openapi if the config contract changed.

Can I ship a chart or trend visualization as a dashboard widget?

No. Chart-primary bodies such as trends, funnels, and time series belong on insight tiles, not widget types. Widgets are for product-native list, table, or card content like error_tracking_list and session_replay_list.

Does adding a new widget_type require a database migration?

No. New widget_type strings need no migration because the column is a plain string validated in the registry and serializer. You only register the type in the backend and frontend registries plus both catalogs.

Why does hogli build:openapi fail after adding a widget type?

The schema build uses --fail-on-warn and drf-spectacular enum names collide for per-type widget_type ChoiceFields. Add an entry to ENUM_NAME_OVERRIDES in posthog/settings/web.py, diagnosed with python manage.py find_enum_collisions.

When should I not use this dashboard widget skill?

Do not use it to add an existing widget type to a dashboard, which is handled by MCP tools dashboard-widget-catalog-list and dashboard-widgets-batch-add. It also excludes insight tiles, text cards, and button tiles.