---
name: communications-brief
description: Produces a RingEX Phone communications brief from recent calls, SMS, voicemail, contacts, presence, and message-store data, over a time window the user chooses (last 24 hours, last 3 days, last week, or a custom range). Use when the user asks for a communications digest or brief, a daily digest, morning briefing, catch-up report, missed communications, unresolved calls or texts, voicemail follow-up, or what to work on today. Always asks the user up front how far back to look rather than assuming a fixed window, and on a Monday 24-hour lookback, checks whether the weekend or a recent holiday should be folded in too.
---

<!-- --8<-- [start:body] -->
# Communications Brief

## Goal

Help the user prepare for the day (or catch up after time away) by reviewing personal RingEX
Phone communications over a window they choose, and turning them into a prioritized action report.

Focus on what needs attention, not on exhaustively listing every record.

## Trigger examples

- "Give me my communications brief."
- "Give me my daily communications digest."
- "What did I miss in RingEX?"
- "Summarize my calls, texts, and voicemails since yesterday morning."
- "What communications do I need to follow up on today?"
- "Show me unresolved calls, SMS, and voicemail from the past week."
- "Catch me up on my phone since last Monday."

## Workflow

1. **Ask how far back to look before pulling any data.** Don't assume a fixed window — the right
   lookback depends on when the user last checked in. Ask using `AskUserQuestion` if available
   (plain text otherwise), offering:
   - Last 24 hours
   - Last 3 days
   - Last week
   - Other (let the user specify, e.g. "since last Wednesday" or an explicit date range)

   For "Other," interpret whatever the user gives you into a concrete date range before continuing.

2. **On a "Last 24 hours" choice, check for gaps a strict 24-hour window would miss.** These two
   checks only apply to the 24-hours case — the longer windows already cover this ground:
   - If today is Monday, a straight 24-hour lookback starts Sunday morning and misses Friday
     evening and the weekend, which likely haven't been triaged yet. Ask: "Since it's Monday,
     want me to also include the weekend (from Friday evening) so nothing from Friday or the
     weekend slips through?" If yes, move `dateFrom` back to Friday evening (or Friday morning if
     the user prefers the full day).
   - Separately, ask: "Was there a holiday in the last few days that should be included too?" The
     skill has no calendar access, so rely on the user's answer. If yes, ask which day(s) and
     extend `dateFrom` to cover them.

   These two checks are independent — the user may say yes to one, both, or neither.

3. Convert the final window to ISO-8601 date-times with offset for `dateFrom`/`dateTo`.
4. Call `get_my_call_activity` (`dateFrom`, `dateTo`) for recent inbound, outbound, and missed
   calls, total talk time, and outstanding callbacks.
5. Call `get_my_communication_inbox` (`dateFrom`, `dateTo`, `messageTypes: ["SMS"]`) for recent
   text messages.
6. Call `get_my_communication_inbox` (`dateFrom`, `dateTo`, `messageTypes: ["VoiceMail"]`) for
   recent voicemail records.
7. Use `get_my_message_detail` (`messageId`) when a specific SMS or voicemail needs its full body
   or verified transcription to understand the action item. Use `get_my_sms_thread` (`messageId`,
   `dateFrom`, `dateTo`) when the full back-and-forth of a text conversation is needed for context.
8. Use `resolve_directory_person` (company directory, by name/department/role) or
   `search_my_contacts` (personal address book, by name/phone number) only when useful to identify
   a caller or contact. For Team Chat person resolution, use RingEX Chat's `find_person` instead —
   `team_messaging_get_person` no longer exists.
9. Use `get_my_phone` only when the user's own presence, business hours, or call-handling rules
   help decide whether to call, text, or defer.
10. Optionally use `get_my_call_insight` (`callId`) for AI notes/transcript on a specific call, or
    `get_my_call_recording_metadata` (`callId`) to check whether a call was recorded, when the call
    log alone doesn't give enough context.
11. Summarize patterns across all records before writing the report.

## What to identify

- Missed inbound calls without a later outbound call to the same person or number.
- Inbound SMS messages without a later user reply.
- Voicemail that has not clearly been addressed.
- Repeated contact attempts from the same person or number.
- Communications that mention urgency, deadlines, blockers, scheduling, customer issues, or needed
  decisions.
- Follow-ups that can be batched by person, account, customer, or topic.

## Output format

```md
# Communications Brief

## Window
[The date range actually used, and whether the weekend/holiday extension was applied.]

## Top Priorities
- [Most important follow-up and why it matters.]
- [Second most important follow-up.]

## Unreturned Calls
- [Caller/contact] called at [time]. Action: [call back, text, defer, or no action].

## Unanswered SMS
- [Contact/number] sent: [brief summary]. Action: [suggested response or next step].

## Voicemail Needing Attention
- [Caller/contact] left voicemail at [time]. Key point: [summary]. Action: [follow-up].

## Other Notable Activity
- [Useful context that is not urgent.]

## Suggested Plan
1. [Highest-priority response or call-back.]
2. [Next follow-up.]
3. [Lower-priority cleanup.]
```

## Guidance

- Be concise, practical, and action-oriented.
- Avoid dumping raw logs unless the user asks for them.
- Group related calls, texts, and voicemail from the same person together.
- State uncertainty when identity matching is unclear.
- Do not invent message contents, call outcomes, voicemail transcripts, or follow-up status.
- If tool results are empty, say that no relevant activity was found for the time range.
<!-- --8<-- [end:body] -->
