SKILL.md--- name: google-chat-messages description: "Send Google Chat messages via incoming webhooks — text, rich cards (cardsV2), threaded replies. TypeScript types, card builder utility, widget reference inline. Use whenever the user wants to post to Google Chat from a script, build a chatbot reply, send a notification card, build a Google Chat webhook integration, or troubleshoot card / threading issues." compatibility: claude-code-only --- # Google Chat Messages Send messages to Google Chat spaces via incoming webhooks. Produces text messages, rich cards (cardsV2), and threaded replies. ## What You Produce - Text messages with Google Chat formatting - Rich card messages (cardsV2) with headers, sections, widgets - Threaded conversations - Reusable webhook sender utility ## Workflow ### Step 1: Get Webhook URL In Google Chat: 1. Open a Space > click space name > **Manage webhooks** 2. Create webhook (name it, optionally add avatar URL) 3. Copy the webhook URL Store the URL as an environment variable or in your secrets manager — never hardcode. ### Step 2: Choose Message Type | Need | Type | Complexity | |------|------|------------| | Simple notification | Text message | Low | | Structured info (status, digest) | Card message (cardsV2) | Medium | | Ongoing updates | Threaded replies | Medium | | Action buttons (open URL) | Card with buttonList | Medium | ### Step 3: Send the Message Use `assets/webhook-sender.ts` for the sender utility. Use `assets/card-builder.ts` for structured card construction. ## Text Formatting Google Chat does NOT use standard Markdown. | Format | Syntax | Example | |--------|--------|---------| | Bold | `*text*` | `*important*` | | Italic | `_text_` | `_emphasis_` | | Strikethrough | `~text~` | `~removed~` | | Monospace | `` `text` `` | `` `code` `` | | Code block | ` ```text``` ` | Multi-line code | | Link | `<url\|text>` | `<https://example.com\|Click here>` | | Mention user | `<users/USER_ID>` | `<users/123456>` | | Mention all | `<users/all>` | `<users/all>` | **Not supported**: `**double asterisks**`, headings (`###`), blockquotes, tables, images inline. ### Text Message Example ```typescript await sendText(webhookUrl, '*Build Complete*\n\nBranch: `main`\nStatus: Passed\n<https://ci.example.com/123|View Build>'); ``` ## cardsV2 Structure Cards use the cardsV2 format (recommended over legacy cards). ```typescript const message = { cardsV2: [{ cardId: 'unique-id', card: { header: { title: 'Card Title', subtitle: 'Optional subtitle', imageUrl: 'https://example.com/icon.png', imageType: 'CIRCLE' // or 'SQUARE' }, sections: [{ header: 'Section Title', // optional widgets: [ // widgets go here ] }] } }] }; ``` ## Widget Reference All widget types available in cardsV2 sections. ### textParagraph Formatted text block. Supports Google Chat formatting (`*bold*`, `_italic_`, `<url|text>`). ```typescript { textParagraph: { text: '*Status