← 返回 Skills 市场
zhcolin0313

gitea-routine-report

作者 Colin · GitHub ↗ · v1.2.2 · MIT-0
cross-platform ⚠ suspicious
121
总下载
1
收藏
0
当前安装
7
版本数
在 OpenClaw 中安装
/install gitea-routine-report
功能描述
获取 Gitea 各仓库提交记录,调用 AI 生成进度报告,并发送 HTML 邮件给仓库管理员
使用说明 (SKILL.md)

Gitea Routine Report

功能描述

对每个 Gitea 可见仓库分别生成一份 HTML 格式进度报告,内容包括:

  • 情况总览(统计周期、提交次数、参与成员)
  • AI 综合评估(现状评估 + 下一步建议)
  • 成员贡献排行
  • 每位成员的工作摘要、文件类型分布、详细提交记录
  • 本期无提交成员名单(含连续未提交天数和最后提交日期)
  • 风险提示

每个仓库单独发送一封 HTML 邮件给该仓库的管理员。

使用场景

  • 当用户说"帮我生成进度报告"且未给出仓库与时间时触发(默认:全部可见仓库 + 最近 7 天)
  • 当用户说"帮我生成某个仓库的进度报告"并给出 owner/repo 时触发单仓库模式(默认:最近 7 天)
  • 当用户明确给出 since + until(或等价的起止日期)时触发绝对时间段模式(仓库可指定或不指定)
  • 当用户说"最近 N 小时 / 最近一天 / 最近三天"时触发相对时间语义解析,并先换算为绝对时间段后执行
  • 当用户需要按固定节奏推送团队进展(日报/周报)或临时排查某时间段风险时触发

使用方法

# 默认:全部可见仓库 + 最近7天
python scripts/generate_report.py

# 指定仓库 + 绝对时间段(UTC+8,北京时间)
python scripts/generate_report.py --repo mayidan/project-test --since 2026-04-01 --until 2026-04-07

# 只指定仓库、不指定时间时,默认最近7天
python scripts/generate_report.py --repo mayidan/project-test

# 全部可见仓库 + 绝对时间段(UTC+8,北京时间)
python scripts/generate_report.py --since 2026-04-01T00:00:00 --until 2026-04-07T23:59:59

# 用户说"最近 N 小时"时,内部先换算为绝对时间段后执行
# 例如:最近8小时 => until=当前时刻,since=当前时刻-8小时

执行流程

重要:必须严格按照以下四个步骤顺序执行,不得跳过任何步骤。


第一步:运行脚本获取数据(必须执行)

无论何时触发此 skill,必须首先根据用户输入选择以下命令之一获取最新数据,不得使用记忆中的历史数据:

  • 用户给出绝对时间段(since + until)且明确指定仓库时:
python scripts/generate_report.py --repo owner/repo --since 2026-04-01 --until 2026-04-07
  • 用户给出绝对时间段(since + until)但未指定仓库时:
python scripts/generate_report.py --since 2026-04-01T00:00:00 --until 2026-04-07T23:59:59
  • 用户只指定仓库(未给出绝对时间段)时:
python scripts/generate_report.py --repo owner/repo
  • 用户既未指定仓库,也未给出绝对时间段时(默认最近 7 天):
python scripts/generate_report.py

时间参数规则:

  • 统一使用绝对时间段:脚本参数为 --since--until
  • 当用户说"最近 N 小时"时,按当前时刻换算:until = nowsince = now - N 小时,再调用脚本。
  • 未提供时间参数时,默认统计最近 7 天(即 since = now - 168huntil = now)。
  • 日期格式支持:YYYY-MM-DDYYYY-MM-DDTHH:MM:SS(按 UTC+8/北京时间解释)。

第二步:从脚本输出中读取数据

脚本输出是一个 JSON 数组,每个元素包含:

  • repo:仓库名称
  • admin_email:仓库创建者邮箱
  • has_commits:本期是否有提交记录
  • time_range:统计周期简述
  • time_range_detail:统计周期详细时间范围
  • generated_at:生成时间
  • overview:总览数据(total_commits, total_members, total_deletions)
  • members:各成员数据(含 commit_details, file_type_summary, branches)
  • inactive_members:本期无提交成员列表(含 name, last_commit_date, inactive_days)
  • vague_commits:模糊提交列表

第三步:对每个仓库,用 AI 生成纯文字内容(must output JSON only)

此步骤 AI 只负责生成文字内容,不得输出任何 HTML。

对 JSON 数组中 has_commits 为 true 的每一个仓库,根据该仓库的数据,生成如下结构的 JSON:

