google-spaces-updates

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Spaces Updates

Google Chat Spaces 更新

Status: Production Ready Last Updated: 2026-01-09
Post updates to a team Google Chat Space via webhook.

状态:已就绪可用于生产环境 最后更新时间:2026-01-09
通过webhook向团队的Google Chat Space发布更新。

Quick Start

快速开始

1. Setup (first time per project)

1. 首次设置(每个项目一次)

Run
/google-spaces-updates setup
or manually create
.claude/settings.json
:
json
{
  "project": {
    "name": "my-project",
    "repo": "github.com/org/my-project"
  },
  "team": {
    "chat_webhook": "https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN",
    "members": ["Deepinder", "Joshua", "Raquel"]
  }
}
运行
/google-spaces-updates setup
命令或手动创建
.claude/settings.json
文件:
json
{
  "project": {
    "name": "my-project",
    "repo": "github.com/org/my-project"
  },
  "team": {
    "chat_webhook": "https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN",
    "members": ["Deepinder", "Joshua", "Raquel"]
  }
}

2. Post an update

2. 发布更新

"Post deployment update to team"
"Tell the team about the new feature"
"Ask the team about the auth approach"

"向团队发布部署更新"
"告知团队新功能情况"
"向团队咨询认证方案相关问题"

How It Works

工作原理

Step 1: Check for project settings

步骤1:检查项目配置

Look for
.claude/settings.json
in the current project directory:
bash
cat .claude/settings.json 2>/dev/null || echo "NOT_FOUND"
If NOT_FOUND, ask the user:
"This project doesn't have Google Spaces configured. Would you like me to set it up? I'll need the webhook URL for your team's Google Space."
Then create the file using the template in
templates/settings-template.json
.
在当前项目目录中查找
.claude/settings.json
文件:
bash
cat .claude/settings.json 2>/dev/null || echo "NOT_FOUND"
如果未找到,询问用户:
"该项目尚未配置Google Spaces。是否需要我帮您完成配置?我需要您团队Google Space的webhook URL。"
然后使用
templates/settings-template.json
中的模板创建该文件。

Step 2: Determine update type

步骤2:确定更新类型

Based on the command or context, determine the update type:
TypeWhen to use
deployment
After pushing to production/staging, deploying to Vercel/etc
bugfix
After fixing a bug, especially one reported by team
feature
After completing a feature that's ready for review/use
question
When blocked or need team input on a decision
custom
For anything else
根据命令或上下文确定更新类型:
类型适用场景
deployment
推送至生产/预发布环境后、部署至Vercel等平台后
bugfix
修复bug后,尤其是团队上报的bug
feature
完成可用于评审/使用的功能后
question
遇到阻塞或需要团队提供决策输入时
custom
其他所有场景

Step 3: Gather context

步骤3:收集上下文信息

Collect relevant information to include:
bash
undefined
收集需要包含的相关信息:
bash
undefined

Recent commits (for context)

最近的提交记录(用于上下文)

git log --oneline -3 2>/dev/null
git log --oneline -3 2>/dev/null

Current branch

当前分支

git branch --show-current 2>/dev/null
git branch --show-current 2>/dev/null

Changed files (if recent changes)

变更文件(如果有最近变更)

git diff --name-only HEAD~1 2>/dev/null | head -10

Also use context from the conversation:
- What was just completed
- Any preview/production URLs
- Relevant file paths
- Who might need to know
git diff --name-only HEAD~1 2>/dev/null | head -10

同时利用对话中的上下文信息:
- 刚完成的工作内容
- 任何预览/生产环境URL
- 相关文件路径
- 需要知晓的人员

Step 4: Format the message

步骤4:格式化消息

Use the appropriate template from
templates/
directory.
Key formatting rules for Google Chat:
  • Use
    *bold*
    for emphasis (not markdown bold)
  • Use
    _italic_
    for secondary text
  • Newlines work as expected
  • Keep messages concise but informative
  • Include actionable links when relevant
