关于 daily-report
此日報 Skill 汇总 GitHub、Jira 和 Google Calendar 活动,生成草稿,并在用户审核后发布为 GitHub Issue。支持按时间范围查询,并避免在报告中直接放链接以防触发提及通知。
主要功能
- 01按时间范围获取 GitHub 活动
- 02查询 Jira 工作项
- 03从 Slack 日历消息提取会议
- 04生成供审核的报告草稿
- 05发布确认后的 GitHub Issue
适用场景
- 01汇总每日代码与问题活动
- 02在工作报告中加入当天会议
- 03发布前审核和编辑报告
MCP 相关
此 Skill 使用 Slack MCP 相关令牌环境变量,通过 Slack 获取 Google Calendar 会议消息;README 未说明 MCP 服务接口。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ i9wa4/ dotfiles --skill daily-report安装后在 Claude Code 中输入/daily-report确认已加载。
附带文件scripts/get-activities.shscripts/get-team-activities.sh
详细介绍
每日报告技能
汇总 @i9wa4 在 GitHub 和 Jira 上的活动,并发布为 GitHub Issue。
1. 前置条件
- 已安装 gh CLI
- 已安装 jq
- 已安装 acli(用于 Jira)
2. 工作流
2.1. 获取 GitHub 活动
使用专用脚本获取活动。 默认获取从当前时间往前 24 小时的活动 (按 UTC 计算)。
2.1.1. 脚本位置
${CLAUDE_CONFIG_DIR}/skills/daily-report/scripts/get-activities.sh
2.1.2. 命令示例
# Default: 24 hours ago to now (local repos only via ghq list)
${CLAUDE_CONFIG_DIR}/skills/daily-report/scripts/get-activities.sh --no-url
# Specify hours: N hours ago to now
${CLAUDE_CONFIG_DIR}/skills/daily-report/scripts/get-activities.sh --hours 48 --no-url
# Specify datetime directly (ISO8601, UTC)
${CLAUDE_CONFIG_DIR}/skills/daily-report/scripts/get-activities.sh --from 2025-12-16T15:00:00Z --to 2025-12-17T15:00:00Z --no-url
2.1.3. 选项
| 选项 | 描述 |
|---|---|
| --no-url | 不输出 URL(避免触发提及通知) |
| --hours N | 获取从 N 小时前到现在的活动 |
| --from | 开始日期时间(ISO8601,例如,2025-12-17T00:00:00Z) |
| --to | 结束日期时间(ISO8601,例如,2025-12-17T23:59:59Z) |
| --hostname | GitHub Enterprise Server 主机名 |
| --exclude-owner | 按所有者排除仓库(逗号分隔,默认值:i9wa4) |
| --include-personal | 包含个人仓库(覆盖 --exclude-owner) |
2.1.4. 输出格式
### repository-owner/repository-name
- [Issue] Issue title
- [IssueComment] Issue title
- [PullRequest] PR title
- [PullRequestComment] PR title
- [ReviewedPR] PR title (PRs reviewed by me, excludes my own PRs)
注意:使用 --no-url 选项省略 URL,避免触发提及通知。
注意:默认排除个人仓库(i9wa4/*)。
2.2. 获取 Jira 活动
使用 acli 获取 Jira 活动。
# Today's activities
acli jira workitem search \
--jql "updated >= startOfDay() AND (assignee = currentUser() OR reporter = currentUser()) ORDER BY updated DESC" \
--fields "key,summary,status"
# Specific date range
acli jira workitem search \
--jql "updated >= 'YYYY-MM-DD' AND updated < 'YYYY-MM-DD' AND (assignee = currentUser() OR reporter = currentUser()) ORDER BY updated DESC" \
--fields "key,summary,status"
2.3. 从 Google Calendar 获取会议
通过 Slack 私信获取今天的 Google Calendar 会议。
2.3.1. 前置条件
所需的环境变量:
export SLACK_GCAL_DM_URL="https://app.slack.com/client/E.../D..."
export SLACK_MCP_XOXC_TOKEN="xoxc-..."
export SLACK_MCP_XOXD_TOKEN="xoxd-..."
2.3.2. 获取过去 24 小时的消息
# Extract channel ID from URL
CHANNEL=$(echo "$SLACK_GCAL_DM_URL" | sed -n 's|.*/client/[^/]*/\([^/]*\).*|\1|p')
# Fetch messages
FILE=$(mkoutput --dir tmp --label output)
curl -s -X POST "https://slack.com/api/conversations.history" \
-H "Authorization: Bearer $SLACK_MCP_XOXC_TOKEN" \
-H "Cookie: d=$SLACK_MCP_XOXD_TOKEN" \
-d "channel=${CHANNEL}" \
-d "limit=200" > "$FILE"
# Filter messages from last 24 hours
NOW=$(date +%s)
YESTERDAY=$((NOW - 86400))
jq -r --argjson yesterday "$YESTERDAY" \
'.messages[] | select(.ts | tonumber > $yesterday)' "$FILE"
2.3.3. 提取今天的日程
在过去 24 小时的消息中查找“Today”摘要消息。 此消息在 attachments 数组中包含当天的所有会议。
关键标识:
- 消息文本以
*Today*-<!date^...开头 - attachments 中包含会议信息和 Unix 时间戳
2.3.4. 从时间戳解析会议时间
会议使用 Unix 时间戳格式:<!date^UNIX_TIMESTAMP^{time}|...>
将时间戳转换为本地时间:
date -r UNIX_TIMESTAMP "+%H:%M"
2.3.5. 输出格式
从 attachments 中提取:
- 会议标题:从链接文本中提取(例如,
|Meeting Name>*) - 开始/结束时间:将 Unix 时间戳转换为 HH:MM 格式
- 跳过已取消的会议(在单独的消息中以删除线标示)
格式为:- Meeting name (HH:MM-HH:MM)
2.4. 创建草稿
创建文件:
FILE=$(mkoutput --dir tmp --label "daily-$(whoami)")
注意:在“Today's AI Activities”部分保留命令块。 执行命令,并将结果粘贴到命令块下方。
模板:
---
title: "YYYY-MM-DD $(whoami)"
labels:
- name: "日報"
color: "0887b9"
---
## 1. Reflection
## 2. Today's Activities
### 2.1. GitHub
Organize gh-furik output. Classify as follows:
#### 2.1.1. Created Issues
- [repo-name] Issue title
#### 2.1.2. Created PRs
- [repo-name] PR title
- [repo-name] PR title (merged)
- Add supplementary comments indented
#### 2.1.3. Reviewed PRs
- [repo-name] PR title
#### 2.1.4. Commented Issues/PRs
- [repo-name] Issue/PR title
### 2.2. Jira
- [KEY-123] Issue summary (status)
### 2.3. Meetings
- Meeting name
- Supplementary comments
2.5. 等待用户编辑
显示草稿并等待用户编辑。用户会补充自己的感想。
2.6. 发布 Issue
使用 gh issue create 发布:
gh issue create --title "YYYY-MM-DD $(whoami)" --label "日報" --body "$(cat <<'EOF'
[body]
EOF
)"
发布后显示 Issue URL。
3. 重要规则
- 不要使用直接链接:不要直接链接 PR/Issue(会触发提及), 只使用标题
- PR/Issue 编号:使用带空格的
(# 123),不要使用(#123)。 不带空格时,GitHub 会自动链接到意外的仓库。 - 草稿审阅:始终向用户展示草稿并等待编辑
- 发布 Issue:用户确认草稿已准备就绪后再发布
4. 输出类型分类
按以下方式对脚本输出进行分类:
| 输出类型 | 分类 |
|---|---|
| Issue | 已创建的 Issue |
| PullRequest | 已创建的 PR |
| ReviewedPR | 已审阅的 PR |
| IssueComment | 已评论的 Issue/PR |
| PullRequestComment | 已评论的 Issue/PR |
注意:将对同一 Issue/PR 的多条评论合并为一条。 注意:ReviewedPR 仅包含由他人创建的 PR(不包括我自己的 PR)。