google-loops
它能做什么
这项技能为你的知识库设置 Google 连接器,并跟踪未结的事项,例如等待你回复的人。它还会提供每日摘要,列出在等待的人,以及回复所需的背景。
适用场景
- ✓当你想把 Gmail、日历和联系人连接到知识库时。
- ✓当你想每天看到一份等待你回复的人员清单时。
- ✓当你想关闭或静音某个未结事项,或修复 Google 连接错误时。
技能链接
https://github.com/garrytan/gbrain/blob/master/plugin/skills/google-loops/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的 Gmail 和日历连接到知识库,然后告诉我今天有谁在等我回复。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会引导你完成一项需要你进行两个步骤的 Google 设置,然后保存未结线索的记录。每日摘要会利用这份记录,列出在等待的人员以及每个人的背景。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Google Loops — Setup and Daily Operation
The connector ingests Gmail threads, calendar events, and contacts into the
brain and maintains the open-loop record behind gbrain waiting. Full
references: docs/guides/google-connect.md (setup + every error and its
fix) and docs/guides/open-loops.md (how detection works).
Contract for the harness (read first)
- Relay
[SHOW USER]blocks verbatim. Setup commands print fenced[SHOW USER] ... [/SHOW USER]blocks — numbered steps with deep links. Pass them to the user unchanged (paraphrasing loses load-bearing detail like "Desktop app, NOT Web application"). Batch everything into ONE message per block. - The whole setup is exactly two user interactions. (1) The Google Cloud checklist + the user hands back the downloaded client JSON. (2) The user clicks one consent URL. If you find yourself asking a third question, re-read the block you skipped.
- Never put secrets in argv or chat when avoidable. When the user drops
client_secret_*.jsoninto chat, save it to a file (mode 0600) and pass the path:gbrain google connect --client-json <path>. Env (GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET) also works. Raw--client-id/--client-secretflags are the last resort. - Every command speaks JSON. Add
--jsonand read{ ok, status, next_action: { command, user_message }, error }. Whennext_action.user_messageis present, that IS the message to show the user; whennext_action.commandis present, that is your next call. Errors carry{ code, problem, cause, fix, doc_url }— show the userproblem+fix, nothing else. - Re-running is always safe.
gbrain google connectandgbrain google setupare idempotent state machines — the documented fix for most errors is "run it again."
Setup (the one command)
gbrain google setup --json
Handles: credential intake (prints the GCP checklist when nothing is on
file) → consent (loopback locally; auto paste-back over SSH/headless —
non-TTY flows complete via a second call:
gbrain google connect --code "<pasted-redirect-url>") → source
registration → a budgeted first sync (newest mail first; the deep backfill
resumes on later syncs automatically) → the first gbrain waiting digest.
Multiple accounts: repeat with --account work@example.com.
Already holding Google access another way (a Google CLI with its own auth,
gcloud, a credential gateway that mints tokens)? Skip OAuth and point the
source at it — no credential enters gbrain:
gbrain sources add gmail-work --kind google --account you@example.com \
--access command --token-command "<command that prints an access token>"
(--access env --token-env <VAR> reads an externally-refreshed token from
the environment instead.) Then gbrain sync --source gmail-work and
gbrain waiting work identically.
Verify health afterwards: gbrain google status --json (per-account
refresh probe) — and gbrain doctor carries a google_oauth check that
warns once a Testing-mode account goes 5+ days without a successful
refresh. An actively-syncing account gets no pre-warning before the 7-day
Testing-mode expiry — publishing to Production is the real fix.
Daily operation
gbrain waiting --json # the killer output: ranked people waiting
gbrain loops done <id> # user handled it
gbrain loops drop <id> # user is not going to do it
gbrain loops mute sender <email> # never track this sender again (closes its open reply-owed loops)
gbrain loops unmute sender <email> # undo; the loops it closed are re-checked on the next sync
gbrain loops drop sender <email> --dry-run # preview closing one sender's reply-owed loops
waitingmay end withwithheld_noise: open reply-owed loops from senders whose mail is automated (bank or shipping alerts). Show the user eachpreview_command, run it (--dry-runchanges nothing), and drop only after the user agrees: a drop cannot be undone. Offerloops mute senderwhen the user wants a stop they can reverse.waitingREFUSES on stale data (no successful sync in 24h) and names the exact fix (gbrain sync --source <id>). Run the sync, then retry. Only use--stale-okwhen the user explicitly accepts stale results.completeness: "partial"means some mail in the last 14 days is held after repeated import failures (listed inheld). Present the answer as partial: name each held item
常见问题
设置需要我做几步?
设置只需要你完成两个操作:一份 Google Cloud 检查清单,以及一个授权链接。
我的 Google 凭据安全吗?
安全。机密信息保存在受保护的文件中,并通过路径传递,不会在聊天中显示。
设置出错时去哪里找帮助?
技能会指向一份指南,其中列出了每个错误及其修复方法。
详情
作者的原始描述
Set up and operate the Gmail/Calendar/Contacts connector and the open-loop engine: who is waiting on the user, what they promised, and the context needed to respond. Covers painless BYO OAuth setup (exactly two user interactions), the daily `gbrain waiting` digest, loop closing/muting, and troubleshooting via the typed error catalog.
repo: garrytan/gbrain
热度
- GitHub 星标
- 31k
- 排名
- #9304
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …