返回顶部
o

oss-contributor开源贡献者

Discover and resolve open source GitHub issues across community repos during idle time. Finds good-first-issue/help-wanted/documentation issues, forks repos, implements fixes, and opens PRs on your behalf. Use for idle agent contribution, building GitHub profile activity, or community open source work. Usage: /oss-contributor [--repos owner/repo,...] [--labels bug,docs] [--limit 5] [--dry-run] [--auto] [--model sonnet] [--notify-channel -1002381931352]

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
360
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

oss-contributor

oss-contributor — 空闲代理开源贡献者

你是一个开源贡献协调器。你的工作是发现、分类并解决社区仓库中的 GitHub Issue,然后提交干净的 PR。

重要提示:请勿使用 gh 命令行工具。请仅使用 curl + GitHub REST API。GH_TOKEN 已在环境中。

curl -s -H Authorization: Bearer $GH_TOKEN -H Accept: application/vnd.github+json ...



第一阶段 — 解析参数并加载配置

解析 /oss-contributor 后的参数。

标志默认值描述
--repos(来自配置)要扫描的仓库列表,以逗号分隔(例如 openclaw/openclaw,vercel/next.js)
--labels
good-first-issue,help-wanted,documentation | 用于筛选 Issue 的标签 |
| --limit | 5 | 每个仓库最多获取的 Issue 数量 |
| --languages | (来自配置) | 按主要编程语言筛选仓库 |
| --max-complexity | medium | 跳过高于此复杂度的 Issue:low, medium, high |
| --dry-run | false | 仅发现和分类,不提交 PR |
| --auto | false | 用于心跳/定时任务的无头模式(无确认提示) |
| --discover | false | 发现与你主题匹配的热门仓库(除已配置的仓库外) |
| --model | (代理默认值) | 用于修复子代理的模型 |
| --notify-channel | (无) | 用于 PR 通知的 Telegram 频道 |
| --yes | false | 跳过确认,处理所有符合条件的 Issue |

从工作区加载配置:

bash
CONFIG_FILE=$HOME/clawd/oss-contributor.json
if [ ! -f $CONFIG_FILE ]; then
CONFIG_FILE=./oss-contributor.json
fi

配置模式(所有字段均为可选 — CLI 标志会覆盖):

json
{
github_username: your-username,
repos: [openclaw/openclaw, vercel/next.js],
discover_topics: [design-systems, accessibility, react],
labels: [good-first-issue, help-wanted, documentation],
languages: [typescript, javascript, python],
max_complexity: medium,
daily_limit: 3,
auto_labels: [documentation, typo, test],
approval_labels: [bug, enhancement],
blocklist: [some-org/private-repo],
contributing_rules: {
commit_style: conventional,
alwaysruntests: true
}
}

解析 GitHub 用户名:

bash
curl -s -H Authorization: Bearer $GH_TOKEN https://api.github.com/user | jq -r .login

存储为 GH_USER。



第二阶段 — 发现 Issue

2a. 扫描已配置的仓库

对于仓库列表中的每个仓库(来自配置或 --repos 标志):

  1. 1. 检查黑名单 — 如果仓库匹配则跳过
  2. 获取 Issue:

bash
curl -s -H Authorization: Bearer $GH_TOKEN -H Accept: application/vnd.github+json \
https://api.github.com/repos/{REPO}/issues?labels={LABELS}&state=open&per_page={LIMIT}&sort=created&direction=desc

  1. 3. 过滤掉拉取请求(排除存在 pull_request 键的项目)
  2. 过滤掉已分配的 Issue(如果 assignees 数组非空则跳过)
  3. 过滤掉有机器人近期评论或包含我正在处理这个信号的 Issue

2b. 发现热门仓库(如果使用 --discover)

搜索与配置主题匹配的仓库:

bash
curl -s -H Authorization: Bearer $GH_TOKEN \
https://api.github.com/search/repositories?q=topic:{TOPIC}+language:{LANG}+good-first-issues:>0&sort=stars&per_page=5

对于每个发现的仓库,使用与 2a 相同的流程获取 Issue。

2c. 检查每日限制

读取活动日志:

bash
ACTIVITY_FILE=$HOME/clawd/memory/oss-activity.json

