Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 48 additions & 51 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,77 @@
# GitHub Agent Contributor Workflow
# GitHub Multi-Agent Contributor Workflow

[中文](README.md) | English

A reusable GitHub workflow for involving Codex, Claude, and other verifiable agents in repository work, automated checks, Pull Requests, and attributable Contributor records.
A multi-agent contributor solution for GitHub repositories: let Codex, Claude, and other verifiable agents/bots appear on the Contributors page with traceable co-author identities, backed by daily automated check-ins and real PR collaboration.

This project provides two complementary modes:
## Core capabilities

| Mode | Purpose | Human review |
| Capability | Description | Human review |
| --- | --- | --- |
| Scheduled check-in | Append a transparent daily activity record with configured agent co-authors | Not required by default |
| Real PR collaboration | Let an agent implement code, documentation, or tests on an isolated branch and merge through a Pull Request | Decide by risk |
| 🔁 Scheduled check-in | Append a transparent daily activity record with configured co-author trailers | Not required by default |
| 🤝 Real PR collaboration | Agents implement development, docs, or tests on isolated branches and merge via PR | Decide by risk |
| 📦 One-command install | Any agent installs the contributor kit into a target repository with one command | Confirm on merge |

## Scheduled check-in
## Quick start (add contributor identities to any repository)

When enabled, GitHub Actions runs:
Any agent (Codex / Claude Code / Gemini CLI / Cursor, etc.) can run this inside the target repository:

```bash
bash <(curl -fsSL https://raw.githubusercontent.com/academic-door/github-multiagent-contributor/main/scripts/fetch-kit.sh)
python scripts/build_contributors.py --apply --tools codex,claude,renovate
```

The first command installs the kit (public raw URL, no login required); the second creates a branch, writes `Co-Authored-By` trailers, and commits, then pushes and opens a PR. Once merged, the identities appear on the Contributors page.

> Prerequisite: the agent must be authenticated to GitHub (able to push branches / open PRs). Identity emails must be real, GitHub-recognized agent/bot identities; forging is forbidden.

## Identity catalog

[contributor-catalog.md](docs/contributor-catalog.md) lists two **verified** identity classes (35 in total):

- ✅ **GitHub-registered AI identities**: codex, claude — trailers count on the page.
- 🤖 **Real GitHub bot accounts** (33): dependabot[bot], renovate[bot], mergify[bot], etc. — emails resolve to real accounts, so they always appear.

The selection script `scripts/build_contributors.py` supports any combination:

```text
Scheduled run (once a day, 00:17 Asia/Shanghai)
python scripts/build_contributors.py --list # list all identities
python scripts/build_contributors.py --tools codex,renovate # pick any combination
python scripts/build_contributors.py --bots # all real bot accounts
python scripts/build_contributors.py --all # all identities
python scripts/build_contributors.py --remove --tools renovate # remove an identity (stop future use)
python scripts/build_contributors.py --check --tools codex # verify presence in recent commits
```

Co-author trailers are attribution only and do not claim the tool actually participated in every commit. This repository verified **42 identities** on the Contributors page; full findings are in the [verification report](docs/verification-report.md).

## Scheduled check-in (daily transparent record)

When enabled, GitHub Actions runs once a day (00:17 Asia/Shanghai, dual-cron fallback):

```text
Scheduled run
→ Update activity/agent-checkins.csv (at most one record per date)
→ Create an automated commit
→ Add configured Co-Authored-By trailers
→ Record the commit on the default branch
```

This records automation activity; it does not claim that an agent completed substantive development or research that day. It is disabled by default.

Repository variables:

```text
AGENT_CHECKIN_ENABLED=true
AGENT_CHECKIN_AUTHORS=Codex <noreply@openai.com>;Claude <noreply@anthropic.com>
```

- The default in this repository is Codex, Claude and the two maintainers; **other repositories should set `AGENT_CHECKIN_AUTHORS` to their own identity set** (semicolon-separated).
- GitHub Actions must be allowed to write to the default branch. Each identity email must belong to a real, GitHub-recognized agent or bot identity. Do not forge addresses.
- Note: GitHub scheduled runs are occasionally skipped. If no record appears for the day, open the `Scheduled Agent Check-in` workflow on the Actions page and click **Run workflow** (the CSV is deduplicated by date, so no duplicates).
- The default in this repository is Codex, Claude and the two maintainers; other repositories should set `AGENT_CHECKIN_AUTHORS` to their own identity set (semicolon-separated).
- GitHub Actions must be allowed to write to the default branch.
- GitHub scheduled runs are occasionally skipped: if no record appears, trigger **Run workflow** manually on the Actions page (CSV is deduplicated by date).

