--- name: pd-intel-briefing description: Use when asked for a daily briefing, weekly summary, status update, "what happened", "how are we doing", or any period-in-review of PD Intelligence social media data. Produces an evidence-based intelligence briefing from dashboard stats, daily summaries, leaderboards, and comment activity. --- # PD Intelligence — Daily/Weekly Briefing This answers in chat. When the user wants an artifact someone else reads — a document, a deck, an interactive story — build the evidence here, then render it with `pd-intel-report`. Produce a briefing that a teammate can act on: what happened, what changed, what's unusual, with links. Adapt the format to the request — there is no mandatory template — but never pad with unverified claims. ## Prerequisites - Call `list_datasets` first; confirm which dataset the briefing covers (ask if ambiguous). Pass its integer `id` to every tool. - The `platforms` map from `get_totals` shows which platforms the dataset actually carries. The key is `x_twitter`, not `twitter`. - **Before comparing platforms or quoting an engagement rate:** where a platform does not publish a metric, PD Intelligence stores `0`, not null. Bluesky never publishes view counts (Threads only from September 2026); Instagram publishes them on Reels only and publishes no share or save counts; comment text is not collected for X/Twitter. Those zeros are platform facts, never a data gap — and never average post-level `engagement_rate`, which is forced to `0.0` on every no-view post. ## Workflow 1. **Frame the period.** Daily → `comparison_days: 1`; weekly → `7`; monthly → `30`. Use the same window everywhere for consistency. 2. **KPIs**: `get_totals` with that `comparison_days`. Its `deltas` (`{value, delta, delta_label}` per metric) are your "what changed" backbone — including the per-platform post counts under `platforms`. They always cover the last N days ending today, independent of `date_from`/`date_to`, and each `value` is the all-time total, not the period's count. For a period that ended before today, compare two windowed `get_totals` calls (the period and the one before it) instead. 3. **Narrative**: the stored daily brief is the `daily_summaries` table in `run_analytics_sql` — `SELECT summary_date, narrative_text, top_posts, top_creators, top_accounts FROM daily_summaries ORDER BY summary_date DESC LIMIT 1` for the latest (usually yesterday's), or every day of the period for a weekly briefing (it loads whole, so a `WHERE summary_date` filter is safe here). A brief may legitimately say there was no activity — report that honestly rather than inventing highlights. 4. **Top content**: `run_analytics_sql` over `posts` JOIN `post_metrics_latest` (`ON post_metrics_latest.post_id = posts.id`), `ORDER BY views DESC LIMIT 10`, with the period passed as the `date_from`/`date_to` **arguments**, not a `WHERE`. For depth, a second pass by engagement rate computed in SQL over posts with views — see the navigation skill's `references/analytics-sql.md`. Cite `post_url`, author, and metrics. 5. **Who's driving it**: `search_creators` (and `search_accounts` if useful) with `start_date`/`end_date` set to the period and `sort_by: "total_views"` — `get_leaderboard` has no date window, so its creator and account rankings are all-time, not the period's. The windowed numbers are each post's views as of the last daily snapshot on or before `end_date`, so a post from the last day or two counts little or nothing yet. When the period runs up to today, quote current views from step 4's SQL (`post_metrics_latest`, grouped by account or creator) and use the search tools for the ranking only. To say whether a named top creator is rising or falling, add `get_creator_overview`. Use `get_leaderboard` with `mode: "needs_attention"` for underperformers worth flagging on any entity type — it applies a 50-view floor and sorts engagement ascending, so it ranks only entities that reported views. 6. **Audience reaction**: `get_comment_summary` with `date_from`/`date_to`. The `timeline` reveals spikes — name the dates and find what caused them (its `top_posts` section, or `run_analytics_sql` on posts with that day as the `date_from`/`date_to` window). Remember its `platform_stats` shows which platforms have collected comment text — comment text is not collected for X/Twitter, so silence there means "not collected", not "no discussion". Its `capture` block says, per platform, what share of the platform's own comment count PD holds (comments are collected once, about three days after the post): quote it when a count here is compared with the number shown on the post. For what the conversation is newly about, `get_rising_terms` with the same window returns the terms rising and falling against the previous period. ## Analysis standards - **Compare, don't just list.** "1.2M views" means little; "+17.8% vs the prior week, driven by two viral X posts" is a briefing. - **Flag anomalies** with a hypothesis: a comment-timeline spike, a platform suddenly active, follower jumps. Check whether new accounts/creators were added to the dataset (`total_accounts` delta) before calling growth organic. - **Quantify with totals** — `count(*)` in SQL or a search tool's `total` field — not the rows you happened to fetch. For a number describing the whole period rather than a page — a share of a total, a median, a distribution — use `run_analytics_sql` and pass the window as `date_from`/`date_to` arguments, not as SQL. - **Don't report platform behavior as a data problem.** A zero view count on Threads or an Instagram photo means the platform doesn't publish that metric, not that the week was weak or the pipeline broke. Never average post-level `engagement_rate` — it is `0.0` on every no-view post, so the average penalizes creators for where they post. - **Say median as well as mean** when a couple of viral posts carry the week, and name them separately. - **Lead with the takeaway** (2-3 sentences), then sections: KPIs, top content, creators, audience reaction, anomalies/watch items. - **Write it the way you'd say it.** Put the finding and its number in the first sentence. No throat-clearing, no abstract scene-setting before the point, no "not just X, but Y" constructions — that register reads as machine-written and makes a briefing harder to skim. - Every claim about a specific post needs its `post_url`.