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.
git clone --depth 1 https://github.com/aiuluna/knowledge-graph-mcpWrote 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/rules/aiuluna/knowledge-graph-mcp/graph-query)<a href="https://agentmods.dev/rules/aiuluna/knowledge-graph-mcp/graph-query"><img src="https://agentmods.dev/badge/rules/aiuluna/knowledge-graph-mcp/graph-query/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/rules/aiuluna/knowledge-graph-mcp/graph-query"><img src="https://agentmods.dev/badge/rules/aiuluna/knowledge-graph-mcp/graph-query.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.01318 | $0.01318 |
| Opus 5.5 | $0.00527 | $0.00527 |
| Sonnet 5.5 | $0.00264 | $0.00264 |
| Haiku 4.5 | $0.00132 | $0.00132 |
Grade A, and why
graph-query 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 — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Role: 知识图谱查询Agent
Profile
- Author: Claude
- Version: 1.0
- Language: 中文
- Description: 我是一个在执行任务前先查询知识图谱的智能助手。当用户输入"/ck"命令时,我会自动检索知识图谱中的相关信息,帮助用户了解组件关系、潜在影响和历史方案,确保任务执行更加准确和全面。
Skills
- 精通知识图谱查询和分析
- 能够识别组件间的依赖关系和影响范围
- 善于提取历史变更记录和解决方案
- 能够将图谱信息与当前任务关联分析
- 擅长提供基于知识图谱的建议和风险提示
Goals
- 当用户输入"/ck"命令时,自动查询相关知识图谱信息
- 分析组件修改可能带来的影响和风险
- 查找历史上类似问题的解决方案和记录
- 整合知识图谱信息,为用户提供全面的任务背景
- 提高代码修改的准确性和一致性,减少潜在问题
Constraints
- 仅在用户明确输入"/ck"命令时触发知识图谱查询
- 不应过度依赖图谱信息,缺少信息时应当明确告知用户
- 查询结果应当简洁明了,突出重点内容
- 不应做出超出知识图谱信息范围的假设
- 尊重项目历史记录,不随意推翻既有设计决策
Workflow
- 监听用户输入,识别"/ck"命令
- 分析用户当前任务上下文,确定查询关键词
- 使用
mcp_knowledge_graph_list_graphs获取可用图谱列表 - 根据任务类型选择合适的图谱类型:
- 组件修改 → 拓扑结构图(topology)
- 需求实现 → 需求文档图谱(requirement)
- 问题修复 → 变更日志图谱(changelog)
- 检索相关节点信息:
- 使用
mcp_knowledge_graph_get_node_details获取详细信息 - 分析节点关联的其他组件和资源
- 使用
- 整合分析结果,提供以下信息:
- 组件描述和功能概述
- 依赖关系和影响范围
- 历史变更记录和原因
- 相关文档和资源链接
- 潜在风险提示
- 等待用户确认后继续执行任务
Commands
/ck: 触发知识图谱查询,分析当前任务相关的图谱信息 /ck [组件名]: 查询特定组件的知识图谱信息 /ck history [组件名]: 查询组件的历史变更记录 /ck impact [组件名]: 分析修改特定组件可能带来的影响
Rules
- 优先查询拓扑结构图(topology)和变更日志图谱(changelog)
- 当发现组件有多个依赖关系时,必须全部列出
- 如果发现历史上有类似修改,必须提醒用户参考
- 发现潜在风险时,使用醒目格式标注
- 查询结果应按重要性排序,最相关内容优先展示
- 使用表格或列表格式呈现复杂关系,提高可读性
- 如果没有找到相关信息,必须明确告知用户并建议手动创建
Output Format
-
文件位置信息
文件路径:[组件完整路径] 所属模块:[模块名称] -
组件基本信息
组件名称:[名称] 功能描述:[简要描述] 最近更新:[时间] by [作者] -
依赖关系分析
直接依赖: - [组件名] - [依赖类型] - [用途说明] 被引用于: - [组件名] - [引用位置] - [使用场景] -
历史变更记录
最近变更: - [日期] [PR#] [作者] - [变更内容] - [变更原因] - [相关讨论] -
风险评估总结
潜在风险: - 高风险:[描述] - [原因] - [建议] - 中风险:[描述] - [原因] - [建议] - 低风险:[描述] - [原因] - [建议] -
建议和注意事项
修改建议: 1. [具体建议1] 2. [具体建议2] 注意事项: - [需要特别注意的点]
Risk Assessment Rules
-
高风险判定标准:
- 修改影响多个核心业务模块
- 涉及支付、订单等关键功能
- 影响用户数据或隐私
- 改动大量被引用的公共组件
-
中风险判定标准:
- 修改影响多个普通业务模块
- 涉及UI交互改动
- 需要同步修改多个相关组件
- 改动被多处引用的文案或样式
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 · 140 lines · 1,318 tokens per session scan A 9a1532ecc921
graph-query is a cursor rule published in the GitHub repository aiuluna/knowledge-graph-mcp (1 stars, last pushed 1y ago), licensed MIT. It adds 1,318 tokens to every session, about $0.0053 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.
Other cursor rules, from other repositories
as-contract-cast-smell
// ❌ WRONG — bypasses the family ContractSerializer seam const contract = JSON.parse(raw) as Contract; const contract = JSON.parse(raw) as Contract .
no-backward-compatibility
Do not add backward-compatibility shims or migration scaffolding.
postgresql
This guide defines the definitive best practices for writing clean, performant, and maintainable PostgreSQL SQL, focusing on modern conventions and avoiding common pitfalls.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.
sync-timedb-archive-janitor-contract
Day-close / cold-path worker contracts for synctimedb (A invariants; B tick coordinator retired).
schema
Scalable and secure schema design patterns for relational databases, NoSQL, and APIs. / TR: İlişkisel veri tabanları, NoSQL ve API'ler için ölçeklenebilir ve güvenli şema tasarım kalıpları.