{
  "ai_overview": "根据提交内容和成员活跃度,用2-3句话评估本期项目整体进展和主要推进了哪些工作",
  "ai_suggestion": "根据现状和风险,给项目负责人1-2条具体可执行的建议,帮助推进后续工作",
  "member_summaries": {
    "成员名1": "根据该成员所有 commit message 提炼的一句话工作总结",
    "成员名2": "根据该成员所有 commit message 提炼的一句话工作总结"
  },
  "risk_notes": "风险提示内容,多条风险用换行分隔,每条以⚠️或ℹ️开头;若无风险则填空字符串"
}

输出要求(严格遵守):

  • 只输出上述 JSON,不得在 JSON 前后添加任何说明文字、代码块标记(```)或 HTML
  • member_summaries 中的键名必须与数据中的成员用户名完全一致
  • risk_notes 示例(多条换行):
    ⚠️ ZhangYiwen 已连续 6 天未提交,上次提交日期:2026-04-04
    ⚠️ 发现 1 条模糊提交,建议规范提交信息
    
  • risk_notes 若本期无风险,填入空字符串 ""

第四步:调用脚本将数据 + AI 文字内容拼装为 HTML,并发邮件

❌ 禁止由 AI 直接拼写 HTML 正文,HTML 必须全部由脚本生成。

对每个仓库分别执行:

情况一:has_commits 为 false(本期无提交)

运行以下命令生成 HTML:

python -c "
import json, sys, os
sys.path.insert(0, 'scripts')
from render_email import render
data = json.loads(open('/tmp/report_data.json').read())
# 找到对应仓库
repo_data = next(d for d in data if d['repo'] == 'REPO_NAME')
html = render(repo_data)
open('/tmp/email_body.html', 'w').write(html)
print('HTML 已生成,长度:', len(html))
"

然后调用 imap-smtp-email skill 发送邮件:

  • 收件人:admin_email(除非用户指定了其他收件人)
  • 邮件主题:【项目进度报告】{repo} · {time_range}(time_range 取数据中的 time_range 字段,如"过去 7 天")
  • 邮件格式:HTML
  • 邮件正文:读取 /tmp/email_body.html 的内容

情况二:has_commits 为 true(本期有提交)

首先将第三步输出的 AI JSON 保存到 /tmp/ai_content_{repo_safe}.json(repo_safe 为仓库名中 / 替换为 _),然后运行:

python -c "
import json, sys, os
sys.path.insert(0, 'scripts')
from render_email import render
data = json.loads(open('/tmp/report_data.json').read())
ai_content = json.loads(open('/tmp/ai_content_REPO_SAFE.json').read())
repo_data = next(d for d in data if d['repo'] == 'REPO_NAME')
html = render(repo_data, ai_content)
open('/tmp/email_body.html', 'w').write(html)
print('HTML 已生成,长度:', len(html))
"

然后调用 imap-smtp-email skill 发送邮件:

  • 收件人:默认使用 admin_email,用户指定了收件人则以用户指定为准
  • 邮件主题:【项目进度报告】{repo} · {time_range}(time_range 取数据中的 time_range 字段)
  • 邮件格式:HTML
  • 邮件正文:读取 /tmp/email_body.html 的内容

依赖 skill

  • imap-smtp-email:发送邮件,请确保该 skill 已安装并配置好 SMTP 信息
安全使用建议
Key things to check before installing or enabling this skill: - Fix the metadata mismatch: the registry summary claims no env vars but the code and skill.yaml require GITEA_URL and GITEA_TOKEN. Do not provide a token until you confirm this. - Use a least-privilege Gitea token (read-only access limited to necessary repos) because the scripts will enumerate "all visible repos" and read commits and user info (including owner emails). - Inspect and, if desired, run the included setup.sh in a sandbox or CI runner first; it creates ~/.config/gitea-routine-report/.env by copying env-example.txt—ensure you edit that .env to safe values and store credentials securely. - The skill relies on a separate imap-smtp-email skill to send mail. Confirm that skill's configuration and who will receive the reports before enabling automatic sends. - Consider running the scripts with a non-privileged test token against a test Gitea instance to verify behavior (what repos/users are enumerated, what emails are looked up). - If you need higher assurance, ask the publisher to correct registry metadata and provide a short security note describing the required token scope and where data is stored/transmitted.
功能分析
Type: OpenClaw Skill Name: gitea-routine-report Version: 1.2.2 The skill automates Gitea report generation by aggregating commit data and using an AI agent to produce summaries. It exhibits high-risk patterns, notably the use of `execSync` in `main.js` and instructions in `SKILL.md` that direct the AI agent to construct and execute Python code via `python -c`. These patterns create a significant attack surface for command or Python injection if repository names or commit messages are maliciously crafted. While the implementation is functionally risky and relies on the agent to manage temporary files (e.g., `/tmp/report_data.json`), the behavior aligns with the stated purpose and lacks clear evidence of intentional malice or data exfiltration.
能力标签
requires-oauth-token
能力评估
Purpose & Capability
The skill's stated purpose (collect commits from Gitea and email reports) matches the code: scripts repeatedly read GITEA_URL and GITEA_TOKEN and call the Gitea API. However the registry metadata shown earlier claimed "Required env vars: none", which is incorrect given skill.yaml, env-example.txt, and the scripts all require GITEA_URL and GITEA_TOKEN. This metadata inconsistency is unexpected and should be resolved before trusting the skill.
Instruction Scope
SKILL.md gives a narrow, well-defined runtime flow: run the included Python scripts to fetch data, produce JSON with the AI (AI must only emit JSON), then use included render_email.py to generate HTML and call the imap-smtp-email skill to send messages. The instructions reference only the skill's own files and /tmp artifacts; they do not request reading unrelated system files. The strict rule that AI must not output HTML and that rendering is done by scripts is coherent and acceptable.
Install Mechanism
No external downloads or opaque install steps are declared. A setup.sh is included which creates a Python venv and pip-installs requirements.txt (requests, python-dotenv). No network fetch of arbitrary archives or third-party installers is present in the manifest. This is low-risk for installation mechanism.
Credentials
The code and skill.yaml legitimately require GITEA_URL and GITEA_TOKEN (primary credential). Those credentials are proportional to the declared purpose. The concern is that the registry metadata shown at top incorrectly listed 'Required env vars: none'—an incoherence between what is declared in registry metadata and what the skill actually needs. The skill will access all repos visible to the provided token and will query user emails, so the token should be least-privilege (read-only).
Persistence & Privilege
The skill does not request always:true, does not modify other skills, and its setup only creates files under ~/.config/gitea-routine-report and a local virtualenv. It requires the imap-smtp-email skill to send mail (separate credentials). Autonomous invocation is permitted by default but not by itself a novel risk here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gitea-routine-report
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gitea-routine-report 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.2
Version 1.2.2 - Added a new file: skill.yaml. - Removed metadata, credential, and environment variable sections from SKILL.md (now included in skill.yaml). - No changes to the described functionality or usage instructions.
v1.2.1
- Renamed documentation file from skill.md to SKILL.md and updated its formatting. - Added an “安装前检查” (pre-installation checklist) section with best practices and security notes. - Moved metadata into a dedicated block for improved structure and clarity. - No changes to functionality or command-line usage.
v1.2.0
**Summary: Adds dedicated Python script for HTML report rendering; improves process separation of AI and HTML generation.** - 新增脚本 `scripts/render_email.py` 用于报告 HTML 生成。 - 流程拆分:AI 只需输出 JSON 文字总结,不参与 HTML 拼装。 - 所有 HTML 邮件内容均通过新脚本生成,AI 禁止直接输出 HTML。 - 明确四步执行流程,提升稳定性与可维护性。 - 更新文档详细说明 AI JSON 结构与 render_email.py 使用方式。
v1.1.1
- 时间格式及说明从“按 UTC 解释”修正为“按 UTC+8/北京时间解释”,确保统计时间与用户时区一致。 - 示例命令及说明统一强调以北京时间(UTC+8)为准。 - 其余功能和流程保持不变。
v1.1.0
**项目进度报告 skill 升级为 HTML 邮件,并支持更灵活的时间区间。** - 进度报告邮件格式由纯文本升级为结构化 HTML,内容更美观易读。 - 新增报告要素:每位成员文件类型分布、本期无提交成员名单、详细时间区间说明和风险提示分类。 - 时间段参数支持绝对时间(since/until),自动解析“最近N小时/天”等自然语言为绝对区间。 - 邮件正文分为“有提交”和“无提交”两种 HTML 模板,内容更贴近实际管理诉求。 - 更新用例与命令行参数,提升多场景语义适配能力。
v1.0.1
- 增加环境变量说明:新增了 GITEA_URL 和 GITEA_TOKEN 环境变量要求。 - 增加凭据支持:声明了 primary_credential(GITEA_TOKEN)及其相关配置细节。 - 新增 environment_file 路径说明,便于本地环境配置。 - 文档结构未变,报告生成和邮件流程无更改。
v1.0.0
- Initial release. - Generates AI-powered progress reports for each visible Gitea repository. - Includes overall AI assessment, member contributions ranking, individual summaries, commit records, and risk alerts. - Supports both all-repositories and single repository modes; reports are sent via email to repo admins. - Can be triggered by user command or scheduled tasks.
元数据
Slug gitea-routine-report
版本 1.2.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 7
常见问题

gitea-routine-report 是什么?

获取 Gitea 各仓库提交记录,调用 AI 生成进度报告,并发送 HTML 邮件给仓库管理员. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 121 次。

如何安装 gitea-routine-report?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gitea-routine-report」即可一键安装,无需额外配置。

gitea-routine-report 是免费的吗?

是的,gitea-routine-report 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

gitea-routine-report 支持哪些平台?

gitea-routine-report 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 gitea-routine-report?

由 Colin(@zhcolin0313)开发并维护,当前版本 v1.2.2。

💬 留言讨论