Analyze Inbox
Inbox analytics—patterns, top senders, volume trends. Smart about how much to fetch.
2
Interpret the analysis request. 'How much junk' means promotions/newsletters, not spam folder. 'Who's spamming me' means high-volume senders. State what you're analyzing.
3
Choose fetch size based on intent and offer alternatives. Quick junk check → 50-100 (sample and extrapolate). Full sender analysis → 100-150. Comprehensive month review → 200+. If fetching 100+, tell user: 'I'll check X emails—takes about Y seconds. Or I can sample 50 for a quick estimate.'
6
Lead with insights, not data. For junk: 'About 40% of your recent email is promotional—mostly from X, Y, Z.' For senders: 'Three senders account for 60% of your inbox.' Be conversational.
7
Save detailed stats to
Inbox Analysis. Format as YAML with timestamp, query scope, and metrics.
To run this task you must have the following required information:
What to analyze (junk levels, sender patterns, volume, time distribution), time period, depth preference (quick sample vs thorough)
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
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 read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Inbox Intent Patterns]: Read the documentation in: `./skills/sauna//resources/context/gmail.inbox.intent.md` (Interpret what user actually wants to know)
2. Interpret the analysis request. 'How much junk' means promotions/newsletters, not spam folder. 'Who's spamming me' means high-volume senders. State what you're analyzing.
3. Choose fetch size based on intent and offer alternatives. Quick junk check → 50-100 (sample and extrapolate). Full sender analysis → 100-150. Comprehensive month review → 200+. If fetching 100+, tell user: 'I'll check X emails—takes about Y seconds. Or I can sample 50 for a quick estimate.'
4. [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`: Gmail query for analysis scope (category:promotions, newer_than:30d, etc.)
- `maxResults` (default: "50"): Fetch size based on intent—default 100, adjust per guidance above
- `outputPath` (default: "session/emails.json"): session/analysis-data.json
5. [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
}
```
6. [Gather Arguments: Compute Gmail Stats] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `inputPath` (default: "session/emails.json"): session/analysis-data.json
- `metrics` (default: "senders,volume"): Metrics matching the analysis: labels for junk check, senders for volume analysis, hours for timing
7. [Run Code: Compute Gmail Stats]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/gmail.inbox.stats/preview,
"args": [
"inputPath",
"metrics"
]
},
"packages": null
}
```
8. Lead with insights, not data. For junk: 'About 40% of your recent email is promotional—mostly from X, Y, Z.' For senders: 'Three senders account for 60% of your inbox.' Be conversational.
9. Save detailed stats to `./documents/documents/inbox/analysis.yaml`. Format as YAML with timestamp, query scope, and metrics.