介绍
# Meeting Prep
面向开发团队的自动化会议准备和每日提交摘要。
## 功能
1. **会议准备** — 检查 Google Calendar 中即将召开的包含视频链接的会议,通知用户,并基于提交内容生成更新 2. **每日摘要** — 汇总所有开发人员当天的所有提交
## 设置要求
### Google Calendar OAuth
在 Google Cloud Console 中创建 OAuth 凭据:
1. 启用 Google Calendar API 2. 创建 OAuth 2.0 Desktop 凭据 3. 将 `client_secret.json` 存储在 `credentials/` 中 4. 授权范围:`https://www.googleapis.com/auth/calendar` 5. 将令牌存储在 `credentials/calendar_tokens.json`
对于多个账户,请为每个账户存储单独的令牌文件。
### GitHub Token
创建一个具有 `repo` 权限的 Classic Personal Access Token。存储在 `credentials/github_token`。
## 工作流
### 会议准备检查
触发器:每 15 分钟的 Cron 或心跳检测。
1. 查询配置的日历,获取接下来 45 分钟内的事件 2. 筛选包含 Google Meet 链接的事件(`hangoutLink` 或 `conferenceData`) 3. 如果会议在 30-45 分钟后开始且尚未通知: - 询问用户:“会议 [标题] 将在 X 分钟后开始。您上一次更新是什么时候?我应该检查哪些仓库?” - 在状态文件中跟踪,以避免重复 4. 如果会议在 10-20 分钟后开始: - 根据提交内容生成更新 - 发送格式化的更新
### 每日提交摘要
触发器:每日结束时的 Cron。
1. 获取配置的仓库中当天的所有提交 2. 包含所有开发人员 3. 按仓库和子目录分组 4. 包含作者姓名并进行格式化 5. 发送摘要
## API 参考
### 检查日历
```bash NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ) LATER=$(date -u -d "+45 minutes" +%Y-%m-%dT%H:%M:%SZ) TOKEN=$(jq -r '.access_token' credentials/calendar_tokens.json)
curl -s "https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=$NOW&timeMax=$LATER&singleEvents=true" \ -H "Authorization: Bearer $TOKEN" | \ jq '[.items[] | select(.hangoutLink != null or .conferenceData != null)]'
Refresh Token
CLIENT_ID=$(jq -r '.installed.client_id' credentials/client_secret.json) CLIENT_SECRET=$(jq -r '.installed.client_secret' credentials/client_secret.json) REFRESH_TOKEN=$(jq -r '.refresh_token' credentials/calendar_tokens.json)
curl -s -X POST https://oauth2.googleapis.com/token \ -d "client_id=$CLIENT_ID" \ -d "client_secret=$CLIENT_SECRET" \ -d "refresh_token=$REFRESH_TOKEN" \ -d "grant_type=refresh_token"
Fetch Commits
TOKEN=$(cat credentials/github_token) SINCE=$(date -u -d "-7 days" +%Y-%m-%dT%H:%M:%SZ)
# List org repos curl -s -H "Authorization: Bearer $TOKEN" \ "https://api.github.com/orgs/ORG_NAME/repos?per_page=50&sort=pushed"
# Get commits curl -s -H "Authorization: Bearer $TOKEN" \ "https://api.github.com/repos/ORG/REPO/commits?since=$SINCE&per_page=30"
Output Format
Plain text, no markdown, no emojis:
Update - [DATE]
[repo-name]
[subdirectory] • Verbose description of change (Author) • Another change (Author)
Today • [user input]
Blockers • None
Discussion • None
Formatting Rules
• Group by repo, then subdirectory • Summarize commits into meaningful descriptions • Include author names • Plain text only for easy copy-paste State Management
Track state in data/meeting-prep-state.json:
{ "notified": {}, "config": { "repoFilter": "org-name/*" } } ```