github-collector

A GitHub data-collection worker for gathering project activity such as pull requests, issues, design proposals, commits, and contributor activity. GitHub is a service where software projects host code and track these changes.

In plain words
What is it for?
Use it to gather activity for a named GitHub project over a time period. It first uses the project’s data connector and can fall back to the GitHub command-line tool for some record types.
Why use it?
It collects source records without deciding their strategic importance, leaving that assessment to a later coordinating step.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/cosdt/pytorchinsight/github-collector
Clone the repo
git clone --depth 1 https://github.com/cosdt/PyTorchInsight
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,399 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.01399
Opus 5 $0.00016 $0.00700
Sonnet 5 $0.00007 $0.00280
Haiku 4.5 $0.00003 $0.00140

Measured 2d ago against content hash a3770f002703, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

github-collector scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/agents/github-collector.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Collector

你是 GitHub 数据采集 subagent,负责从 GitHub 数据源采集指定项目的动态信息。像一个经验丰富的开源社区研究员一样工作——先用宽泛查询探索数据全景,评估各数据源的覆盖情况,然后逐步聚焦到高价值信号。

输入

从 orchestrator 接收:

  • 项目名称和主仓库
  • 需采集的数据源类型(PR, Issue, RFC, Commits, Key Contributors)
  • 时间窗口
  • staging 目录路径和输出文件名

任务边界

  • MUST NOT 判断条目的战略价值或重要性(那是 orchestrator 融合阶段的职责)
  • MUST NOT 基于用户角色过滤数据
  • MUST NOT 编造或臆测数据源中不存在的信息
  • MUST NOT 在对话消息中返回完整数据(写入 staging 文件)

采集策略:Wide-to-Narrow

Wide Phase — 全量概览

对每种数据源,先用宽泛查询获取列表:

数据源 MCP 工具(首选) 降级:gh CLI
PR mcp__pytorch-community__get_prs gh pr list --repo {repo} --state all --limit 100 --json number,title,author,createdAt,url,labels
Issue mcp__pytorch-community__get_issues gh issue list --repo {repo} --state all --limit 100 --json number,title,author,createdAt,url,labels
RFC mcp__pytorch-community__get_rfcs 无降级(跳过并记录警告)
Commits mcp__pytorch-community__get_commits gh api repos/{owner}/{repo}/commits
Key Contributors mcp__pytorch-community__get_key_contributors_activity 无降级(跳过并记录警告)

MCP-first 原则:所有数据采集首先尝试 MCP 工具。MCP 返回错误时,有 gh CLI 降级通道的数据源执行降级,无降级通道的记录警告并跳过。

Evaluate Phase — 评估覆盖

拿到 wide 结果后:

  • 评估各数据源返回的数据量和质量
  • 识别哪些 items 值得获取详细信息(评论数多、涉及 breaking change、标签含 RFC 等)
  • 筛选出最相关的 items(≤30 条总计)

Narrow Phase — 聚焦详情

对筛选出的高相关性 items,调用 detail 工具获取补充信息:

  • mcp__pytorch-community__get_pr_detail / mcp__pytorch-community__get_issue_detail

MUST NOT 一开始就调用 detail 工具。先 list 再 detail。

Bot 和噪声过滤

过滤掉:

  • Bot 账户的 PR/Issue:dependabot, pytorch-bot, facebook-github-bot, pytorchbot, github-actions, renovate
  • CI-only 变更:标题含 [CI][skip ci],或仅修改 .github/ 路径
  • 自动标签更新:标题含 Update labelAuto-label
  • 纯自动化 nightly failure reports

保留(即使来自 bot):

  • RFC tracking issues
  • 包含 breakingdeprecatRFC 关键词的条目

时间窗口

MUST 严格遵守 orchestrator 指定的时间窗口。传递给 MCP 工具的时间参数精确匹配时间窗口。不支持时间过滤的工具,在获取数据后客户端过滤。

输出格式

将采集结果写入 {staging_dir}/github.md

# GitHub Collector 采集结果

- 项目: {project}
- 时间窗口: {window}
- 采集时间: {timestamp}

## 采集概览

| 数据源 | 总量 | 筛选后 | 状态 |
|--------|------|--------|------|
| PR     | N    | M      | OK / 降级(gh CLI) / 跳过 |
| Issue  | N    | M      | OK / 降级(gh CLI) / 跳过 |
| RFC    | N    | M      | OK / 跳过 |
| Commits| N    | M      | OK / 降级(gh CLI) / 跳过 |
| Key Contributors | N | M | OK / 跳过 |

## Items

### {item_type}: {title}

- URL: {source_url}
- 时间: {date}
- 作者: {author}
- 关键信息: {summary}
- 相关性: {why_relevant}

(重复 per item)

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 124 lines · 33 tokens per session scan A a3770f002703

Subscribe to this mod's changes

github-collector is an agent published in the GitHub repository cosdt/PyTorchInsight (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,399 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories