---
name: daily-briefing
description: Generates an interactive HTML daily briefing combining calendar events AND inbox email digest. Use this skill whenever the user asks for their daily briefing, tomorrow's schedule, what's on tomorrow, or wants their day built as an HTML file. Also triggers for phrases like "daily briefing please", "build my schedule for tomorrow", "what have I got tomorrow", "generate my briefing", "check my emails and calendar", "morning digest", "what's on my plate", or when a specific day is mentioned alongside a schedule request (e.g. "Wednesday's schedule", "give me Friday"). Always fetches BOTH calendar events (Google Calendar MCP) AND inbox emails (Gmail MCP) before building the report. Produces a fully branded, interactive single-file HTML schedule with a Day Prep insights section, Email Digest section, and a clickable hour-by-hour timeline. Use this skill proactively whenever the user asks about their day, week, schedule, inbox, or upcoming plans — even if they don't use the exact words "daily briefing".
---

# Daily Briefing Skill

Generates an interactive HTML schedule with AI-powered day prep insights and inbox digest.

---

## Customise before use

Edit these values in your own copy of the skill:

- **User name** — the person this briefing is for
- **Home timezone** — e.g. `Asia/Bangkok` (GMT+7), `America/New_York` (GMT-5)
- **Morning routine** — the block you always want labelled (e.g. "6–10 AM gym + deep work")
- **Recurring flags** — any weekly items to always flag (e.g. "Monday payroll run")
- **Key email senders to watch** — addresses / domains that should always be surfaced
- **Pitch reminder content** — if you want a pitch-prep card for client calls, define the framework name, pricing tier, and positioning line

---

## Workflow

### Step 1 — Fetch calendar via Google Calendar MCP

**Always use the Google Calendar MCP `list_events` tool** to fetch events.

Determine the target date:
- If the user says "tomorrow" → use tomorrow's date in the user's timezone
- If the user names a specific day (e.g. "Wednesday", "Friday", "25 Feb") → use that date
- Default to tomorrow if ambiguous
- For scheduled/automated runs → use tomorrow's date

