Skills Getting started Skills GitLab Hub

analytics-page

Use when adding or changing a SlopKit Analytics panel page — MDX under pages/, named SQL in queries/, charts from existing events, metrics, catalog, or queries. Do not invent event or metric names. Explore infer, catalog, and existing queries first.

Synopsis

The YAML description states when to use this skill. disable-model-invocation is unset.

Source file: skills/analytics-page/SKILL.md.

Front matter

name
analytics-page
description
Use when adding or changing a SlopKit Analytics panel page — MDX under pages/, named SQL in queries/, charts from existing events, metrics, catalog, or queries. Do not invent event or metric names. Explore infer, catalog, and existing queries first.
disable-model-invocation
unset

Full contents

---
name: analytics-page
description: Use when adding or changing a SlopKit Analytics panel page — MDX under pages/, named SQL in queries/, charts from existing events, metrics, catalog, or queries. Do not invent event or metric names. Explore infer, catalog, and existing queries first.
---

# Analytics page

Add a report in the panel repo. Invoke from the **product** repo (the app that already POSTs to a collector).

The panel tree is `PANEL_REPO_DIR`, or the product’s pages git: `pages/`, `queries/`, `catalog/`, `components/`. System pages (`/events`, `/metrics`, `/infer`, `/cache`) ship with the panel process. Product reports are `pages/**/*.mdx` and live under `/p`. Optional `pages/root.mdx` is `/`.

Vocabulary: collector, panel, instance, catalog, cache. Do not write tenant or namespace.

## Do not invent names

Do not create a new `track` name, metric name, or catalog file. If the name does not already exist, stop and use `analytics-instrument`.

Explore, then use what you found:

1. `catalog/events/*.struct` and `catalog/metrics/*.struct`. The filename stem is the name.
2. `queries/*.sql` and named SQL fences already in MDX.
3. Existing `pages/**/*.mdx`.
4. Infer, if a panel is running: `http://127.0.0.1:7411/infer` or `GET /api/infer`.

Authored SQL is `FROM events` or `FROM metrics`. The panel emits `USE <instance>.collector`.

## Page

- One question per page. Title names the question, not “Overview” or “Dashboard”.
- File: `pages/<slug>.mdx` (or a folder with `index.mdx`). Route is `/p/<slug>`.
- Front matter: `title`.
- Charts and tables use named queries. Follow existing MDX components (`Chart`, `DataTable`).
- Add `queries/<name>.sql` only when no existing query answers the question. Reuse `events_counts`, `events_daily`, `metrics_values`, and friends when they already fit.

## Do not clone the generic pages

`/events` and `/metrics` already list every name, daily volume, and a recent log. Do not add another all-events bar chart or all-metrics table.

A product page slices **one** existing name (or a join you can prove from existing columns): a property, a time window, an identity cut that the catalog actually has.

## Check

The new MDX and SQL are in the panel repo. Query names in the page exist as files. Every event or metric name on the page exists in catalog or infer.