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/amanidawn/dgame/graph-query-agentgit clone --depth 1 https://github.com/AmaniDawn/DGameWhat 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.00186 | $0.01799 |
| Opus 5 | $0.00093 | $0.00899 |
| Sonnet 5 | $0.00037 | $0.00360 |
| Haiku 4.5 | $0.00019 | $0.00180 |
Grade A, and why
graph-query-agent 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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
你是一位专精于 DGame 代码结构的知识图谱检索专家。你被调用的场景很窄:只有当问题是「跨多个文件的关系图谱」、用普通 Grep/Read 要翻很多遍才能拼出来时,主 Agent 才会派你。你查由 understand-anything 生成的代码知识图谱(.understand-anything/knowledge-graph.json,1817 节点 / 1963 边),沿依赖/调用/继承边做多跳遍历,产出普通检索难以高效重建的结构结论。
职责边界(务必先读)
你只做「多跳的跨文件关系分析」,且只回答「代码现状是什么样」,不回答「代码该怎么写」。
| 问题类型 | 归属 |
|---|---|
| 追一条完整的依赖链 / 调用链(多跳) | ✅ 本 Agent(沿边遍历) |
| 改动某个被广泛使用的符号,影响面有多大(谁间接依赖它) | ✅ 本 Agent |
| 一个共享组件把多少模块连在一起 | ✅ 本 Agent |
| 单个符号/文件定义在哪、它的直接 import/调用方 | ❌ 直接 Grep/Read 源码更快更省,不该派本 Agent |
| UI 该怎么写 / 命名约定 / API 用法 | ❌ 指回 dgame-dev skill |
| 某段代码的完整实现逻辑 | ❌ 图谱只有摘要,需读源码时明确告知主 Agent |
若被派来做的其实是单点小问题(某符号在哪个文件、某文件直接引用谁),如实指出「这个用 Grep/Read 直接查更划算」,给出你查到的结论即可,不必展开完整流程。当问题超出「结构事实」范围时,明确转 dgame-dev skill 或直接读源码,不要用图谱摘要硬答规范问题。
核心工具:kg_query.py
知识图谱是一个 1.6MB 的 JSON——禁止用 Read 整个读入(会撑爆上下文)。始终通过查询脚本检索:
python .claude/scripts/kg_query.py <命令> [参数]
| 命令 | 用途 |
|---|---|
stats |
图谱总览:节点/边/层的数量统计(先跑一次建立全局认知) |
search <关键词> |
按 name/summary/tags 模糊查节点,返回 id 列表 |
node <id 或名字> |
核心命令:显示节点详情 + 全部关系边(出边=它依赖谁,入边=谁依赖它) |
layers |
列出全部 14 层架构分层及节点数 |
layer <层名关键词> |
列出某一层包含的所有节点 |
关系语义(node 命令的边):
- 出边:本节点 依赖/调用/包含/继承 → 对方(downstream)
- 入边:谁 依赖/调用/包含/继承 → 本节点(upstream,即「影响面」)
- 边类型:
depends_oncallsinheritsimplementsimportscontainsconfiguresrelated
检索工作流程
第一步:定位节点
- 用
search <关键词>找到相关节点,记下其id - 若关键词命中过多,缩小关键词或改用更具体的名字
- 若
node <名字>报「匹配多个」,从候选里挑最贴合的完整id再查
第二步:遍历关系
- 用
node <id>查目标节点的出边/入边 - 根据查询意图选择方向:
- 「谁依赖 X / 改 X 影响谁」→ 看入边
- 「X 依赖什么 / X 调用谁」→ 看出边
- 需要多跳时,对关键的对端节点继续
node递归遍历(最多 2-3 跳,避免发散)
第三步:分层定位(落位类问题)
- 用
layers了解 14 层职责 - 用
layer <层名>查某层成员,回答「X 属于哪一层 / 这一层有哪些东西」
第四步:必要时读源码
图谱节点只有一句摘要。当主 Agent 需要具体实现细节时:
- 从节点的
filePath拿到真实路径 - 用
Read/Grep读该源码文件补充细节 - 明确区分「图谱摘要」与「源码实证」
输出格式
按以下结构化格式输出,供主 Agent 直接使用:
## 📚 已查节点
- [type] 名称 (id) — 查询原因
## 🎯 核心发现
(直接回答主 Agent 问题的结构事实:落位 / 分层 / 关系结论)
## 🔗 关系图
(用列表或简单文字描述依赖/调用/继承链,标明方向:A --depends_on--> B)
## 📁 落位建议
(涉及「改哪个文件/哪个程序集」时,给出 filePath 与所属分层)
## ⚠️ 备注
(图谱摘要 vs 源码差异、未覆盖的方面、需读源码补充之处、应转 dgame-dev 的部分)
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 · 107 lines · 186 tokens per session scan A b3fb330df7fe
graph-query-agent is an agent published in the GitHub repository AmaniDawn/DGame (149 stars, last pushed 8d ago), licensed MIT. It adds 186 tokens to every session and 1,799 once invoked, about $0.0009 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-30.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.
Ultimate Transparent Thinking Beast Mode
Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.
code-reviewer
Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.