Skip to main content
BuildAI reviewed Aug 28, 2026

Google Loops

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.

v1.0.14New

Unsigned, install at your own risk

Unverified

This skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install gbrain-google-loops
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/gbrain-google-loops/SKILL.md

Setup guide →
0Save

Instructions

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)

  1. 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.
  2. 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.
  3. Never put secrets in argv or chat when avoidable. When the user drops
    client_secret_*.json into 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-secret flags are the last resort.
  4. Every command speaks JSON. Add --json and read
    { ok, status, next_action: { command, user_message }, error }. When
    next_action.user_message is present, that IS the message to show the
    user; when next_action.command is present, that is your next call.
    Errors carry { code, problem, cause, fix, doc_url } — show the user
    problem + fix, nothing else.
  5. Re-running is always safe. gbrain google connect and
    gbrain google setup are 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 [email protected].

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 [email protected] \
  --access command --token-command "<command that prints an access token>"

(--access env --token-env <VAR> reads an externally-refreshed token from
the environment instead; --access gbrainio reads Gmail through a gbrain.io
terminal, see google-connect.md "Reading mail through gbrain.io".) 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
  • waiting may end with withheld_noise: open reply-owed loops from senders
    whose mail is automated (bank or shipping alerts). Show the user each
    preview_command, run it (--dry-run changes nothing), and drop only after
    the user agrees: a drop cannot be undone. Offer loops mute sender when the
    user wants a stop they can reverse.

  • waiting REFUSES 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-ok when the user explicitly accepts stale results.

  • completeness: "partial" means some mail in the last 14 days is held after
    repeated import failures (listed in held), or, with no_google_sources: null, the sources could not be read (retry). Present the answer as partial:
    name each held item (sender, and subject when shown) and its retry command
    (gbrain sources retry-held <id>). Never say "you are clean" on a partial
    answer.

  • When presenting loops, show: the counterparty, what's owed (summary), the
    evidence quote, the deep link (opens the exact Gmail thread in the right
    account), and the due date when present. The trusted-local result already
    carries a paste-ready text digest — reuse it.

  • For "context to respond": each group carries the counterparty's entity
    card (summary, recent history, other open threads). Need more, call
    context_pack with the counterparty slug.

  • After the user says they replied/handled something, close the loop
    (loops done) — thread loops also self-close on the next sync when the
    reply is visible in Gmail.

Continuous ingestion

Google sources sync like any source: autopilot and gbrain sync --all pick
them up automatically. No cron of its own. A bare un-targeted gbrain sync
does NOT reach them — use --source <id> or --all.

Troubleshooting

Every failure has a typed code with the fix attached —
docs/guides/google-connect.md#troubleshooting is the canonical table. The
three the user will actually hit:

  • "Google hasn't verified this app" during consent → expected; it's the
    user's own app: Advanced → Continue. Warn them BEFORE they click the URL.
  • access_denied_test_user → they forgot to add themselves as a test
    user (the error carries the deep link).
  • invalid_grant_testing_expiry (everything silently stopped ~day 7) →
    their consent screen is still in Testing; publish to Production, then
    gbrain google connect --reauth <email>.

Cost honesty

Commitment extraction sends recent email text (≤30 days, ≤50 threads/sweep)
to the configured chat provider. Tell the user once during setup; the off
switch is gbrain config set loops.extraction_enabled false. The
unanswered-thread detector is free and unaffected.

Output Format

When relaying gbrain waiting, present per counterparty, most urgent first, then the ## No counterparty section (loops that name no person) last:

## <Counterparty> (<N> open)
- [<loop_type>] <what's owed> (<age>) — due <date if any>
  > "<evidence quote>"
  <Gmail deep link>

The trusted-local --json result already carries this as a paste-ready
text field — prefer relaying it over re-rendering. For setup commands,
relay [SHOW USER] blocks verbatim and error.problem + error.fix on
failures; never dump raw JSON envelopes at the user.

When it fails

Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:

  • Setup prints [SHOW USER] blocks: relay them verbatim, one message per block. gbrain mcp expose and gbrain google still exit 2 when they need the user's confirmation (documented legacy), so read the block, not just the exit code.
  • A Google credential error (invalid_grant_revoked, consent_timeout, wrong_account_consented, …) carries { code, problem, cause, fix }: show the user the problem and fix; most fixes are "run it again" by the user.
  • gbrain waiting refuses on stale data or reports partial coverage from held items: run the sync it names, or gbrain sources status <id> then, after the user agrees, gbrain sources retry-held <id>.