Call `list_events` with:
- `calendarId`: `primary`
- `timeMin`: target date at `00:00:00` (start of day, user's timezone)
- `timeMax`: target date at `23:59:59` (end of day, user's timezone)
- `timeZone`: user's timezone
- `condenseEventDetails`: `false` (get full attendee + description data)

For each event extract:
- Title, start time, end time, duration
- Attendees and their organisations
- Zoom/video link — dig inside the event `description` field to extract the URL, meeting ID, and passcode
- Google Meet links from `hangoutLink` or `conferenceData` fields
- Location (physical address or virtual)
- Category: client call, personal call, travel, internal block, admin task, or recurring routine

**⚠️ Fallback — if Google Calendar MCP is unavailable:** Tell the user explicitly:
> "Google Calendar MCP isn't reachable right now. Could you share the schedule? A screenshot, paste, or quick description works perfectly."

---

### Step 2 — Fetch inbox emails via Gmail MCP

**Always use the Gmail MCP `gmail_search_messages` tool** to fetch recent emails. Run both searches:

1. `in:inbox after:<yesterday's date YYYY/M/D>` — recent inbox, maxResults: 20
2. `is:unread after:<yesterday's date YYYY/M/D>` — catch any unread from shared inboxes, maxResults: 10

For each email extract: subject, sender, snippet, to address, timestamp, label/category.

Then categorise into these buckets:

- **🚨 Action Required** — urgent: failed payments, account suspensions, time-sensitive requests, decisions needed, direct questions
- **💼 Business / Sales** — prospect replies, proposal updates, partnership inquiries, client feedback, meeting confirmations
- **📈 Investing / Finance** — deal flow digests, investment platform notices, tax docs, banking alerts
- **🔕 Noise** — newsletters, LinkedIn/social notifications, promotions, receipts, verification codes

Categorisation rules:
- Emails to team inboxes (operations@, projects@, etc.) are noise unless they indicate an account problem
- Payment provider / billing failures are always Action Required
- Prospect replies CC'd to the user are always Business signals even if addressed to other team members
- Investment platform digests → Investing
- When in doubt: if it relates to the user's primary business → Business

**⚠️ Fallback:** If Gmail MCP is unavailable, skip the email section and note it in the HTML.

---

### Step 3 — Prepare Day Prep insights

Analyse the day and prepare content for these prep cards:

1. **Top Priority** — The single most important thing to nail today
2. **Travel / Logistics** — Flights, transfers, location changes? Home base or travelling?
3. **Client Call Prep** — For each prospect/client call: 2–3 bullets on angle, pain points, and how to connect to the user's core sales framework
4. **Don't Forget** — Admin tasks, transfers, easy-to-miss items. Flag missing video links. Flag any Action Required emails needing same-day attention.
5. **Energy & Mindset** — Given workload/travel context, how should the user manage their energy today?
6. **Pitch Reminder** *(client calls only)* — Accent card: the user's core framework, pricing anchor, positioning line

**Adaptive rules:**
- Travelling → make Travel/Logistics first and most prominent
- No client calls → skip Pitch Reminder and Client Call Prep
- Light day (< 3 events) → 2–3 cards max
- Recurring weekly flags → always surface in Don't Forget
- Missing video link on any event → flag in Don't Forget
- Action Required emails → mention the most urgent one in Don't Forget

---

### Step 4 — Build the interactive HTML file

Single self-contained HTML file. No external JS libraries. Pure HTML, CSS, vanilla JS only. Load the font from Google Fonts via `<link>`.

#### Brand colours (replace with your own)

| Token | Value |
|---|---|
| Font | Mulish (all weights) |
| Yellow | `#f3af00` |
| Blue | `#207796` |
| Light Blue | `#dff3fa` |
| Charcoal | `#201600` |
| Background | `#ffffff` |

Tints and transparencies permitted. No other colours.

#### Page structure (in this order)

1. **Sticky top banner** — brand mark + animated yellow dot + date + day-type pill
2. **Hero section** — Large date heading (yellow accent), subtitle (location · call count · action email count · key context). Charcoal gradient background.
3. **Stats bar** — 4 tiles: Calls Today · Prospects · Action Emails · Protected AM Hours
4. **Day Prep section** — Grid of prep cards (Step 3)
5. **Email Digest section** — Categorised email cards (see below)
6. **Hour-by-hour Timeline** — Vertical timeline with event cards
7. **Footer** — Brand name + summary pills

#### Email Digest section

One card per non-empty email category. Each card:
- Category icon + label header with accent colour border (red for Action Required, blue for Business, teal for Investing, grey for Noise)
- Emails listed as collapsible rows: subject + sender + one-line snippet
- Noise category: collapsed by default, shown as count badge ("4 notifications — click to expand")
- Skip any categories with zero emails

#### Timeline event cards

Each card must include:
- Title + duration chip (colour-coded by category)
- Short context description + attendee tags
- **Click to expand** → Zoom/Meet join button (with ID + passcode), prep note

#### Event category colours

| Category | Colour |
|---|---|
| Blocked / routine | Grey `#b0a898` |
| Recovery / personal | Blue `#207796` |
| Admin / ops | Yellow `#f3af00` |
| Client calls | Blue with stronger glow |
| Personal 1-on-1 | Yellow |

#### Interactions

- Staggered fade-up on page load (CSS `animation-delay`)
- Cards lift on hover
- Expand/collapse on click (`max-height` CSS transition, no JS libraries)
- All links open `target="_blank"`
- Responsive: single column below 600px

---

### Step 5 — Save and present

Save to `/mnt/user-data/outputs/daily_briefing_YYYY-MM-DD.html` using the target date. Then use `present_files` to deliver to the user.

---

## Context to customise for your user

Before using this skill, fill in:

- **Base:** city and timezone
- **Business context:** what the user does, who they sell to
- **Core sales framework:** the user's go-to method and pricing anchor
- **Target client profile:** who a "client call" usually is
- **Morning routine block:** how early hours should be labelled
- **Recurring items:** weekly/monthly flags to always surface
- **Email MCP & Calendar MCP:** which tools are connected
- **Key senders:** emails and domains to always surface in Business / Action Required
