[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MCA4BDZATWCMTDV5209SE":3,"skill-same:01M75MCA4BDZATWCMTDV5209SE":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":13,"repositoryHtmlUrl":50,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":66},"01M75MCA4BDZATWCMTDV5209SE","connector-ingest",null,"Connect GBrain to external systems (Google Drive, Gmail, Notion, GitHub,\nSlack, Calendar) and sync content into the brain automatically. Delta sync\nwith OAuth2, webhooks, and rate-limiting.","Sigmacodeat\u002FSigmabrain","Sigmacodeat","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F220578687?v=4","01M75M8ZBH9439AFP2NTF8K98S","01M75M8ZC680S4377SFWSKP0D1",0,"MIT","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Fskills\u002Fconnector-ingest\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: connector-ingest\nversion: 1.0.0\ndescription: |\n  Connect GBrain to external systems (Google Drive, Gmail, Notion, GitHub,\n  Slack, Calendar) and sync content into the brain automatically. Delta sync\n  with OAuth2, webhooks, and rate-limiting.\ntriggers:\n  - \"connect google drive\"\n  - \"connect gmail\"\n  - \"connect notion\"\n  - \"connect github\"\n  - \"sync google drive\"\n  - \"sync gmail\"\n  - \"sync notion\"\n  - \"sync github\"\n  - \"connector status\"\n  - \"list connectors\"\n  - \"add connector\"\n  - \"remove connector\"\n  - \"pull from google drive\"\n  - \"pull from gmail\"\n  - \"pull from notion\"\n  - \"pull from github\"\ntools:\n  - search\n  - get_page\n  - put_page\nmutating: true\n---\n\n# connector-ingest — External System Connectors\n\n> **Convention:** see [conventions\u002Fquality.md](..\u002Fconventions\u002Fquality.md) for\n> citation rules and back-link enforcement.\n\n## Overview\n\nConnect GBrain to external productivity systems and sync their content into\nbrain pages automatically. Every synced item becomes a brain page with full\nsearch, entity extraction, and cross-linking.\n\n## Supported Connectors\n\n| Connector | Auth | Delta Sync | Content Types |\n|-----------|------|-----------|---------------|\n| **Google Drive** | OAuth2 | Changes API (pageToken) | PDF, DOCX, Sheets, Slides, Images |\n| **Gmail** | OAuth2 | History API (historyId) | Emails, Attachments |\n| **Notion** | API Key | last_edited_time polling | Pages, Databases, Blocks |\n| **GitHub** | PAT | updated_at + ETag | Issues, PRs, Discussions, Comments |\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ConnectorManager                             │\n│  ┌─────────────┐ ┌─────────┐ ┌────────┐ ┌────────────────┐  │\n│  │ GoogleDrive │ │  Gmail  │ │ Notion │ │     GitHub     │  │\n│  └──────┬──────┘ └────┬────┘ └───┬────┘ └───────┬────────┘  │\n│         │             │          │              │            │\n│  ┌──────▼─────────────▼──────────▼──────────────▼────────┐  │\n│  │              IngestionDaemon                           │  │\n│  │  validate → dedup → rate-limit → dispatch → put_page    │  │\n│  └─────────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────────┘\n```\n\nEach connector is a full `IngestionSource` supervised by the daemon:\n- **Rate limiting:** Token bucket per API (Google 1000\u002F100s, Notion 30\u002F10s, etc.)\n- **Retry:** Exponential backoff on API errors (3 retries, max 30s)\n- **Dedup:** 24h content-hash window (trickle mode) or slug-keyed permanent (migration mode)\n- **Health:** `gbrain doctor` checks connector health every 60s\n\n## Setup Commands\n\n### Google Drive\n\n```bash\n# 1. Create OAuth2 credentials at https:\u002F\u002Fconsole.cloud.google.com\u002F\n#    Enable Google Drive API\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials (does NOT authenticate yet)\ngbrain connector add google-drive \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow (opens browser)\ngbrain connector auth google-drive\n\n# 4. Sync now\ngbrain connector sync google-drive\n\n# 5. Sync specific folder only\ngbrain connector sync google-drive --filters '{\"folder\":\"FOLDER_ID\"}'\n\n# 6. Enable push webhook (optional — real-time sync instead of polling)\n#    Requires a publicly accessible URL (use ngrok for local dev):\n#    ngrok http 3000\n#    Then add the webhook URL:\ngbrain connector add google-drive \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET \\\n  --webhook-url https:\u002F\u002Fyour-ngrok-url.ngrok.io\u002Fwebhooks\u002Fgoogle-drive\n#    The connector auto-registers with Google Drive on next daemon start.\n```\n\n### Gmail\n\n```bash\n# 1. Enable Gmail API in Google Cloud Console\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials\ngbrain connector add gmail \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow\ngbrain connector auth gmail\n\n# 4. Sync\ngbrain connector sync gmail\n\n# Sync only specific labels\ngbrain connector sync gmail --filters '{\"labels\":[\"INBOX\",\"WORK\"]}'\n```\n\n### Notion\n\n```bash\n# 1. Create integration at https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n# 2. Share pages\u002Fdatabases with the integration\n\ngbrain connector add notion --api-key secret_XXX\n\ngbrain connector sync notion\n```\n\n### GitHub\n\n```bash\n# 1. Create PAT at https:\u002F\u002Fgithub.com\u002Fsettings\u002Ftokens\n\ngbrain connector add github --api-key ghp_XXX\n\n# Sync specific repos only\ngbrain connector sync github --filters '{\"repos\":[\"owner\u002Frepo1\",\"owner\u002Frepo2\"]}'\n\n# Sync only issues with specific labels\ngbrain connector sync github --filters '{\"labels\":[\"bug\",\"feature\"]}'\n```\n\n### Slack\n\n```bash\n# 1. Create app at https:\u002F\u002Fapi.slack.com\u002Fapps\n# 2. Add Bot Token Scopes: channels:history, groups:history, channels:read\n# 3. Install app to workspace → copy Bot User OAuth Token (xoxb-...)\n\ngbrain connector add slack --api-key xoxb-XXX\n\ngbrain connector sync slack\n\n# Sync only specific channels\ngbrain connector sync slack --filters '{\"channels\":[\"general\",\"work\"]}'\n```\n\n### Google Calendar\n\n```bash\n# 1. Enable Google Calendar API in Google Cloud Console\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials\ngbrain connector add calendar \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow\ngbrain connector auth calendar\n\n# 4. Sync\ngbrain connector sync calendar\n\n# Sync only specific calendars\ngbrain connector sync calendar --filters '{\"calendars\":[\"primary\",\"work@company.com\"]}'\n```\n\n### Dropbox\n\n```bash\n# 1. Create app at https:\u002F\u002Fwww.dropbox.com\u002Fdevelopers\u002Fapps\n# 2. Generate access token (Permissions: files.content.read)\n\ngbrain connector add dropbox --api-key YOUR_ACCESS_TOKEN\n\ngbrain connector sync dropbox\n\n# Sync only a specific folder\ngbrain connector sync dropbox --filters '{\"folder\":\"\u002FDocuments\"}'\n```\n\n### Asana\n\n```bash\n# 1. Get Personal Access Token at https:\u002F\u002Fapp.asana.com\u002F0\u002Fdeveloper-console\n\ngbrain connector add asana --api-key YOUR_PAT\n\ngbrain connector sync asana\n\n# Sync only specific workspaces or projects\ngbrain connector sync asana --filters '{\"workspaces\":[\"Engineering\"],\"projects\":[\"Sprint 1\"]}'\n```\n\n### Jira\n\n```bash\n# 1. Get API token at https:\u002F\u002Fid.atlassian.com\u002Fmanage-profile\u002Fsecurity\u002Fapi-tokens\n# 2. Your email + API token become the api-key (colon-separated)\n\ngbrain connector add jira \\\n  --api-key YOUR_EMAIL:YOUR_API_TOKEN \\\n  --base-url https:\u002F\u002Fyour-domain.atlassian.net\n\ngbrain connector sync jira\n\n# Sync only specific projects, issue types, or labels\ngbrain connector sync jira --filters '{\"projects\":[\"PROJ\"],\"issue_types\":[\"Bug\",\"Story\"],\"labels\":[\"critical\"]}'\n```\n\n## Management Commands\n\n```bash\n# List all connectors with status\ngbrain connector list\n\n# Check connector health\ngbrain connector status google-drive\n\n# Enable\u002Fdisable connector\ngbrain connector enable google-drive\ngbrain connector disable google-drive\n\n# Remove connector (deletes state + tokens)\ngbrain connector remove google-drive\n\n# Trigger one-shot sync (bulk migration mode)\ngbrain connector sync google-drive --mode migration\n\n# Reset sync cursor (full re-sync)\ngbrain connector reset google-drive\n```\n\n## Delta Sync Details\n\n### Google Drive\n- **Mechanism:** `changes.list(startPageToken)` → `changes.list(pageToken)`\n- **Cursor:** `pageToken` (opaque string from Google)\n- **Granularity:** File-level (created, modified, deleted)\n- **Webhook:** Optional via Drive push notifications (requires domain verification)\n\n### Gmail\n- **Mechanism:** `history.list(startHistoryId)` filtered by `messageAdded`\n- **Cursor:** `historyId` (uint64 string)\n- **Granularity:** Message-level\n- **Filtering:** By label (INBOX, SENT, custom labels)\n\n### Notion\n- **Mechanism:** `search` with `sort: {timestamp: last_edited_time, direction: descending}`\n- **Cursor:** ISO timestamp of last sync\n- **Granularity:** Page-level (re-fetches all blocks for changed pages)\n- **Limitations:** No native delta API; polls every 5 minutes\n\n### GitHub\n- **Mechanism:** `issues?since=YYYY-MM-DDTHH:MM:SSZ` per repo\n- **Cursor:** ISO timestamp of last sync\n- **Granularity:** Issue\u002FPR-level with comments\n- **Auto-discovery:** If no repos configured, syncs watched repos\n\n## Content Type Routing\n\nThe daemon routes connector events based on content_type:\n\n| Content Type | Destination | Processing |\n|--------------|-------------|------------|\n| `text\u002Fmarkdown` | Direct brain page | Frontmatter + body |\n| `text\u002Fhtml` | HTML-to-markdown → brain page | Strip tags |\n| `application\u002Fpdf` | `document-ingest` skill | OCR if needed |\n| `application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document` | `document-ingest` skill | mammoth extraction |\n| `image\u002F*` | `media-ingest` skill | OCR, embed |\n| `application\u002Fjson` | Connector-specific parser | Blocks → markdown |\n\n## Filing Rules\n\nConnector content is filed under:\n- Google Drive: `documents\u002Fgoogle-drive\u002F\u003Cfilename>`\n- Gmail: `documents\u002Fcorrespondence\u002Femails\u002F\u003Csubject>`\n- Notion: `notes\u002Fnotion\u002F\u003Cpage-title>`\n- GitHub: `tech\u002Fgithub\u002F\u003Crepo>\u002F\u003Ctype>-\u003Cnumber>`\n\n## Security\n\n- **OAuth2 tokens:** Stored in `~\u002F.gbrain\u002Fconnectors\u002F\u003Cservice>.json`, never committed\n- **Token refresh:** Automatic; no manual intervention\n- **Scope minimalism:** Connectors request only read scopes\n- **Untrusted payload flag:** Set for all connector content; auto-link skipped, slug-allowlist applied\n\n## Daemon Auto-Start\n\nConnectors auto-start when `gbrain serve --http` or `gbrain autopilot` boots.\nNo manual intervention required.\n\n```\ngbrain serve --http    # → ConnectorDaemon starts with all enabled connectors\ngbrain autopilot       # → ConnectorDaemon starts alongside the maintenance cycle\n```\n\nThe daemon:\n1. Reads `~\u002F.gbrain\u002Fconnectors.json` for enabled connectors\n2. Instantiates each connector (GoogleDrive, Gmail, Notion, GitHub)\n3. Registers them with the IngestionDaemon (supervision + rate-limit + dedup)\n4. Starts delta sync immediately (first sync) then polls every 5 minutes\n5. On shutdown (SIGTERM\u002FSIGINT), stops all connectors gracefully\n\nEvents flow: Connector → IngestionDaemon → MinionQueue (`ingest_capture`) → Brain page.\n\n## Anti-Patterns\n\n- ❌ Syncing everything without filters — use folder\u002Flabel\u002Frepo filters to limit scope\n- ❌ Manual token management — the connector handles refresh automatically\n- ❌ Disabling dedup — the 24h window prevents loops; migration mode is for bulk only\n- ❌ Running multiple Gmail connectors for the same account — dedup works per-source-kind\n\n## Related Skills\n\n- `skills\u002Fdocument-ingest\u002FSKILL.md` — PDF, DOCX processing for Drive attachments\n- `skills\u002Fmedia-ingest\u002FSKILL.md` — Images, audio, video from Drive\n- `skills\u002Fingest\u002FSKILL.md` — Generic ingestion router\n- `skills\u002Fcapture\u002FSKILL.md` — Quick one-off captures\n\n## Contract\n\nThis skill guarantees:\n- Every supported connector has delta sync (no full re-scans)\n- OAuth2 token refresh is automatic\n- Rate limiting prevents API bans\n- Content-type aware routing to appropriate processor\n- Raw source preservation via metadata\n- Health checks surface in `gbrain doctor`\n\n## Output Format\n\nPer sync run: connector · items fetched \u002F imported \u002F skipped · cursor advanced ·\nerrors (with retry status) — progress on stderr, a clean summary at the end.\n","# connector-ingest — External System Connectors\n\n> **Convention:** see [conventions\u002Fquality.md](..\u002Fconventions\u002Fquality.md) for\n> citation rules and back-link enforcement.\n\n## Overview\n\nConnect GBrain to external productivity systems and sync their content into\nbrain pages automatically. Every synced item becomes a brain page with full\nsearch, entity extraction, and cross-linking.\n\n## Supported Connectors\n\n| Connector | Auth | Delta Sync | Content Types |\n|-----------|------|-----------|---------------|\n| **Google Drive** | OAuth2 | Changes API (pageToken) | PDF, DOCX, Sheets, Slides, Images |\n| **Gmail** | OAuth2 | History API (historyId) | Emails, Attachments |\n| **Notion** | API Key | last_edited_time polling | Pages, Databases, Blocks |\n| **GitHub** | PAT | updated_at + ETag | Issues, PRs, Discussions, Comments |\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ConnectorManager                             │\n│  ┌─────────────┐ ┌─────────┐ ┌────────┐ ┌────────────────┐  │\n│  │ GoogleDrive │ │  Gmail  │ │ Notion │ │     GitHub     │  │\n│  └──────┬──────┘ └────┬────┘ └───┬────┘ └───────┬────────┘  │\n│         │             │          │              │            │\n│  ┌──────▼─────────────▼──────────▼──────────────▼────────┐  │\n│  │              IngestionDaemon                           │  │\n│  │  validate → dedup → rate-limit → dispatch → put_page    │  │\n│  └─────────────────────────────────────────────────────────┘  │\n└─────────────────────────────────────────────────────────────────┘\n```\n\nEach connector is a full `IngestionSource` supervised by the daemon:\n- **Rate limiting:** Token bucket per API (Google 1000\u002F100s, Notion 30\u002F10s, etc.)\n- **Retry:** Exponential backoff on API errors (3 retries, max 30s)\n- **Dedup:** 24h content-hash window (trickle mode) or slug-keyed permanent (migration mode)\n- **Health:** `gbrain doctor` checks connector health every 60s\n\n## Setup Commands\n\n### Google Drive\n\n```bash\n# 1. Create OAuth2 credentials at https:\u002F\u002Fconsole.cloud.google.com\u002F\n#    Enable Google Drive API\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials (does NOT authenticate yet)\ngbrain connector add google-drive \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow (opens browser)\ngbrain connector auth google-drive\n\n# 4. Sync now\ngbrain connector sync google-drive\n\n# 5. Sync specific folder only\ngbrain connector sync google-drive --filters '{\"folder\":\"FOLDER_ID\"}'\n\n# 6. Enable push webhook (optional — real-time sync instead of polling)\n#    Requires a publicly accessible URL (use ngrok for local dev):\n#    ngrok http 3000\n#    Then add the webhook URL:\ngbrain connector add google-drive \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET \\\n  --webhook-url https:\u002F\u002Fyour-ngrok-url.ngrok.io\u002Fwebhooks\u002Fgoogle-drive\n#    The connector auto-registers with Google Drive on next daemon start.\n```\n\n### Gmail\n\n```bash\n# 1. Enable Gmail API in Google Cloud Console\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials\ngbrain connector add gmail \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow\ngbrain connector auth gmail\n\n# 4. Sync\ngbrain connector sync gmail\n\n# Sync only specific labels\ngbrain connector sync gmail --filters '{\"labels\":[\"INBOX\",\"WORK\"]}'\n```\n\n### Notion\n\n```bash\n# 1. Create integration at https:\u002F\u002Fwww.notion.so\u002Fmy-integrations\n# 2. Share pages\u002Fdatabases with the integration\n\ngbrain connector add notion --api-key secret_XXX\n\ngbrain connector sync notion\n```\n\n### GitHub\n\n```bash\n# 1. Create PAT at https:\u002F\u002Fgithub.com\u002Fsettings\u002Ftokens\n\ngbrain connector add github --api-key ghp_XXX\n\n# Sync specific repos only\ngbrain connector sync github --filters '{\"repos\":[\"owner\u002Frepo1\",\"owner\u002Frepo2\"]}'\n\n# Sync only issues with specific labels\ngbrain connector sync github --filters '{\"labels\":[\"bug\",\"feature\"]}'\n```\n\n### Slack\n\n```bash\n# 1. Create app at https:\u002F\u002Fapi.slack.com\u002Fapps\n# 2. Add Bot Token Scopes: channels:history, groups:history, channels:read\n# 3. Install app to workspace → copy Bot User OAuth Token (xoxb-...)\n\ngbrain connector add slack --api-key xoxb-XXX\n\ngbrain connector sync slack\n\n# Sync only specific channels\ngbrain connector sync slack --filters '{\"channels\":[\"general\",\"work\"]}'\n```\n\n### Google Calendar\n\n```bash\n# 1. Enable Google Calendar API in Google Cloud Console\n#    Add redirect URI: http:\u002F\u002Flocalhost:3000\u002Foauth\u002Fcallback\n# 2. Add connector credentials\ngbrain connector add calendar \\\n  --client-id YOUR_CLIENT_ID \\\n  --client-secret YOUR_CLIENT_SECRET\n\n# 3. Authenticate via PKCE OAuth2 web flow\ngbrain connector auth calendar\n\n# 4. Sync\ngbrain connector sync calendar\n\n# Sync only specific calendars\ngbrain connector sync calendar --filters '{\"calendars\":[\"primary\",\"work@company.com\"]}'\n```\n\n### Dropbox\n\n```bash\n# 1. Create app at https:\u002F\u002Fwww.dropbox.com\u002Fdevelopers\u002Fapps\n# 2. Generate access token (Permissions: files.content.read)\n\ngbrain connector add dropbox --api-key YOUR_ACCESS_TOKEN\n\ngbrain connector sync dropbox\n\n# Sync only a specific folder\ngbrain connector sync dropbox --filters '{\"folder\":\"\u002FDocuments\"}'\n```\n\n### Asana\n\n```bash\n# 1. Get Personal Access Token at https:\u002F\u002Fapp.asana.com\u002F0\u002Fdeveloper-console\n\ngbrain connector add asana --api-key YOUR_PAT\n\ngbrain connector sync asana\n\n# Sync only specific workspaces or projects\ngbrain connector sync asana --filters '{\"workspaces\":[\"Engineering\"],\"projects\":[\"Sprint 1\"]}'\n```\n\n### Jira\n\n```bash\n# 1. Get API token at https:\u002F\u002Fid.atlassian.com\u002Fmanage-profile\u002Fsecurity\u002Fapi-tokens\n# 2. Your email + API token become the api-key (colon-separated)\n\ngbrain connector add jira \\\n  --api-key YOUR_EMAIL:YOUR_API_TOKEN \\\n  --base-url https:\u002F\u002Fyour-domain.atlassian.net\n\ngbrain connector sync jira\n\n# Sync only specific projects, issue types, or labels\ngbrain connector sync jira --filters '{\"projects\":[\"PROJ\"],\"issue_types\":[\"Bug\",\"Story\"],\"labels\":[\"critical\"]}'\n```\n\n## Management Commands\n\n```bash\n# List all connectors with status\ngbrain connector list\n\n# Check connector health\ngbrain connector status google-drive\n\n# Enable\u002Fdisable connector\ngbrain connector enable google-drive\ngbrain connector disable google-drive\n\n# Remove connector (deletes state + tokens)\ngbrain connector remove google-drive\n\n# Trigger one-shot sync (bulk migration mode)\ngbrain connector sync google-drive --mode migration\n\n# Reset sync cursor (full re-sync)\ngbrain connector reset google-drive\n```\n\n## Delta Sync Details\n\n### Google Drive\n- **Mechanism:** `changes.list(startPageToken)` → `changes.list(pageToken)`\n- **Cursor:** `pageToken` (opaque string from Google)\n- **Granularity:** File-level (created, modified, deleted)\n- **Webhook:** Optional via Drive push notifications (requires domain verification)\n\n### Gmail\n- **Mechanism:** `history.list(startHistoryId)` filtered by `messageAdded`\n- **Cursor:** `historyId` (uint64 string)\n- **Granularity:** Message-level\n- **Filtering:** By label (INBOX, SENT, custom labels)\n\n### Notion\n- **Mechanism:** `search` with `sort: {timestamp: last_edited_time, direction: descending}`\n- **Cursor:** ISO timestamp of last sync\n- **Granularity:** Page-level (re-fetches all blocks for changed pages)\n- **Limitations:** No native delta API; polls every 5 minutes\n\n### GitHub\n- **Mechanism:** `issues?since=YYYY-MM-DDTHH:MM:SSZ` per repo\n- **Cursor:** ISO timestamp of last sync\n- **Granularity:** Issue\u002FPR-level with comments\n- **Auto-discovery:** If no repos configured, syncs watched repos\n\n## Content Type Routing\n\nThe daemon routes connector events based on content_type:\n\n| Content Type | Destination | Processing |\n|--------------|-------------|------------|\n| `text\u002Fmarkdown` | Direct brain page | Frontmatter + body |\n| `text\u002Fhtml` | HTML-to-markdown → brain page | Strip tags |\n| `application\u002Fpdf` | `document-ingest` skill | OCR if needed |\n| `application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document` | `document-ingest` skill | mammoth extraction |\n| `image\u002F*` | `media-ingest` skill | OCR, embed |\n| `application\u002Fjson` | Connector-specific parser | Blocks → markdown |\n\n## Filing Rules\n\nConnector content is filed under:\n- Google Drive: `documents\u002Fgoogle-drive\u002F\u003Cfilename>`\n- Gmail: `documents\u002Fcorrespondence\u002Femails\u002F\u003Csubject>`\n- Notion: `notes\u002Fnotion\u002F\u003Cpage-title>`\n- GitHub: `tech\u002Fgithub\u002F\u003Crepo>\u002F\u003Ctype>-\u003Cnumber>`\n\n## Security\n\n- **OAuth2 tokens:** Stored in `~\u002F.gbrain\u002Fconnectors\u002F\u003Cservice>.json`, never committed\n- **Token refresh:** Automatic; no manual intervention\n- **Scope minimalism:** Connectors request only read scopes\n- **Untrusted payload flag:** Set for all connector content; auto-link skipped, slug-allowlist applied\n\n## Daemon Auto-Start\n\nConnectors auto-start when `gbrain serve --http` or `gbrain autopilot` boots.\nNo manual intervention required.\n\n```\ngbrain serve --http    # → ConnectorDaemon starts with all enabled connectors\ngbrain autopilot       # → ConnectorDaemon starts alongside the maintenance cycle\n```\n\nThe daemon:\n1. Reads `~\u002F.gbrain\u002Fconnectors.json` for enabled connectors\n2. Instantiates each connector (GoogleDrive, Gmail, Notion, GitHub)\n3. Registers them with the IngestionDaemon (supervision + rate-limit + dedup)\n4. Starts delta sync immediately (first sync) then polls every 5 minutes\n5. On shutdown (SIGTERM\u002FSIGINT), stops all connectors gracefully\n\nEvents flow: Connector → IngestionDaemon → MinionQueue (`ingest_capture`) → Brain page.\n\n## Anti-Patterns\n\n- ❌ Syncing everything without filters — use folder\u002Flabel\u002Frepo filters to limit scope\n- ❌ Manual token management — the connector handles refresh automatically\n- ❌ Disabling dedup — the 24h window prevents loops; migration mode is for bulk only\n- ❌ Running multiple Gmail connectors for the same account — dedup works per-source-kind\n\n## Related Skills\n\n- `skills\u002Fdocument-ingest\u002FSKILL.md` — PDF, DOCX processing for Drive attachments\n- `skills\u002Fmedia-ingest\u002FSKILL.md` — Images, audio, video from Drive\n- `skills\u002Fingest\u002FSKILL.md` — Generic ingestion router\n- `skills\u002Fcapture\u002FSKILL.md` — Quick one-off captures\n\n## Contract\n\nThis skill guarantees:\n- Every supported connector has delta sync (no full re-scans)\n- OAuth2 token refresh is automatic\n- Rate limiting prevents API bans\n- Content-type aware routing to appropriate processor\n- Raw source preservation via metadata\n- Health checks surface in `gbrain doctor`\n\n## Output Format\n\nPer sync run: connector · items fetched \u002F imported \u002F skipped · cursor advanced ·\nerrors (with retry status) — progress on stderr, a clean summary at the end.\n",{"name":5,"tools":23,"version":27,"mutating":28,"triggers":29,"description":46},[24,25,26],"search","get_page","put_page","1.0.0",true,[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"connect google drive","connect gmail","connect notion","connect github","sync google drive","sync gmail","sync notion","sync github","connector status","list connectors","add connector","remove connector","pull from google drive","pull from gmail","pull from notion","pull from github","Connect GBrain to external systems (Google Drive, Gmail, Notion, GitHub,\nSlack, Calendar) and sync content into the brain automatically. Delta sync\nwith OAuth2, webhooks, and rate-limiting.\n","main","b8e699fc7cff8641b94a51ac9d4aa599fcc03ae5","server\u002Fskills\u002Fconnector-ingest","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain","https:\u002F\u002Fsigmabrain.vercel.app","https:\u002F\u002Fgithub.com\u002FSigmacodeat","2026-07-09 09:21:55",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":28},[56,59,62],{"tool":57,"command":58},"npx","npx skills add Sigmacodeat\u002FSigmabrain --skill connector-ingest",{"tool":60,"command":61},"bunx","bunx skills add Sigmacodeat\u002FSigmabrain --skill connector-ingest",{"tool":63,"command":64},"pnpm","pnpm dlx skills add Sigmacodeat\u002FSigmabrain --skill connector-ingest","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Fskills\u002Fconnector-ingest\u002FSKILL.md",[],[68,74,80,87,94,101],{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M75MW3405DES0348DPKVF20G","query-helper","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fquery-helper\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M75MW29T3N856QPT2SK467A3","broken","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbroken\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M75MVZV51CX9W3Y602M0GJR9","brain-ops","Read, enrich, and write brain pages with source attribution.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fskill-catalog\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M75MVXQAQBVNQBZPKPEBPRHV","signal-detector","Always-on ambient signal capture for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fsignal-detector\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M75MVWJN0EV5EFW6JMMC73XC","query","Look up brain pages in the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fquery\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":18},"01M75MVVA7Q6PMDBTPQGT49M6M","context-now","ALWAYS-ON time-sensitivity discipline for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002FSigmacodeat\u002FSigmabrain\u002Fblob\u002Fmain\u002Fserver\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fcontext-now\u002FSKILL.md",[],[]]