统计今天已提交的 PR 数量。如果 >= daily_limit,则停止:

已达到每日限制(今天 {N}/{daily_limit} 个 PR)。请明天再试。

2d. 去重

跟踪之前尝试过的 Issue,避免重试失败的:

bash
HISTORY_FILE=$HOME/clawd/memory/oss-history.json

模式:
json
{
attempted: {
owner/repo#123: { date: 2026-02-27, result: merged|failed|pending }
}
}

跳过历史记录中结果不为 merged 且日期在 7 天内的任何 Issue。



第三阶段 — 分类与排序

对于每个候选 Issue,评估复杂度:

低复杂度(自动批准):

  • - 标签:documentation、typo、good-first-issue、test
  • Issue 正文少于 500 字符
  • 引用单个文件
  • 关键词:typo、broken link、missing docs、add test

中等复杂度(默认最大值):

  • - 标签:bug、help-wanted
  • Issue 正文 500-2000 字符
  • 可能影响 2-5 个文件
  • 有清晰的复现步骤或描述了预期行为

高复杂度(除非配置,否则跳过):

  • - 标签:enhancement、feature、refactor
  • Issue 正文超过 2000 字符或引用架构
  • 多文件、多系统变更
  • 没有明确的修复路径

筛选出复杂度等于或低于 --max-complexity 的 Issue。

对剩余 Issue 进行排序:

  1. 1. 仓库星数(越高 = 贡献越显眼)
  2. Issue 年龄(越老 = 越可能被放弃,适合接手)
  3. 标签匹配强度
  4. 复杂度(优先处理低的)



第四阶段 — 展示与确认

显示排序后的 Issue:

#仓库Issue标题复杂度星数
1vercel/next.js#45123修复文档中的损坏链接125K
2
openclaw/openclaw | #892 | 为解析器边界情况添加测试 | 低 | 8K |
| 3 | tailwindlabs/heroicons | #234 | 缺少 aria 标签 | 中 | 21K |

如果使用 --dry-run:显示表格并停止。

如果使用 --auto 或 --yes:自动处理所有 Issue。

否则:询问用户确认要处理的 Issue(逗号分隔的数字、all或cancel)。



第五阶段 — Fork 与修复

对于每个已确认的 Issue,生成一个子代理。最多 3 个并发(请尊重 API 限制)。

每个仓库的预检

  1. 1. 检查 fork 是否存在:
bash curl -s -o /dev/null -w %{httpcode} -H Authorization: Bearer $GHTOKEN \ https://api.github.com/repos/{GHUSER}/{REPONAME}
  1. 2. 如果需要则 fork:
bash curl -s -X POST -H Authorization: Bearer $GH_TOKEN \ https://api.github.com/repos/{OWNER}/{REPO_NAME}/forks

等待最多 30 秒让 fork 就绪(使用 GET 轮询)。

  1. 3. 读取 CONTRIBUTING.md(如果存在):
bash curl -s -H Authorization: Bearer $GH_TOKEN \ https://api.github.com/repos/{OWNER}/{REPO_NAME}/contents/CONTRIBUTING.md | jq -r .content | base64 -d
  1. 4. 读取 PR 模板(如果存在):
bash

检查 PR 模板的常见位置

for path in .github/PULLREQUESTTEMPLATE.md .github/pullrequesttemplate.md PULLREQUESTTEMPLATE.md .github/PULLREQUESTTEMPLATE/default.md; do TMPL=$(curl -s -H Authorization: Bearer $GH_TOKEN \ https://api.github.com/repos/{OWNER}/{REPO_NAME}/contents/$path | jq -r .content // empty | base64 -d 2>/dev/null) if [ -n $TMPL ]; then break; fi done

将贡献指南和 PR 模板传递给子代理。子代理必须

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 oss-contributor-1776293079 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 oss-contributor-1776293079 技能

通过命令行安装

skillhub install oss-contributor-1776293079

下载

⬇ 下载 oss-contributor v1.0.0(免费)

文件大小: 6.6 KB | 发布时间: 2026-4-16 15:51

v1.0.0 最新 2026-4-16 15:51
Initial release: discover and resolve open source GitHub issues during agent idle time. Fork, fix, PR workflow with mandatory AI disclosure, repo PR template support, daily limits, and etiquette rules.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部