See [Scheduled Agent Check-in](docs/scheduled-agent-checkin.md).

## Verified co-author catalog (optional)

To add more identities to the Contributors page, use the [contributor catalog](docs/contributor-catalog.md) and the [selection script](scripts/build_contributors.py):

```text
python scripts/build_contributors.py --list # list all identities
python scripts/build_contributors.py --tools codex,renovate # pick a subset
python scripts/build_contributors.py --bots # all real bot accounts (always show)
python scripts/build_contributors.py --all --commit-message "feat: x" # generate a commit message with trailers
```

Identities are split into two groups (verified in this repository):

- **Group A**: codex, claude (GitHub-registered AI identities; trailers count on the page).
- **Group C**: 33 real GitHub bot accounts (e.g. dependabot[bot], renovate[bot], mergify[bot]; emails resolve to real accounts, so they always appear).

Append the generated `Co-Authored-By:` lines to a commit and merge it into the default branch. This is attribution only and does not claim the tool actually participated in every commit. This repository reached 42 identities on the Contributors page; full findings are in the [verification report](docs/verification-report.md).

## Real PR collaboration

Use this mode for substantive development, fixes, and documentation:

```text
Issue defines the goal and acceptance criteria
→ Agent creates an isolated branch
Expand All @@ -74,23 +86,8 @@ Routine maintenance can be handled directly by the maintainer. Require human or

## Apply to an existing repository

**Existing repositories do not need the whole template.** Copy the pieces you need:

```text
docs/contributor-catalog.md # identity catalog (choose which identities)
docs/verification-report.md # verification findings (optional reference)
scripts/build_contributors.py # identity selection script
.github/workflows/scheduled-agent-checkin.yml # daily check-in (optional)
docs/scheduled-agent-checkin.md # check-in docs (optional)
```

Then:

1. Use `build_contributors.py` to choose identities, put the trailers in a commit and merge it into the default branch (one-off).
2. Optional: add `scheduled-agent-checkin.yml`, set `AGENT_CHECKIN_ENABLED=true` and `AGENT_CHECKIN_AUTHORS` to carry the identities daily.
3. Refresh the Contributors page to verify.

Repositories that also want the full agent collaboration flow (Issue→PR→CI→review) can additionally copy `AGENTS.md`, Issue/PR templates, `tests.yml`, the email/hygiene gate scripts and `tests/`.
- **Contributor identities only**: use the one-command quick start above; no need to copy the whole template.
- **Full collaboration flow**: for Issue→PR→CI→review, additionally copy `AGENTS.md`, Issue/PR templates, `tests.yml`, the email/hygiene gate scripts and `tests/`.

## Contributor attribution

Expand Down
116 changes: 57 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,77 @@
# GitHub Agent Contributor Workflow
# GitHub Multi-Agent Contributor Workflow

中文 | [English](README.en.md)

一个可复制到任意 GitHub 仓库的 Agent 协作方案,用于让 Codex、Claude 及其他可验证的 GitHub Agent 参与提交、自动检查和 Pull Request 协作,并在需要时形成可追溯的 Contributor 记录
一套面向 GitHub 仓库的**多智能体贡献者方案**:让 Codex、Claude 及其他可验证的 Agent / Bot,以可追溯的共同作者身份进入 Contributors 页面;并配套每日自动 Check-in 与真实 PR 协作两种模式

本项目包含两种互补模式:
## 核心能力

| 模式 | 作用 | 是否需要人工 Review |
| 能力 | 说明 | 人工 Review |
| --- | --- | --- |
| 自动 Check-in | 每日写入一条透明活动记录,并保留配置的 Agent 共同作者署名 | 默认不需要 |
| 真实 PR 协作 | Agent 在独立分支完成代码、文档或测试任务,再通过 Pull Request 合并 | 按项目风险决定 |
| 🔁 自动 Check-in | 每日写入一条透明活动记录,携带配置的共同作者尾注 | 默认不需要 |
| 🤝 真实 PR 协作 | Agent 在独立分支完成开发、文档或测试,通过 PR 合并 | 按风险决定 |
| 📦 一键接入 | 任意 Agent 一条命令把贡献者套件装入目标仓库 | 合并时确认 |

## 自动 Check-in 模式
## 快速开始(给任意仓库加贡献者身份)

启用后,GitHub Actions 按计划运行
任何 Agent(Codex / Claude Code / Gemini CLI / Cursor 等)都可在目标仓库内执行

```text
定时运行(每天 1 次,00:17 Asia/Shanghai)
→ 更新 activity/agent-checkins.csv(每个日期最多一条)
→ 创建自动提交
→ 写入配置的 Co-Authored-By 尾注
→ 贡献记录进入默认分支
```bash
bash <(curl -fsSL https://raw.githubusercontent.com/academic-door/github-multiagent-contributor/main/scripts/fetch-kit.sh)
python scripts/build_contributors.py --apply --tools codex,claude,renovate
```

