| name | gmail-bootstrap |
| description | One-time Gmail setup: scan 3 months of inbox history to build gmail-rules.md with sender patterns, importance signals, and cleanup rules. Use when setting up Gmail automation for the first time or refreshing email rules. |
Vault Location
Vault path: Read from ${CLAUDE_PLUGIN_ROOT}/brain-os.config.md
/gmail-bootstrap — Build Email Rules from History
Scans your last 3 months of inbox to learn your email patterns and generates gmail-rules.md — the rules file that the Gmail triage system uses.
Behavior
-
Scan inbox history via tsx ${CLAUDE_PLUGIN_ROOT}/skills/gmail-bootstrap/scripts/gmail-bootstrap.ts:
- Fetch all emails from the last 3 months
- For each thread, record: sender, subject, whether you replied, whether you drafted, whether you starred, labels applied, read/unread status
-
Analyze patterns:
- Senders you replied to or drafted → always important
- Senders you starred → important
- Senders you never opened → candidate for auto-archive or unsubscribe
- Senders with all emails read but no reply → informational, auto-archive candidate
- Frequency: daily senders vs one-time
-
Generate rules file at {vault}/business/intelligence/gmail-rules.md:
# Gmail Rules
<!-- Auto-generated by /gmail-bootstrap on YYYY-MM-DD -->
<!-- Edit freely — the triage system reads this file every run -->
## Always Important (save to vault + flag for reply)
- from:client@domain.com — replied 12 times
- from:investor@vc.com — replied 8 times, starred 3
## Important (read, but auto-archive if no action in 24h)
- from:team@company.com — read always, replied sometimes
## Informational (auto-archive)
- from:newsletter@substack.com — read occasionally, never replied
- from:updates@github.com — read 20%, never replied
## Auto-delete + Filter
- from:promo@spam.com — never opened across 15 emails
## Custom Rules
<!-- Add your own patterns below -->
- Present to user for review before saving
- Save to vault and run
/sync
Re-running
Safe to re-run anytime. Will regenerate the rules file but preserve the ## Custom Rules section that you edited manually.
Outcome log
Follow skill-spec.md § 11. Append to {vault}/daily/skill-outcomes/gmail-bootstrap.log:
{date} | gmail-bootstrap | bootstrap | ~/work/brain-os-plugin | business/intelligence/gmail-rules.md | commit:{hash} | {result}
result: pass if rules generated and saved, fail if API errors or scan incomplete