jezweb/claude-skills / plugins/integrations/skills/google-chat-messages
google-chat-messages
VerifiedSend 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.6 KB |
| assets/card-builder.ts | script | 1.5 KB |
| assets/types.ts | script | 1.5 KB |
| assets/webhook-sender.ts | script | 1.8 KB |
assets/webhook-sender.ts
View on GitHubimport type { WebhookMessage } from './types';
interface SendOptions {
/** Thread key for threading messages together */
threadKey?: string;
/** If true, replies to existing thread or falls back to new thread */
replyToThread?: boolean;
}
/**
* Send a message to Google Chat via incoming webhook.
*
* @param webhookUrl - The webhook URL from Google Chat space settings
* @param message - WebhookMessage (use buildCard or buildText to create)
* @param options - Threading options
*
* @example
* // Simple text
* await sendWebhook(url, { text: '*Hello* from webhook' });
*
* // Card message
* const card = buildCard({ cardId: 'test', title: 'Test', sections: [...] });
* await sendWebhook(url, card);
*
* // Threaded reply
* await sendWebhook(url, card, { threadKey: 'deploy-123', replyToThread: true });
*/
export async function sendWebhook(
webhookUrl: string,
message: WebhookMessage,
options?: SendOptions
): Promise<void> {
let url = webhookUrl;
// Add threading parameters to URL
if (options?.replyToThread && options?.threadKey) {
const separator = url.includes('?') ? '&' : '?';
url += `${separator}messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD`;
}
// Add thread key to message body
if (options?.threadKey) {
message.thread = { threadKey: options.threadKey };
}
const response = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(message),
});
if (!response.ok) {
const body = await response.text();
throw new Error(
`Google Chat webhook error ${response.status}: ${body}`
);
}
}
/**
* Convenience: send a text message.
*/
export async function sendText(
webhookUrl: string,
text: string,
options?: SendOptions
): Promise<void> {
await sendWebhook(webhookUrl, { text }, options);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |