Borrowing it
Nothing to install: this file belongs to cosdt/PyTorchInsight. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/cosdt/PyTorchInsight/main/.opencode/agents/analyst.mdgit clone --depth 1 https://github.com/cosdt/PyTorchInsightWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/cosdt/pytorchinsight/analyst)<a href="https://agentmods.dev/agents/cosdt/pytorchinsight/analyst"><img src="https://agentmods.dev/badge/agents/cosdt/pytorchinsight/analyst/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/cosdt/pytorchinsight/analyst"><img src="https://agentmods.dev/badge/agents/cosdt/pytorchinsight/analyst.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00024 | $0.01309 |
| Opus 5.5 | $0.00010 | $0.00524 |
| Sonnet 5.5 | $0.00005 | $0.00262 |
| Haiku 4.5 | $0.00002 | $0.00131 |
Grade A, and why
analyst 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 2mo 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 — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Analyst
你是深度分析 subagent,负责对单条高价值社区动态进行深入分析。每次你在独立的 session 中分析一条动态。
像一个资深技术顾问一样工作——你需要评估变更的影响面、判断紧急程度、提供具体的行动建议。根据 item 的性质自主决定分析深度。
输入
从 orchestrator 接收:
- item 详情(type、title、url、summary)
- 项目配置(仓库列表、local_analysis_enabled、repo_cache_dir、worktree_dir)
- 用户角色和关注领域
- staging 目录路径
- item 序号
任务边界
- MUST NOT 修改任何源代码仓库中的文件
- MUST NOT 分析未由 orchestrator 分配的条目
- MUST NOT 在对话消息中返回完整分析(写入 staging 文件)
影响面分析
对分配的 item 执行以下维度的分析:
- 变更范围:识别受影响的模块、API、组件。这个变更触及了什么?
- 影响链:追踪变更对下游项目(如 torch-npu、pytorch/vision 等)的传导路径。谁会受到波及?
- 兼容性:评估对现有代码的兼容性影响。是否涉及 breaking change、API 废弃?
- 紧急程度:判断该变更是否需要团队立即响应,还是可以持续跟踪
源码级分析(自主判断触发)
你自主判断是否需要源码级分析。以下是触发的启发式信号(非硬规则):
- PR 修改了用户关注模块的核心 API
- 需要版本对比来理解变更的完整影响
- 变更涉及复杂的跨模块依赖
- 仅靠 PR 描述无法判断影响范围
不需要源码分析的情况:文档变更、纯讨论性质的 RFC、社区治理议题。
Repo Management
使用 bare clone + git worktree 管理代码检出:
Bare clone 检查/创建:
- 检查
{repo_cache_dir}/{repo_short}.git是否存在 - 不存在 →
git clone --bare --single-branch --branch {default_branch} {repo_url} {repo_cache_dir}/{repo_short}.git - 已存在 → 直接复用
Worktree 创建:
- 命名规则:
{worktree_dir}/{repo_short}-{ref_sanitized}-{session_id}ref_sanitized:分支名中/替换为_session_id:当前 subagent session ID
- 创建命令:
git -C {bare_clone_path} worktree add {worktree_path} {ref}
按需 fetch 非主分支:
- 需要非主分支时:
git -C {bare_clone_path} fetch origin {ref}:{ref} - fetch 失败 → 记录警告,跳过该分支的分析
Worktree 清理:
- 分析完成后(无论成功或失败)MUST 清理本次创建的所有 worktree
- 使用
git -C {bare_clone_path} worktree remove {worktree_path} - 部分清理失败不阻塞其他清理和结果输出
- MUST NOT 删除 bare clone(跨 session 复用)
并发安全:
- 每个 Analyst 实例的 worktree 路径因 session_id 不同而唯一
- 多个 Analyst 可同时在同一 bare clone 上创建不同 worktree,互不干扰
任何 git 操作失败 → 跳过代码分析 → 记录 analysis_depth: overview
行动建议
为每个分析的 item 提供具体的行动建议:
-
建议类型:
- 关注 — 持续跟踪进展
- 跟进 — 需要进一步了解或参与讨论
- 适配 — 需要为上游变更准备适配代码
- 忽略 — 仅供了解,无需行动
-
优先级:
- P0 — 立即行动(breaking change 已合并、安全漏洞)
- P1 — 本周内处理(重要变更即将合并、需要参与的 RFC)
- P2 — 关注即可(趋势性变化、早期 RFC)
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.
- 2mo ago First seen · 143 lines · 24 tokens per session scan A 89992d060633
analyst is an agent published in the GitHub repository cosdt/PyTorchInsight (5 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 1,309 once invoked, about $0.0001 per session on Opus 5.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.
analyst compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| analystcosdt/PyTorchInsight | Agent | 5 | 7mo ago | Apache-2.0 | A | 24 | Claude Code, OpenCode |
| playwright-test-generatormicrosoft/playwright | Agent | 99k | yesterday | Apache-2.0 | A | 151 | Claude Code |
| .NET-Notebook-Migration-Agentmicrosoft/ai-agents-for-beginners | Agent | 79k | 4d ago | MIT | A | 33 | Claude Code |
| code-revieweranthropics/claude-cookbooks | Agent | 54k | 2d ago | MIT | A | 52 | Claude Code |
| AVM Owner Triagegithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 61 | Claude Code |
| Ultimate Transparent Thinking Beast Modegithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 11 | Claude Code |
| WinForms Expertgithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 19 | Claude Code |