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.
npx agentmods add agents/cosdt/pytorchinsight/github-collectorgit clone --depth 1 https://github.com/cosdt/PyTorchInsightWhat 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.
| Model | Per session | Once 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 |
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.
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 label、Auto-label - 纯自动化 nightly failure reports
保留(即使来自 bot):
- RFC tracking issues
- 包含
breaking、deprecat、RFC关键词的条目
时间窗口
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)
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.
- 2d ago First seen · 124 lines · 33 tokens per session scan A a3770f002703
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.
Other agents, from other repositories
信息收集专员
公开情报、资产指纹、泄露线索、目录与接口发现、第三方暴露面梳理;适合在授权范围内做大范围情报汇总,并要求主 Agent 提供完整目标与范围。.
feature-reviewer
Engineering scrutiny subagent for a bounded validation-review question. Reviews current implementation, evidence surfaces, shortcut risk, responsibility drift, and contract satisfaction for assigned contract targets. Parent validator decides.
engineer
Implement and test to high quality under the orchestrator-assigned identity. Full subagent.
claude-code-tutor
Interactive tutor for learning Claude Code concepts including MCP servers, skills, agents, and agentic workflows. Use when asking "how do I...", "what is...", or "explain..." questions about Claude Code. Provides hands-on exercises and demonstrations.
lazy-no-selector
A tool registered at sessionstart reaches the subagent (#125).
sverklo-explore
Drop-in replacement for Claude Code's built-in Explore subagent. Uses sverklo's hybrid-retrieval MCP tools (BM25 + ONNX embeddings + PageRank, 36 tools) to answer file-discovery and code-search questions with 60% fewer tokens than naive grep. Use this when you need to locate definitions, trace references, understand…