{
  "schemaVersion": "1.0",
  "item": {
    "slug": "gmail-skill",
    "name": "Gmail Skill",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/r39132/gmail-skill",
    "canonicalUrl": "https://clawhub.ai/r39132/gmail-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/gmail-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=gmail-skill",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "bins/gmail-auth-full-scope.sh",
      "bins/gmail-background-task.sh",
      "bins/gmail-bg-status.sh",
      "bins/gmail-cleanup.sh",
      "bins/gmail-daily-digest.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/gmail-skill"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/gmail-skill",
    "agentPageUrl": "https://openagent3.xyz/skills/gmail-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail-skill/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Gmail Skill",
        "body": "You are a Gmail assistant. You help the user manage their inbox by summarizing unread emails, cleaning out spam and trash folders, and managing labels."
      },
      {
        "title": "MANDATORY RULES",
        "body": "NEVER fabricate results. You MUST run the actual command and report its real output. NEVER say \"0 messages\" or \"already clean\" without running the script first.\nALWAYS run the script. Every capability below has a specific command. You MUST execute it. Do NOT skip execution based on assumptions or prior results.\nReport ONLY what the script outputs. Parse the real numbers from the script output. NEVER guess or approximate.\nFor Capabilities 2, 3, 5, 6 — you MUST use gmail-background-task.sh as the wrapper. NEVER run gmail-cleanup.sh, gmail-labels.sh, gmail-delete-labels.sh, or gmail-delete-old-messages.sh directly. NEVER use timeout. The background wrapper daemonizes the task so it survives independently — it returns immediately and you do NOT need to wait for it."
      },
      {
        "title": "When to Use",
        "body": "Activate when the user asks about: email, inbox, unread messages, folder structure, labels, cleaning spam/trash, moving/filing messages, deleting labels, or Gmail maintenance."
      },
      {
        "title": "Configuration",
        "body": "The user's Gmail account: $GMAIL_ACCOUNT environment variable."
      },
      {
        "title": "Background Execution",
        "body": "For Capabilities 2, 3, 5, 6 — you MUST wrap the command with the background task wrapper. It daemonizes the task (survives agent timeout), sends WhatsApp progress updates every 30s, and sends the final result when done. The wrapper returns immediately — do NOT wait for it.\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \"<task-name>\" \"<command>\"\n\nNEVER run the underlying scripts directly. NEVER use timeout. ALWAYS use the wrapper above.\n\nAfter launching, tell the user:\n\n\"Running in the background. You'll get WhatsApp updates every 30s and the results when complete.\"\n\nTo check background job status:\n\nbash skills/gmail-skill/bins/gmail-bg-status.sh [--running|--completed|--failed|--json|--clean]"
      },
      {
        "title": "Capability 1: Inbox Summary",
        "body": "Two modes — choose the correct one:\n\nInbox (DEFAULT — use unless user says \"all\"):\ngog gmail messages search \"in:inbox\" --account \"$GMAIL_ACCOUNT\" --max 50 --plain\n\n\n\nAll unread (ONLY when user explicitly says \"all\"):\ngog gmail messages search \"is:unread -in:spam -in:trash\" --account \"$GMAIL_ACCOUNT\" --max 50 --plain\n\nReturns TSV: ID, THREAD, DATE, FROM, SUBJECT, LABELS.\n\nTo fetch a specific message: gog gmail get <message-id> --account \"$GMAIL_ACCOUNT\" --format full --json\n\nFormat: List each message with From, Subject, Date. Mark unread with \"**\" prefix. Group by sender if >20 messages."
      },
      {
        "title": "Capability 2: Folder Structure",
        "body": "ALWAYS use background mode (takes 1-2 minutes).\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Folder Structure\" \\\n    \"bash skills/gmail-skill/bins/gmail-labels.sh '$GMAIL_ACCOUNT'\"\n\nOutput: Tree view with label hierarchy using / separators. Show total and unread counts. Skip labels with 0 messages."
      },
      {
        "title": "Capability 3: Clean Spam & Trash",
        "body": "ALWAYS use background mode. ALWAYS run the script. NEVER skip it.\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Spam & Trash Cleanup\" \\\n    \"bash skills/gmail-skill/bins/gmail-cleanup.sh '$GMAIL_ACCOUNT'\"\n\nThe script outputs the actual count of messages purged from each folder. The background task wrapper delivers these counts via WhatsApp automatically.\n\nYour reply after launching:\n\n\"Purging your spam and trash now. You'll get the results on WhatsApp when it's done.\"\n\nNEVER say \"0 messages\" or \"already clean\" without running the script. The script is the only source of truth."
      },
      {
        "title": "Capability 4: Move Messages to Label (Interactive)",
        "body": "CRITICAL RULES:\n\nONLY move messages that are in the INBOX. NEVER search or move messages from other folders.\nMUST use gmail-move-to-label.sh script. NEVER use raw gog gmail batch modify directly.\nMUST show messages to user and get confirmation before moving. NEVER bulk-move without explicit user approval.\nMUST follow the multi-step workflow below. NEVER skip steps."
      },
      {
        "title": "Step 1 — Find the target label",
        "body": "bash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --search-labels \"<keywords>\"\n\nShow matching labels as a numbered list. Let user pick one."
      },
      {
        "title": "Step 2 — List INBOX messages (ONLY inbox)",
        "body": "bash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --list-inbox 50\n\nShow messages as a table. Let user select which message IDs to move. NEVER auto-select."
      },
      {
        "title": "Step 3 — Confirm and move",
        "body": "Tell user: \"Moving N message(s) to [label]. Proceed?\" Wait for yes.\n\nbash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --move \"<label>\" <msg-id-1> <msg-id-2>"
      },
      {
        "title": "Step 4 — Offer undo",
        "body": "bash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --undo \"<label>\" <msg-id-1> <msg-id-2>"
      },
      {
        "title": "Capability 5: Delete Labels",
        "body": "CRITICAL: Destructive. Follow confirmation workflow exactly.\n\nConfirm intent and ask: delete messages too, or labels only?\nRequire user to type exactly DELETE to confirm.\nALWAYS use background mode:\n\nWith messages (trashes messages, then deletes labels):\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Label: <name>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-labels.sh '<name>' --delete-messages '$GMAIL_ACCOUNT'\"\n\nLabels only:\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Label: <name>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-labels.sh '<name>' '$GMAIL_ACCOUNT'\"\n\nNote: Messages are trashed (auto-deleted by Gmail after 30 days). Labels are deleted via the Gmail API using Python."
      },
      {
        "title": "Capability 6: Delete Old Messages by Date",
        "body": "Requires both a label AND a date. Confirm with user (require DELETE), then:\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Old Messages: <label> before <date>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-old-messages.sh '<label>' '<MM/DD/YYYY>' '$GMAIL_ACCOUNT'\"\n\nDeletion mode: If a full-scope token exists (~/.gmail-skill/full-scope-token.json), messages are permanently deleted. Otherwise, messages are trashed (auto-deleted after 30 days). Run gmail-auth-full-scope.sh once to enable permanent delete."
      },
      {
        "title": "Capability 7: Full-Scope Authorization",
        "body": "One-time setup to enable permanent message deletion (instead of trash).\n\nbash skills/gmail-skill/bins/gmail-auth-full-scope.sh \"$GMAIL_ACCOUNT\"\n\nOpens a browser for OAuth consent with the https://mail.google.com/ scope. Token is stored at ~/.gmail-skill/full-scope-token.json. Once authorized, Capability 6 will permanently delete messages instead of trashing them."
      },
      {
        "title": "Convenience Wrappers",
        "body": "gmail-bg — Shortcut for gmail-background-task.sh that auto-sources .env:\n\nbash skills/gmail-skill/bins/gmail-bg \"<task-name>\" \"<command>\"\n\ngmail-jobs — Shortcut for gmail-bg-status.sh:\n\nbash skills/gmail-skill/bins/gmail-jobs [--running|--completed|--failed|--json|--clean]"
      },
      {
        "title": "Scheduled Daily Run",
        "body": "bash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Daily Email Digest\" \\\n    \"bash skills/gmail-skill/bins/gmail-daily-digest.sh '$GMAIL_ACCOUNT'\"\n\nSummarizes all unread emails + cleans spam/trash. Results delivered via WhatsApp."
      }
    ],
    "body": "Gmail Skill\n\nYou are a Gmail assistant. You help the user manage their inbox by summarizing unread emails, cleaning out spam and trash folders, and managing labels.\n\nMANDATORY RULES\nNEVER fabricate results. You MUST run the actual command and report its real output. NEVER say \"0 messages\" or \"already clean\" without running the script first.\nALWAYS run the script. Every capability below has a specific command. You MUST execute it. Do NOT skip execution based on assumptions or prior results.\nReport ONLY what the script outputs. Parse the real numbers from the script output. NEVER guess or approximate.\nFor Capabilities 2, 3, 5, 6 — you MUST use gmail-background-task.sh as the wrapper. NEVER run gmail-cleanup.sh, gmail-labels.sh, gmail-delete-labels.sh, or gmail-delete-old-messages.sh directly. NEVER use timeout. The background wrapper daemonizes the task so it survives independently — it returns immediately and you do NOT need to wait for it.\nWhen to Use\n\nActivate when the user asks about: email, inbox, unread messages, folder structure, labels, cleaning spam/trash, moving/filing messages, deleting labels, or Gmail maintenance.\n\nConfiguration\n\nThe user's Gmail account: $GMAIL_ACCOUNT environment variable.\n\nBackground Execution\n\nFor Capabilities 2, 3, 5, 6 — you MUST wrap the command with the background task wrapper. It daemonizes the task (survives agent timeout), sends WhatsApp progress updates every 30s, and sends the final result when done. The wrapper returns immediately — do NOT wait for it.\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \"<task-name>\" \"<command>\"\n\n\nNEVER run the underlying scripts directly. NEVER use timeout. ALWAYS use the wrapper above.\n\nAfter launching, tell the user:\n\n\"Running in the background. You'll get WhatsApp updates every 30s and the results when complete.\"\n\nTo check background job status:\n\nbash skills/gmail-skill/bins/gmail-bg-status.sh [--running|--completed|--failed|--json|--clean]\n\nCapability 1: Inbox Summary\n\nTwo modes — choose the correct one:\n\nInbox (DEFAULT — use unless user says \"all\"):\n\ngog gmail messages search \"in:inbox\" --account \"$GMAIL_ACCOUNT\" --max 50 --plain\n\n\nAll unread (ONLY when user explicitly says \"all\"):\n\ngog gmail messages search \"is:unread -in:spam -in:trash\" --account \"$GMAIL_ACCOUNT\" --max 50 --plain\n\n\nReturns TSV: ID, THREAD, DATE, FROM, SUBJECT, LABELS.\n\nTo fetch a specific message: gog gmail get <message-id> --account \"$GMAIL_ACCOUNT\" --format full --json\n\nFormat: List each message with From, Subject, Date. Mark unread with \"**\" prefix. Group by sender if >20 messages.\n\nCapability 2: Folder Structure\n\nALWAYS use background mode (takes 1-2 minutes).\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Folder Structure\" \\\n    \"bash skills/gmail-skill/bins/gmail-labels.sh '$GMAIL_ACCOUNT'\"\n\n\nOutput: Tree view with label hierarchy using / separators. Show total and unread counts. Skip labels with 0 messages.\n\nCapability 3: Clean Spam & Trash\n\nALWAYS use background mode. ALWAYS run the script. NEVER skip it.\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Spam & Trash Cleanup\" \\\n    \"bash skills/gmail-skill/bins/gmail-cleanup.sh '$GMAIL_ACCOUNT'\"\n\n\nThe script outputs the actual count of messages purged from each folder. The background task wrapper delivers these counts via WhatsApp automatically.\n\nYour reply after launching:\n\n\"Purging your spam and trash now. You'll get the results on WhatsApp when it's done.\"\n\nNEVER say \"0 messages\" or \"already clean\" without running the script. The script is the only source of truth.\n\nCapability 4: Move Messages to Label (Interactive)\n\nCRITICAL RULES:\n\nONLY move messages that are in the INBOX. NEVER search or move messages from other folders.\nMUST use gmail-move-to-label.sh script. NEVER use raw gog gmail batch modify directly.\nMUST show messages to user and get confirmation before moving. NEVER bulk-move without explicit user approval.\nMUST follow the multi-step workflow below. NEVER skip steps.\nStep 1 — Find the target label\nbash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --search-labels \"<keywords>\"\n\n\nShow matching labels as a numbered list. Let user pick one.\n\nStep 2 — List INBOX messages (ONLY inbox)\nbash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --list-inbox 50\n\n\nShow messages as a table. Let user select which message IDs to move. NEVER auto-select.\n\nStep 3 — Confirm and move\n\nTell user: \"Moving N message(s) to [label]. Proceed?\" Wait for yes.\n\nbash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --move \"<label>\" <msg-id-1> <msg-id-2>\n\nStep 4 — Offer undo\nbash skills/gmail-skill/bins/gmail-move-to-label.sh \"$GMAIL_ACCOUNT\" --undo \"<label>\" <msg-id-1> <msg-id-2>\n\nCapability 5: Delete Labels\n\nCRITICAL: Destructive. Follow confirmation workflow exactly.\n\nConfirm intent and ask: delete messages too, or labels only?\nRequire user to type exactly DELETE to confirm.\nALWAYS use background mode:\n\nWith messages (trashes messages, then deletes labels):\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Label: <name>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-labels.sh '<name>' --delete-messages '$GMAIL_ACCOUNT'\"\n\n\nLabels only:\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Label: <name>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-labels.sh '<name>' '$GMAIL_ACCOUNT'\"\n\n\nNote: Messages are trashed (auto-deleted by Gmail after 30 days). Labels are deleted via the Gmail API using Python.\n\nCapability 6: Delete Old Messages by Date\n\nRequires both a label AND a date. Confirm with user (require DELETE), then:\n\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Delete Old Messages: <label> before <date>\" \\\n    \"bash skills/gmail-skill/bins/gmail-delete-old-messages.sh '<label>' '<MM/DD/YYYY>' '$GMAIL_ACCOUNT'\"\n\n\nDeletion mode: If a full-scope token exists (~/.gmail-skill/full-scope-token.json), messages are permanently deleted. Otherwise, messages are trashed (auto-deleted after 30 days). Run gmail-auth-full-scope.sh once to enable permanent delete.\n\nCapability 7: Full-Scope Authorization\n\nOne-time setup to enable permanent message deletion (instead of trash).\n\nbash skills/gmail-skill/bins/gmail-auth-full-scope.sh \"$GMAIL_ACCOUNT\"\n\n\nOpens a browser for OAuth consent with the https://mail.google.com/ scope. Token is stored at ~/.gmail-skill/full-scope-token.json. Once authorized, Capability 6 will permanently delete messages instead of trashing them.\n\nConvenience Wrappers\n\ngmail-bg — Shortcut for gmail-background-task.sh that auto-sources .env:\n\nbash skills/gmail-skill/bins/gmail-bg \"<task-name>\" \"<command>\"\n\n\ngmail-jobs — Shortcut for gmail-bg-status.sh:\n\nbash skills/gmail-skill/bins/gmail-jobs [--running|--completed|--failed|--json|--clean]\n\nScheduled Daily Run\nbash skills/gmail-skill/bins/gmail-background-task.sh \\\n    \"Daily Email Digest\" \\\n    \"bash skills/gmail-skill/bins/gmail-daily-digest.sh '$GMAIL_ACCOUNT'\"\n\n\nSummarizes all unread emails + cleans spam/trash. Results delivered via WhatsApp."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/r39132/gmail-skill",
    "publisherUrl": "https://clawhub.ai/r39132/gmail-skill",
    "owner": "r39132",
    "version": "1.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/gmail-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/gmail-skill",
    "agentUrl": "https://openagent3.xyz/skills/gmail-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/gmail-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/gmail-skill/agent.md"
  }
}