task icon Task

Gmail Catch-Up Summary

Fetch unread Gmail messages, summarize with prioritization, and offer to mark as read

5

If count is 0: "Your inbox is all caught up—no unread emails!" End here.

If totalEstimate > count: "Showing 100 most recent of ~[totalEstimate] unread."

Synthesize per sliceCatch-Up Prioritization Guide:

  • Lead with Tier 1 (matches from catchup preferences)
  • Highlight emails needing response (questions, action items)
  • Group by theme/sender for clusters
  • Note lower-priority items briefly

For 100+ emails: focus Tier 1-2 only, summarize rest as counts.

Present conversationally—don't list every email.

6

Ask if the user wants to mark all these as read.

If yes, collect all message IDs from the unread results (comma-separated) and proceed to the next step.
If no, skip the next step—they'll stay unread for later.

8

Note any signals that suggest user interests:

  • Did they ask follow-up questions about specific senders or topics?
  • Did they express interest ("what did Sarah say exactly?")?
  • Did they dismiss something ("I don't need the newsletter stuff")?

If you observed any signals, save to stateDomain Preferences (domain: catchup). Include a "reason" explaining why this was added.

Don't add preferences after every catch-up—only when there's a clear signal of interest.

                    You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.

Add all steps to your todo list now and begin executing.

## Steps

1. [Read Catch-Up Prioritization Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/catchup.prioritization.guide.md` (Load prioritization framework before analysis)

2. [Read Domain Preferences]: Discover relevant information in the user's filesystem at `documents/preferences/[domain].md`. (Load prioritization preferences - VIP contacts, topics, deprioritize rules (domain: catchup))

3. [Gather Arguments: Fetch Gmail Messages] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `query`: is:unread
- `maxResults` (default: "50"): 100
- `outputPath` (default: "session/emails.json"): session/gmail-unread.json

4. [Run Code: Fetch Gmail Messages]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/gmail.inbox.fetch/preview,
    "args": [
      "query",
      "maxResults",
      "outputPath"
    ]
  },
  "packages": null
}
```

5. [Read Gmail Unread Data]: Read the file at `session/gmail-unread.json` into context (Load the fetched unread emails)

6. If count is 0: "Your inbox is all caught up—no unread emails!" End here.

If totalEstimate > count: "Showing 100 most recent of ~[totalEstimate] unread."

Synthesize per `skills/sauna/[skill_id]/references/catchup.prioritization.guide.md`:
- Lead with Tier 1 (matches from catchup preferences)
- Highlight emails needing response (questions, action items)
- Group by theme/sender for clusters
- Note lower-priority items briefly

For 100+ emails: focus Tier 1-2 only, summarize rest as counts.

Present conversationally—don't list every email.


7. Ask if the user wants to mark all these as read.

If yes, collect all message IDs from the unread results (comma-separated) and proceed to the next step.
If no, skip the next step—they'll stay unread for later.


8. [Gather Arguments: Mark Gmail Messages Read] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `messageIds`: Comma-separated message IDs from the unread results
- `outputPath` (default: "session/gmail-mark-results.json") - Path to write results JSON

9. [Run Code: Mark Gmail Messages Read]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/catchup.gmail.mark/preview,
    "args": [
      "messageIds",
      "outputPath"
    ]
  },
  "packages": null
}
```

10. Note any signals that suggest user interests:

- Did they ask follow-up questions about specific senders or topics?
- Did they express interest ("what did Sarah say exactly?")?
- Did they dismiss something ("I don't need the newsletter stuff")?

If you observed any signals, save to `documents/preferences/[domain].md` (domain: catchup). Include a "reason" explaining why this was added.

Don't add preferences after every catch-up—only when there's a clear signal of interest.