---
name: morning-briefing
description: >
  Generate a morning briefing for the day ahead. Summarizes overnight Slack
  activity, upcoming calendar events, pending tasks, and items needing
  attention. Use for daily meeting prep and situational awareness.
version: 2.0.0
author: wall-e
execution: script
entry: run.js
trigger:
  type: interval
  schedule: "daily at 7am"
tags: [briefing, morning, daily, summary, calendar, slack]
permissions:
  - brain:read
  - calendar:read
---
# Morning Briefing

## Your Goal

Generate a concise, actionable morning briefing for the owner. This should take less than 2 minutes to read and highlight what needs attention TODAY.

## Steps

### 1. Check Calendar
Use the `calendar_events` tool to get today's meetings and events. Note:
- Meeting times and attendees
- Back-to-back meetings that need prep
- Any all-day events or deadlines

### 2. Scan Overnight Slack Activity (USE BRAIN, NOT LIVE SLACK)
**IMPORTANT**: All Slack data is already synced into WALL-E's brain. Use `search_memories`
with `source: "slack"` — do NOT use `slack_search` or any live Slack API calls. The brain
has 20,000+ Slack messages already indexed and searchable via FTS5.

Run these searches IN PARALLEL (all in one turn):
- `search_memories({query: "<owner name> mention", source: "slack", limit: 20})` — recent mentions
- `search_memories({query: "<key project or topic>", source: "slack", limit: 15})` — active threads
- `search_memories({source: "slack", limit: 30})` — latest messages across all channels

Look for:
- Direct mentions or questions directed at the owner
- Active threads that need responses
- Decisions made overnight that the owner should know about
- Anything time-sensitive or blocking

### 3. Check Pending Tasks
Use `list_tasks` to see what's pending or overdue.

### 4. Review Pending Questions
Check if there are any pending questions from WALL-E that need the owner's input.

## Output Format

Structure the briefing as:

### Today's Schedule
- List meetings chronologically with times and key attendees

### Overnight Activity
- Summarize key Slack messages and threads needing attention
- Highlight any urgent or time-sensitive items

### Action Items
A table of SPECIFIC, CONCRETE things the owner needs to do. Each item must have:
- A clear next action (not just a topic — what exactly should they do?)
- Who they need to talk to or respond to
- A real deadline or reason for urgency

| Action | Who | By When | Why |
|--------|-----|---------|-----|
| Reply to Alice's question about API migration in #eng-platform | Alice | Today | She's blocked waiting for your input |
| Review PR #456 (database schema change) | Bob | Today | Merge deadline is EOD |
| Prep talking points for 1:1 with VP at 2pm | Sarah | Before 2pm | Weekly sync, she raised perf concerns last week |

**Rules for action items:**
- NO vague items like "Follow up on project X" or "Monitor situation Y"
- NO items that are just FYI — those go in Overnight Activity
- Every item must answer: "What exactly should I DO, and WHY now?"
- If there's nothing actionable, say "No action items — clean slate today"
- Max 5 items. If more exist, prioritize ruthlessly.

### Quick Stats
- Pending tasks count
- Any system alerts (e.g., Slack auth expiry, skill failures)

## Structured Items Block (REQUIRED)

After the markdown briefing, you MUST include a structured JSON block with all
action items. This enables the UI to render interactive action buttons. Use this exact format:

```
<!-- BRIEFING_ITEMS
[
  {
    "title": "Reply to Alice re: API migration — she's blocked",
    "action": "Reply in #eng-platform thread or DM Alice",
    "category": "comms|review|meeting-prep|decision|deliverable|other",
    "who": "Alice Chen",
    "urgency": "critical|today|this_week",
    "why": "She's blocked on the schema decision and asked you directly yesterday",
    "context": {
      "search_queries": ["Alice API migration schema"],
      "people": ["Alice Chen"],
      "channels": ["eng-platform"]
    }
  }
]
-->
```

**Rules for BRIEFING_ITEMS:**
- `title` must be a specific action, not a topic. "Reply to X" not "API migration"
- `action` is what exactly to do (reply, review, prep, decide)
- `why` explains urgency — why today and not tomorrow?
- `who` is the specific person involved
- Do NOT include async/FYI items — only things requiring action
- Max 5 items

Urgency levels:
- `critical` = must act right now, someone is blocked
- `today` = must handle today, has a deadline or meeting
- `this_week` = due this week but not today

## Tone

Write like a sharp executive assistant briefing their boss. Be direct,
prioritize ruthlessly, and flag anything that looks urgent or time-sensitive.
Skip the pleasantries -- get straight to what matters.