使用
templates
目录中的对应模板。
Google Chat 关键格式规则
  • 使用
    *粗体*
    表示强调(不要使用Markdown粗体
  • 使用
    _斜体_
    表示次要文本
  • 换行符可正常使用
  • 保持消息简洁但信息完整
  • 相关时包含可点击链接

Step 5: Post to webhook

步骤5:通过webhook发布消息

bash
curl -X POST "WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"text": "MESSAGE_HERE"}'
Replace:
  • WEBHOOK_URL
    with value from
    .claude/settings.json
    team.chat_webhook
  • MESSAGE_HERE
    with the formatted message (escape quotes properly)
bash
curl -X POST "WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"text": "MESSAGE_HERE"}'
替换:
  • WEBHOOK_URL
    .claude/settings.json
    中的
    team.chat_webhook
  • MESSAGE_HERE
    为格式化后的消息(需正确转义引号)

Step 6: Confirm to user

步骤6:向用户确认

After posting, tell the user:
"Posted update to team chat: [brief summary of what was posted]"

发布完成后,告知用户:
"已向团队聊天发布更新:[发布内容的简要摘要]"

Message Templates

消息模板

Deployment

部署模板

🚀 *Deployed: [PROJECT_NAME]*

[WHAT_CHANGED - 1-2 sentences]

• Branch: `[BRANCH]`
• Commit: `[COMMIT_HASH]`
[• Preview: URL (if applicable)]
[• Production: URL (if applicable)]

_Posted by [USER] via Claude Code_
🚀 *已部署:[项目名称]*

[变更内容 - 1-2句话]

• 分支:`[分支名称]`
• 提交记录:`[提交哈希值]`
[• 预览地址:URL(如适用)]
[• 生产地址:URL(如适用)]

_由[用户]通过Claude Code发布_

Bug Fix

Bug修复模板

🐛 *Bug Fixed: [PROJECT_NAME]*

*Problem:* [What was broken]
*Solution:* [How it was fixed]
*Files:* [Key files changed]

[• Commit: `[COMMIT_HASH]`]

_Please verify if you reported this issue._
🐛 *Bug已修复:[项目名称]*

*问题:* [故障内容]
*解决方案:* [修复方式]
*涉及文件:* [修改的关键文件]

[• 提交记录:`[提交哈希值]`]

_如果您曾反馈过此问题,请帮忙验证修复效果。_

Feature Complete

功能完成模板

✨ *Feature Complete: [PROJECT_NAME]*

*[FEATURE_NAME]*

[DESCRIPTION - what it does, 1-2 sentences]

[• Demo: URL]
[• Files: key files]

_Ready for review/testing._
✨ *功能完成:[项目名称]*

*[功能名称]*

[功能描述 - 功能用途,1-2句话]

[• 演示地址:URL]
[• 涉及文件:关键文件]

_已准备好进行评审/测试。_

Question

问题咨询模板

❓ *Question: [PROJECT_NAME]*

[QUESTION - clear and specific]

*Context:*
[Relevant background - what you're working on, what you've tried]

*Options considered:*
1. [Option A]
2. [Option B]

_@[PERSON] - would appreciate your input_
❓ *问题咨询:[项目名称]*

[问题内容 - 清晰明确]

*上下文:*
[相关背景 - 当前正在进行的工作、已尝试的方案]

*已考虑的方案:*
1. [方案A]
2. [方案B]

_@[人员] - 期待您的宝贵意见_

Custom

自定义模板

📢 *Update: [PROJECT_NAME]*

[MESSAGE]

_Posted by [USER] via Claude Code_

📢 *更新通知:[项目名称]*

[消息内容]

_由[用户]通过Claude Code发布_

Setup Command

设置命令

When user runs
/google-spaces-updates setup
:
  1. Ask for the Google Spaces webhook URL
  2. Ask for project name (or detect from package.json/repo)
  3. Ask for team members (optional)
  4. Create
    .claude/settings.json
    using the template
  5. Add
    .claude/
    to
    .gitignore
    if not already there
  6. Confirm setup is complete

当用户运行
/google-spaces-updates setup
命令时:
  1. 询问Google Spaces webhook URL
  2. 询问项目名称(或从package.json/仓库自动检测)
  3. 询问团队成员(可选)
  4. 使用模板创建
    .claude/settings.json
    文件
  5. .gitignore
    中未包含
    .claude/
    ,则添加进去
  6. 确认设置完成

Proactive Suggestions

主动建议

Suggest posting an update when:
  • User says "done", "finished", "completed" after significant work
  • After a
    git push
    to main/master/production
  • User mentions team members by name
  • User seems blocked and might benefit from team input
Ask: "Would you like me to post an update to the team about this?"

在以下场景建议发布更新:
  • 用户在完成重要工作后说"done"、"finished"、"completed"
  • 向main/master/production分支执行
    git push
  • 用户提及团队成员姓名时
  • 用户遇到阻塞,可能需要团队提供输入时
询问:"是否需要我向团队发布关于此事的更新?"

When NOT to Use

不适用场景

  • Minor refactors, typo fixes
  • WIP commits that aren't ready for review
  • Internal debugging/testing
  • Anything that would just be noise

  • 小范围重构、拼写错误修复
  • 尚未准备好评审的进行中提交
  • 内部调试/测试
  • 任何只会产生干扰的内容

Getting a Webhook URL

获取Webhook URL

  1. Open Google Chat
  2. Navigate to your Space
  3. Click Space name → Apps & integrationsWebhooks
  4. Click Add webhook
  5. Name it (e.g., "Claude Code Updates")
  6. Copy the webhook URL
The URL format:
https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN
Security: Keep webhook URLs private. Add
.claude/settings.json
to
.gitignore
.
  1. 打开Google Chat
  2. 进入您的Space
  3. 点击Space名称 → 应用和集成Webhooks
  4. 点击添加webhook
  5. 为其命名(例如:"Claude Code 更新")
  6. 复制webhook URL
URL格式:
https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN
安全提示:请妥善保管webhook URL,不要公开。将
.claude/settings.json
添加到
.gitignore
中。