# Fluix Pulse Digest

**One-line purpose:** Turn any Fluix data source into a recurring, consistently-formatted written digest for a chosen time period — a scannable periodic update (what happened, what changed, what needs attention), not a visual dashboard. Reuses the discovery/schema/use-case logic from the Fluix Report Dashboard skill, but the output is always the same fixed template, run after run, regardless of what the data contains.

---

## When to trigger it

- "Give me a digest of [X]" / "weekly digest" / "daily digest" / "monthly digest"
- "Summarize what happened this week/month in [X]"
- "Recurring report/summary for [X]"
- Any request for a periodic written update on a Fluix report/dataset, as opposed to a one-off visual (that's the Fluix Report Dashboard skill instead)
- If a request is ambiguous between the two, a plain "summarize" or "what's new" leans digest; "show me" or "visualize" leans dashboard

## Inputs

Required:
- **Data source name or ID, and which family it belongs to** — same as the Dashboard skill: check both `tasks_list_reports` and `docs_list_datasets`/`docs_status_rows` rather than assuming Tasks by default.
- **Time period** — never guessed. If not stated in the request, ask directly using a quick-select prompt:
  - Last day
  - Last week
  - Last month
  - Custom (then ask for the specific start/end dates)
  If the request already states a period ("last week's digest for X"), skip asking and use that.

Optional, inferred from context or defaulted:
- **Comparison period** — defaults to the immediately preceding equivalent window (this week vs. last week, this month vs. last month) so the digest can report a real delta, not just a snapshot. If the user's chosen period is custom and doesn't cleanly imply a prior window (e.g. "March 3-11"), ask once, or state plainly that no comparison is available.
- **Dimensions and metrics** — derived the same way as the Dashboard skill (schema classification + use-case inference), but narrowed to what fits the fixed template below rather than an open-ended chart set.

## Workflow steps

1. **Find the data source and confirm which tool family it's in** — identical to Dashboard skill step 1.
2. **Get the time period** — if not already stated, ask via a quick-select prompt (Last day / Last week / Last month / Custom). Don't proceed to pulling data until this is resolved.
3. **Get the schema first, always** — same field classification as Dashboard skill step 2 (categorical, numeric, date/time, identifier, free text, signature/boolean). Specifically identify which date field anchors the period filter (inspection date, submission date, last-action timestamp, due date) — if more than one date field exists, pick the one that represents when the record's core event happened, not administrative metadata.
4. **Identify the use case** — same reasoning as Dashboard skill step 4 (asset inspection, work order, incident report, survey/handover, document status). This determines which headline metric anchors the digest (condition rate, completion/turnaround, incident rate, compliance rate, status distribution).
5. **Pull rows for the current period, and for the comparison period** — filter both windows using the anchor date field identified in step 3. If the source can't be filtered by date server-side, pull enough rows to cover both windows and filter client-side. If a comparison window has zero data, say so explicitly rather than omitting the comparison.
6. **Aggregate for both windows**:
   - Volume (count of records in the current period, and the delta vs. the comparison period)
   - The headline metric identified in step 4, for both periods (e.g. poor-condition rate, completion rate, incident rate)
   - Top 2-3 recurring issues/categories in the current period, ranked
   - Anything that changed meaningfully between periods — a rate moving, a new category appearing, a previously common issue disappearing
   - Anything flagged per the Dashboard skill's pattern rules (concentration, outliers, 100%-of-small-group, correlation) but scoped to the current period only
7. **Render the digest in the fixed template below**, as response text — never as a Visualizer widget or chart. The template's section order and headers stay identical every run, even when a section has nothing notable to report (write "No incidents this period" rather than dropping the section) — consistency across runs is the point of a digest.

## Output format

Two parts, in this order:

1. **A compact metric-card strip**, rendered via the Visualizer (metric-card pattern only — no bar/line/doughnut charts). Validated format, follow exactly:
   - A responsive grid (`repeat(auto-fit, minmax(150px, 1fr))`), typically 3-5 cards.
   - Each card: a 13px muted label, a 24px/500 current-period number below it, and a 12px delta line below that.
   - The delta line always includes a direction arrow (↑ or ↓) and the comparison ("↑ from 25% in May"), or the literal text "no change vs. [prior period label]" when flat.
   - Color the number and delta line only when the direction is unambiguously good or bad for that metric — rising failure/incident/overdue rates in the danger/warning color, rising completion/pass rates in a neutral or success color. A metric with no inherent good/bad direction (e.g. plain volume) stays in default text color even if it changed.
   - One card each for: Volume, the use-case headline metric, and 2-3 of the most important "top issue" rates. This is intentionally NOT the Dashboard skill's chart set — no distributions, no rankings, no trend lines, just headline numbers at a glance.
2. **The fixed text template**, exactly as before, as normal response text below the card strip:

```
[Report name] — Digest for [period, e.g. "Jul 21-27, 2026"]

Top issues this period:
- [issue/category 1] — [count/rate]
- [issue/category 2] — [count/rate]
- [issue/category 3] — [count/rate]

What changed vs. [prior period label]:
- [notable delta 1]
- [notable delta 2]
(or: "No material change from the prior period.")

Needs attention:
- [flagged item/pattern 1]
- [flagged item/pattern 2]
(or: "Nothing flagged this period.")

Data confidence: [sample size note, and any data-quality caveat — demo data, missing fields, template inconsistencies]
```

Volume and the headline metric move into the card strip and are no longer repeated as their own text lines — the cards are the scan-friendly version of exactly those two numbers, not an addition to them. Everything else (top issues, what changed, needs attention, confidence) stays as text, since ranked lists and caveats read better as text than as cards.

## Guardrails

- Don't call the Visualizer for anything beyond the metric-card strip — no bar charts, line charts, doughnuts, or the Dashboard skill's chart set. If the user wants distributions, rankings, or trend lines alongside the digest, that's a signal to also run the Fluix Report Dashboard skill, not to bend this one into a hybrid.
- Keep the card strip to the headline numbers only (Volume, the use-case headline metric, 2-3 top-issue rates) — it's a compact scan aid, not a second dashboard. If more than ~5 cards would be needed to cover "every important number," that's a sign some of them belong in the text sections instead.
- Keep the card visual spec identical across runs (label / number / arrow+delta line, color only when direction is unambiguous) — this is a recurring format, so the card style itself shouldn't vary any more than the text template does.
- Don't skip the time-period question just because a period seems implied — "give me the digest" alone still needs a period selection, since assuming wrong wastes a full data pull.
- Don't drop a template section because it has nothing to report — write the "nothing to report" variant so the digest's shape stays identical run to run. A digest that changes structure based on content stops being scannable as a routine.
- Don't fabricate a comparison period when there's no data for it — say so plainly ("no prior-period data available for comparison") rather than reporting a delta against zero or guessing.
- Don't let the headline metric drift between runs of the same report — once step 4 identifies the use-case-appropriate headline metric for a given report, keep using that same metric on every subsequent digest for that report, so trend-watching over time stays meaningful.
- Same data-quality stance as the Dashboard skill: flag demo/sample data, template inconsistencies, or missing fields rather than treating them as real signal.
- Don't over-read small periods — if the current window has very few records, say so in the confidence line rather than stating a rate with false precision.
- Keep it short. A digest is meant to be read in under a minute — 3-6 bullets per section maximum, no paragraphs.