Anti-Patterns

  • Paraphrasing a [SHOW USER] block. The checklists carry load-bearing
    detail ("Desktop app, NOT Web application", the test-user step). Relay
    verbatim, one message per block.
  • Asking the user for client_id/client_secret as chat text. Take the
    downloaded JSON as a 0600 file (--client-json <path>) or env vars;
    secrets in argv/chat are the last resort, never the default.
  • Answering "who is waiting on me" from query/search. The open-loop
    record is open_loops / gbrain waiting — search results have no
    loop-state semantics and will happily surface answered threads.
  • Dropping completeness: "partial". A partial answer with no loops is
    not an empty inbox; say which items are held and how to re-attempt them.
  • Bypassing the staleness refusal with --stale-ok silently. Run the
    named gbrain sync --source <id> first; only pass --stale-ok when the
    user explicitly accepts possibly-outdated loops.
  • Marking loops done for the user. Close (gbrain loops done <id>) only
    after the user says it's handled; thread loops self-close on the next sync
    when the reply is visible in Gmail.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
article-enrichmentTransform raw article text dumps in the brain into structured pages with executive summary, verbatim quotes, key insights, why-it-matters, and cross-references. Replaces walls-of-text with quotable, actionable brain pages.1 installsbrain-opsBrain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking. Read this before any brain interaction.0 installsfunctional-area-resolverCompress an agent's routing file (RESOLVER.md or AGENTS.md) by converting granular skill-per-row tables into functional-area dispatchers. Each area lists sub-skills in a "(dispatcher for: ...)" clause. The LLM reads one area entry and routes to the correct sub-skill. Proven via held-out A/B eval: dispatcher pattern outperforms naive pipe-table compression.0 installscompany-brainifyExtract a sanitized shared team/company brain from a personal brain. Strips internal ratings, compensation, performance assessments, retention and political dynamics from pages, takes, and facts across the full scan scope (people, companies, meetings, dailies, cross-references — not just people/), verifies with grep + retrieval passes, and purges sensitive git history behind the data-loss-gate confirmation card. Also runs as a report-only re-audit on an existing shared brain.0 installsask-userReusable pattern for presenting the user with explicit choices and gating execution until they respond. Used by other skills when a decision point requires human input before proceeding. Platform-agnostic — works on Telegram (inline buttons), Discord, CLI, or any agent with a message tool.0 installsenrichEnrich brain pages with tiered enrichment protocol. Creates and updates person/company pages with compiled truth, timeline, and cross-links. Use when a new entity is mentioned or an existing page needs updating.0 installs

More from gbrain

View source →
skillpack-checkRun `gbrain skillpack-check` to produce an agent-readable JSON health report for the gbrain install. Wraps `gbrain doctor` + `gbrain apply-migrations --list` so a host agent (your OpenClaw's morning-briefing, any OpenClaw cron) can see at a glance whether the skillpack needs attention. Use when the user asks "is gbrain healthy?", when a cron fires a morning check, or proactively when something seems off (jobs not running, brain not updating, autopilot silent).2 installsskill-autobenchAuthor an eval for an existing skill from its REAL usage history, not its spec. Mine invocations from the brain's conversation archive (conversations/) and per-harness session transcripts — a user correction after an invocation is the gold signal — then synthesize an eval_contract plus 4-8 replayable cases with honesty labels (SPEC-DERIVED vs HISTORY-IMPLIED) and stage the result at skills/<name>/eval/autobench-<date>.md as PENDING-HUMAN-APPROVAL. Never rewrites SKILL.md. Ships two guard companions: panel integrity (multi-model judging must prove each provider actually responded) and the fail-improve taxonomy (logged LLM-fallback cases convert to deterministic code over time).2 installsskill-optimizerSelf-evolving skill optimization via SkillOpt-paper-grounded text-space optimizer.2 installscorrection-pipelineWhen the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent recurrence. Every factual error is either a data error (bad brain page, bad memory file, bad rendered SOUL/USER identity, bad facts row) or a hallucination (LLM confabulated from partial signals).2 installspostgres-adoptDetect which gbrain engine is in use (PGLite vs Postgres), prefer Postgres for agent-harness installs, install/provision Postgres (Supabase discovery via SUPABASE_ACCESS_TOKEN, local Postgres, opt-in Docker), and move an existing PGLite brain to Postgres with its history (plan, ask, run). Detection is one engine-free command; the install ladder is one flag.1 installsdaily-task-managerTask lifecycle management with stable task IDs. Add, complete, defer, remove, and review tasks with deterministic action routing and fail-closed ambiguity handling. Maintains a running task list as a brain page.1 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.642 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.546 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.353 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.252 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.179 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions146 installs

Frequently asked questions about google-loops

What does the google-loops skill do?

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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the google-loops skill?

Run `npx @skills-hub-ai/cli install gbrain-google-loops` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/gbrain-google-loops/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does google-loops work with?

google-loops runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the google-loops skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use google-loops after installing it?

In Claude Code, type `/gbrain-google-loops` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the google-loops skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.