它只记录自动化活动,不声称 Agent 当天完成了实质性开发或研究工作。默认关闭。
第一条命令自动安装套件(public 仓库直连,无需登录);第二条命令自动创建分支、写入 `Co-Authored-By` 尾注并提交,随后推送并打开 PR;合并后身份即进入 Contributors 页面。

> 前提:Agent 已认证 GitHub(可推送分支 / 开 PR)。身份邮箱必须是 GitHub 能识别的真实 Agent / Bot 身份,禁止伪造。

## 身份目录

[contributor-catalog.md](docs/contributor-catalog.md) 收录两类**已验证**身份(共 35 个):

启用所需仓库变量:
- ✅ **GitHub 官方注册的 AI 身份**:codex、claude —— 尾注即计入页面。
- 🤖 **真实 GitHub Bot 账号**(33 个):dependabot[bot]、renovate[bot]、mergify[bot] 等 —— 邮箱可解析到真实账号,必然进入页面。

选择脚本 `scripts/build_contributors.py` 支持任意组合:

```text
AGENT_CHECKIN_ENABLED=true
AGENT_CHECKIN_AUTHORS=Codex <noreply@openai.com>;Claude <noreply@anthropic.com>
python scripts/build_contributors.py --list # 查看全部身份
python scripts/build_contributors.py --tools codex,renovate # 选择任意组合
python scripts/build_contributors.py --bots # 全部真实 Bot 账号
python scripts/build_contributors.py --all # 全部身份
python scripts/build_contributors.py --remove --tools renovate # 移除身份(停止再新增)
python scripts/build_contributors.py --check --tools codex # 验证是否已进入提交
```

- 默认身份为本仓库的 Codex、Claude 与两位维护者;**其他仓库请用 `AGENT_CHECKIN_AUTHORS` 设置自己的身份组合**(英文分号分隔)。
- 还需要允许 GitHub Actions 向默认分支写入。身份邮箱必须是 GitHub 能识别的真实 Agent 或 Bot 身份;不要伪造邮箱。
- 注意:GitHub 定时任务偶发跳跑;若当天未见记录,可在 Actions 页面找到 `Scheduled Agent Check-in` 手动点 **Run workflow** 补跑(CSV 按日期去重,不会重复)。
共同作者尾注仅作归因,不代表工具真实参与了每个提交。本仓库 Contributors 页面已验证 **42 个身份**,完整结论见 [验证报告](docs/verification-report.md)。

详细说明见 [自动 Check-in 文档](docs/scheduled-agent-checkin.md)。
## 自动 Check-in(每日透明记录)

## 已验证共同作者目录(可选)
启用后,GitHub Actions 每天运行一次(00:17 Asia/Shanghai,双 cron 兜底):

想让更多身份出现在 Contributors 页面,使用 [已验证共同作者目录](docs/contributor-catalog.md) 与 [选择脚本](scripts/build_contributors.py):
```text
定时运行
→ 更新 activity/agent-checkins.csv(每个日期最多一条)
→ 创建自动提交
→ 写入配置的 Co-Authored-By 尾注
→ 贡献记录进入默认分支
```

仓库变量:

```text
python scripts/build_contributors.py --list # 查看全部身份
python scripts/build_contributors.py --tools codex,renovate # 选择部分身份
python scripts/build_contributors.py --bots # 只选真实 Bot 账号(必显示)
python scripts/build_contributors.py --all --commit-message "feat: x" # 生成带尾注的提交信息
AGENT_CHECKIN_ENABLED=true
AGENT_CHECKIN_AUTHORS=Codex <noreply@openai.com>;Claude <noreply@anthropic.com>
```

