# Daily Brief Compilation

Compile a scheduled morning brief that pulls together the calendar, open tasks, and news on tracked accounts, then delivers it to the exec channel on a recurring cadence.

## When to use

- A recurring morning digest is needed before the workday starts (calendar + tasks + news).
- Leadership wants a single consolidated view instead of checking three separate systems.
- An executive is tracking specific accounts or companies and needs fresh news surfaced daily.
- A one-off "give me today's brief now" request comes in outside the normal schedule.

## Tools

- `http-get`
- `browser-extract`
- `list-tasks`
- `send-message`
- `schedule-task`

## Playbook

1. On the scheduled trigger (set up once via `schedule-task`, e.g. daily at 07:00 in the exec's timezone), start assembling the brief.
2. Pull today's calendar via `http-get` against the calendar provider's REST API, e.g. `GET https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=...&timeMax=...`. Auth is injected by the org's Integration row for this host — never ask for, echo, or hardcode credentials. On 401/403 or missing Integration, stop and message a human via `send-message` naming the service and scopes.
3. Pull open and overdue items assigned to the executive with `list-tasks`, filtering to the relevant board or owner.
4. For each tracked account or company on the watchlist, use `browser-extract` to pull recent news from the account's press page or a news search results page (e.g. a Google News query URL for the company name).
5. If any news source requires a paid or authenticated API instead of open browsing, use `http-get` against that provider's endpoint (e.g. `GET https://api.newsprovider.example.com/v1/search?q=<company>`) under the same Integration-auth rule as step 2.
6. Compile the three sections — Calendar, Open Tasks, Account News — into one plain-text brief, trimming to the top items so it stays skimmable in under a minute.
7. Deliver the compiled brief to the exec channel using `send-message`.
8. If any source is unreachable or an Integration is missing, note the gap plainly in the brief (do not silently omit) and separately alert a human via `send-message`.
9. Confirm the recurring schedule stays healthy; if the executive changes their preferred time or channel, update the cadence with `schedule-task`.

## Failure modes

- Calendar or task API returns 401/403 or an Integration row is missing for the host — stop pulling that section, alert a human via `send-message`, and still deliver the remaining sections rather than failing the whole brief.
- News extraction returns stale, empty, or paywalled content — flag the account as "no fresh news found" instead of fabricating a summary.
- The brief is delivered to the wrong channel or at the wrong time due to a stale `schedule-task` config — verify the schedule after any change to the exec's calendar or working hours.
- Task or event volume is too high to summarize cleanly — cap each section to the top few items by priority/urgency and note that more exist, rather than dumping a wall of text.

## Done when

- The compiled brief (calendar, open tasks, tracked-account news) has been posted to the exec channel via `send-message`.
- Any missing Integration, failed source, or stale data is called out in the brief or escalated to a human, not silently dropped.
- The recurring `schedule-task` is confirmed active for the next scheduled run.