name: sync-data-gmail description: > Fetch email threads from Gmail API into a JSON file. No classification, no actions — just data. Fast, no browser needed. allowed-tools: Read, Write, Edit, Bash(npx tsx .claude/skills/sync-data-gmail/*)
Sync Gmail Data
Email ingestion via Gmail API. No classification, no triage, no Gmail actions. Fast — no browser required. Can run as a subagent in parallel with browser-based syncs.
Output File
outputs/sync-data/gmail.json — full replacement on every run.
Schema
{
"version": 1,
"last_synced": "2026-02-11T09:00:00-08:00",
"account": "steven@worca.io",
"thread_count": 100,
"threads": [
{
"threadId": "19c4d20aa13f8ca0",
"messageId": "19c4d20aa13f8ca0",
"from": "justinchi.g@example.com",
"fromName": "Justin Chi",
"to": "tiwen@worca.io",
"subject": "outbound for Worca",
"date": "2026-02-11",
"body": "First 1000 chars of latest message...",
"labels": ["UNREAD", "IMPORTANT", "INBOX"],
"messageCount": 1,
"participants": [{"name": "Justin Chi", "email": "justinchi.g@example.com"}]
}
]
}
Steps
- Run:
npx tsx .claude/skills/sync-data-gmail/fetch.ts --count 100 - Parse the JSON output. The script returns
{ "threads": [...], "count": N }. - Build the output object with
version,last_synced(current ISO timestamp with timezone offset),account("steven@worca.io"),thread_count, andthreads. - Write to
outputs/sync-data/gmail.json(full replacement). - Log: "Synced {N} email threads at {timestamp}"
Notes
- This skill does NOT classify, triage, or take Gmail actions. That's
alfred-email-triage. - The file is always the latest snapshot. No historical accumulation.
- Typically takes <10 seconds.