身份分两组(本仓库已实测验证):
- **A 组**:codex、claude(GitHub 官方注册 AI 身份,尾注即计入页面)
- **C 组**:33 个真实 GitHub Bot 账号(如 dependabot[bot]、renovate[bot]、mergify[bot] 等,邮箱可解析到真实账号,必然进入页面)。
- 默认身份为本仓库的 Codex、Claude 与两位维护者;其他仓库请用 `AGENT_CHECKIN_AUTHORS` 设置自己的身份组合(英文分号分隔)。
- 需允许 GitHub Actions 写入默认分支
- GitHub 定时任务偶发跳跑:若当天未见记录,可在 Actions 页面手动 **Run workflow** 补跑(CSV 按日期去重)。

把生成的 `Co-Authored-By:` 行追加到提交信息并合并进默认分支即可。它只做归因,不代表对应工具真实参与了每个提交。本仓库 Contributors 页面已通过该方式达到 42 个身份,完整结论见 [验证报告](docs/verification-report.md)。
详细说明见 [自动 Check-in 文档](docs/scheduled-agent-checkin.md)。

## 真实 PR 协作模式

适合实际开发、修复和文档任务:

```text
Issue 定义目标与验收标准
→ Agent 创建独立分支
Expand All @@ -69,48 +82,33 @@ Issue 定义目标与验收标准
→ 维护者确认并合并
```

日常小修复可以由主维护者直接处理;重大功能、架构调整、数据变更和正式发布,建议要求其他 Agent 或人类协作者 Review。
日常小修复可由主维护者直接处理;重大功能、架构调整、数据变更与正式发布,建议要求其他 Agent 或人类协作者 Review。

## 应用到已有仓库

**已有仓库不必复制整套模板**,按需复制以下组件:

```text
docs/contributor-catalog.md # 身份目录(选择哪些身份)
docs/verification-report.md # 验证结论(可选,参考用)
scripts/build_contributors.py # 身份选择脚本
.github/workflows/scheduled-agent-checkin.yml # 每日自动 check-in(可选)
docs/scheduled-agent-checkin.md # check-in 说明(可选)
```

然后:

1. 用 `build_contributors.py` 选择身份,把尾注写进一个提交并合并进默认分支(一次性)。
2. 可选:放置 `scheduled-agent-checkin.yml`,设置 `AGENT_CHECKIN_ENABLED=true` 与 `AGENT_CHECKIN_AUTHORS`,让每日自动携带身份。
3. 刷新 Contributors 页面核对。

想同时接入完整 Agent 协作流程(Issue→PR→CI→Review)的仓库,再复制 `AGENTS.md`、Issue/PR 模板、`tests.yml`、邮箱/卫生门禁脚本与 `tests/`。
- **只加贡献者身份**:使用上文「快速开始」的一条命令即可,无需复制整套模板。
- **完整协作流程**:需要 Issue→PR→CI→Review 全套时,再复制 `AGENTS.md`、Issue/PR 模板、`tests.yml`、邮箱/卫生门禁脚本与 `tests/`。

## Contributor 归属规则

Contributor 来自进入默认分支的提交作者归属:

- Agent 的代码提交可以通过真实作者身份归属
- 人类账号代提交时,可以使用真实的 `Co-Authored-By` 尾注;
- GitHub App 或 Bot 以其真实身份提交时,可以单独出现在 Contributors;
- Agent 的代码提交可通过其真实作者身份归属
- 人类账号代提交时,可使用真实的 `Co-Authored-By` 尾注;
- GitHub App 或 Bot 以其真实身份提交时,可单独出现在 Contributors;
- Issue、评论、Review 或 Actions 运行本身不会自动产生 Contributor。

Contributor 图只是提交归属的结果,不应替代代码质量、测试和人工风险判断
Contributor 图只是提交归属的结果,不应替代代码质量、测试与人工风险判断

## 隐私与安全边界
## 隐私与安全

本项目不包含 Token、密码、私人数据或个人邮箱。公开仓库接入前,应确认
本项目不包含 Token、密码、私人数据或个人邮箱。公开仓库接入前,请确认

- GitHub 邮箱隐私已开启;
- 提交邮箱检查通过;
- Agent 只访问仓库中明确授权的内容;
- 本地数据、未上传的 PDF、桌面软件和私有环境不会被云端 Agent 自动读取;
- 研究结论、数据隐私和发布风险由维护者最终确认
- 研究结论、数据隐私与发布风险由维护者最终确认

## 许可证

Expand Down