# Prompt — Recreate the Content Analytics dashboard

Copy everything below the line and paste it to an AI assistant that has the Ordinal MCP installed.

---

Build a single-file `index.html` that visualizes the **content performance for one Ordinal workspace across all of its connected social profiles**, over a multi-month window. Use the Ordinal MCP to pull every number — do not invent metrics. The visual style is dark, dense, mono-typed; reference `examples/dashboards/content-analytics/DESIGN.md` for the full token system (Geist + Geist Mono via jsDelivr, mint `#8ef5b5` accent, near-black `#09090B` bg, 6px radius, 1px-divider grid layout).

## Data to fetch from the Ordinal MCP

Resolve everything in this order. If a step depends on IDs from a prior step, do that step first.

1. **Workspace + profiles + labels.** Call `ordinal_get_workspace_context` with no `workspaceSlug` to list workspaces and pick the one the user names; then call it again with `workspaceSlug` to receive `schedulingProfiles[]` (id, channel, displayName, profileImageUrl, handle/vanity), `labels[]` (id + name), and `campaigns[]`.

2. **Per-profile post analytics.** For every scheduling profile, call `ordinal_get_analytics` with `type: "posts"`, `platform` matching the profile's channel (`LinkedIn` / `X` / `Instagram` / `Facebook`), the profile's `id` as `profileId`, and a `startDate` / `endDate` covering the reporting window (default the dashboard to a six-month window ending today). Aggregate per profile to compute total impressions, average engagement rate, and EMV.

3. **Company follower count (optional 4th profile card).** If the workspace has a LinkedIn company page, call `ordinal_get_analytics` again with `type: "followers"` for that profile to get the latest follower count plus delta vs. the start of the window.

4. **Content pipeline counts.** Call `ordinal_search_content` once per status the dashboard shows (`Posted`, `Scheduled`, `ForReview`, `InProgress`, plus `contentType: "idea"` for the Ideas bucket). Use `limit: 100` and follow `nextCursor` until exhausted, or just count the first page if you only need the total via the response shape your harness exposes.

5. **Label / campaign reach.** For each `labelId` from step 1, call `ordinal_search_content` with `labelIds: [id]` and the same date window, then sum impressions for the matched posts (joining against the analytics rows from step 2 by post URL or ID). Rank labels by total reach for the "Impressions by label" bar chart.

6. **Top posts table.** Take the top 10 rows from step 2 sorted by impressions and join each back to `ordinal_search_content` (`postId: ...`) if you need full copy/title for the table.

7. **Posting-time heatmap.** Bucket each post from step 2 by weekday × hour using its `publishAt`, weighting by engagement rate; render the 7×24 grid.

8. **Insights cards.** Synthesize 3–4 short, specific insights from the data above (e.g. "labels X and Y outperform by Nx", "LinkedIn share of impressions = N%"). Always quote the actual post titles and metrics — never fabricate.

## Layout (in order)

1. Header — workspace name + date range pill + "ordinal mcp" badge.
2. **Profiles** — one card per scheduling profile with avatar, handle, impressions, avg engagement, EMV. Add follower count + delta on the company-page card.
3. **Team Totals** — 5 KPI cards: Total Impressions, Total Posts, Best Engagement (cite the post), Total EMV, Top Post Reach (cite the post).
4. **Insights** — stacked list with colored tag column.
5. **Impressions** — line chart (one series per platform) + doughnut for platform split.
6. **Engagement & Pipeline** — grouped bar (likes / comments / shares / clicks per week) + horizontal bar of pipeline counts.
7. **Labels** — horizontal bars (`hsl(143, ...)` mint ramp from saturated to dim).
8. **Optimal Posting Times** — 7×24 heatmap.
9. **Top Posts** — table: post title, author, impressions, eng rate, likes, comments, EMV.
10. Footer — credit Ordinal MCP and list the tool names you actually used.

## Constraints

- Standalone `index.html`, Chart.js via CDN, no build step.
- Every metric must trace to a real MCP response. If a profile has zero analytics data, render the card with `—` rather than guessing.
- Format numbers as `1.2K` / `3.4M` and currency as `$1.2K`.
- Match the exact visual tokens, spacing, and component patterns in `DESIGN.md` (1px-divider grids, mono labels, mint highlight on top values).
