building-a-dashboard
Xây dựng một dashboard mới, hoặc cập nhật một dashboard hiện có, từ một tập hợp các insights — cùng công việc mà trợ lý trong ứng dụng thực hiện với công cụ upsert-dashboard của nó, nhưng qua MCP.…
npx skills add https://github.com/posthog/ai-plugin --skill building-a-dashboardBuilding a dashboard
A dashboard is a collection of insight tiles on one page. Your job is to figure out which insights belong on it, reuse what already exists, create what's missing, and lay them out sensibly — not to blindly generate charts.
Create vs update
First work out whether you're creating a new dashboard or changing an existing one.
- Search existing dashboards with
dashboards-get-all(itssearchparam does fuzzy name/description matching). If the user is clearly describing something that already exists, they probably want an update. - Read a candidate with
dashboard-getto see its current tiles before you change anything. - If the request is ambiguous — "get my financial metrics together" could mean build new or add to an existing one — ask a short clarifying question rather than guessing.
Use templates as reference
PostHog ships vetted dashboard templates for common topics, and orgs can share their own. Consult them before you build — they're a strong signal of which insights pair well on a topic.
dashboard-templates-list— browse templates (usesearchfor a topic,scopeto narrow to global / team / organization). This returns names, descriptions, and tags only.dashboard-templates-retrieve— open the closest template to see itstiles: which insights it groups together and how each is queried.
Treat templates as examples, not a spec. Take inspiration from the insights and their groupings, but tailor every insight to the user's own events, properties, and intent. Don't copy a template verbatim, and don't force a template onto a request it doesn't fit — a good bespoke dashboard beats a mismatched template every time.
Select the insights
Prefer reusing existing insights over recreating them.
- Search with
insights-listand read promising ones withinsight-getto check they match the user's intent and actually have data. Full-text search misses things named differently, so list broadly before concluding an insight doesn't exist. - For anything missing, create it with
insight-create(see the product-analytics insight skills for query shape). - Keep the set minimal — only the insights the request needs. A focused dashboard is more useful than an exhaustive one.
Assemble the dashboard
- New dashboard:
dashboard-createwith a short (3–7 word) name and a concise description, then add the insight tiles. - Existing dashboard:
dashboard-update. Adding, replacing, or removing insights means sending the full intended set of tiles — insights you omit are removed, so include the ones you want to keep. - Layout: by default preserve existing tile placement. Use
dashboard-updateto plan each tile independently on the 12-column grid. Tile widths can be any whole number from 1 to 12, subject to each tile's minimum size. Use wider tiles for primary charts and smaller tiles for supporting metrics. Mixed rows such as 8 plus 4 or 6 plus 6 can show that hierarchy. - Reflow: use
dashboard-reorder-tilesonly when the user explicitly asks to reorder tiles or make every tile the same size. Its layout modes give every tile a uniform box. For mixed widths or heights, usedashboard-update. - Tile sizes: send
tilesthroughdashboard-updatewith each tile'sidand a completelayouts.smbox.smis required whenever you sendlayouts, because a write replaces the tile's whole layout.smcontrols desktop placement, and the dashboard derives the mobile layout from thesmorder and heights, so set onlysm. The API stores onlyx,y,w, andh. It does not resolve overlaps, so plan the grid before you send it. - Verify with
dashboard-insights-runto confirm the tiles return data, then summarize what you built and invite the user to refine it.
When not to use this
- Saving a single insight — just create the insight; it doesn't need a dashboard.
- Adding non-insight widget tiles (text cards, widgets) — see the widget tools (
dashboard-widget-catalog-list,dashboard-widgets-batch-add) instead.
Related skills
managing-subscriptions— deliver the finished dashboard to email or Slack on a schedulecreating-ai-subscription— a recurring AI-written report, when prose beats a wall of charts