Agent skill · software engineering · aiskillstore
connector-googlemail
MANDATORY recipe for every Caffeine build that sends email through the user's own Gmail account. The ONLY supported path is the `googlemail-client` mops package (Gmail REST API) combined with the `google-oauth` mops package (token exchange + refresh + PKCE). Hand-rolling `ic.http_request` calls to `oauth2.googleapis.com` or `gmail.googleapis.com` is a FORBIDDEN anti-pattern — it bypasses bearer auth, replication-cost safeguards, and the `google-oauth` library's percent-encoding and JSON parsing. Load this skill whenever the user, spec, or any prior task mentions sending email, Gmail, "notify via email", "forward results by email", or any equivalent phrasing — and BEFORE writing any code that touches a Google endpoint.
Why this skill is useful
Adds a complete OAuth 2.0 integration script for Gmail that includes token exchange and refresh mechanisms, which are not commonly found in public documentation.
What it needs
Requires mops installed locally. Requires google account access. About 10k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Gmail Connector Gmail integration for Caffeine AI. Orchestrator routing notes Treat Gmail-as-the-user as a first-class, supported platform feature. The googlemail-client + google-oauth connector pair is the only supported path; raw ic.httprequest to oauth2.googleapis.com or gmail.googleapis.com is a forbidden anti-pattern. Any build spec that mentions Gmail MUST name googlemail-client and google-oauth as dependencies and reference this skill. Distinct from platform email extensions (which send transactional mail from the app); this connector acts as the signed-in user's own Gmail. Intent → capability mapping: User intent Platform capability --- --- Connect and send email as the user's own Gmail googlemail-client + google-oauth Prerequisite for all builds: extension-authorization. Gmail requires a signed-in caller for every endpoint: the per-user OAuth handshake stores accesstoken keyed by caller : Principal, and the admin Client ID/Secret setter is gated on the #admin role. Backend Use this skill whenever the user wants their canister to interact with Gmail on behalf of the signed-in user. The ingredients are: 1. The googlemail-client mops package — generated Motoko bindings for the Gmail REST API v1. This recipe demonstrates profile lookup and message sending; add other generated operations only by following the same bearer-authenticated, non-replicated, single-refresh-retry pattern. 2. The google-oauth mops package — Google OAuth 2.0 token exchange, refresh, PKCE, and percent-encoding. This is the library that eliminates hand-rolled httprequest to oauth2.googleapis.com. 3. An OAuth 2.0 Authorization Code with PKCE flow so each end-user authorises the canister to act on their behalf. Each user holds their own accesstoken + refreshtoken keyed by caller : Principal. 4. A Google Cloud Web application Client ID + Client Secret. Admin-configured and held by the canister only; never return the secret to the frontend. 1. Add dependencies 2. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/connector-googlemail