MITupdated 7d ago
bonez:query runs BGQ — the org's graph query language — over the whole indexed org: code symbols, files, PRs, tickets, docs, people, knowledge, and the edges between them.
What can you do with Querying The Graph?
name: querying-the-graph description: Traverse the org graph with BGQ via bonez:query. Use when a question is about relationships or structure — what calls, imports, tests, or depends on X, what is connected to a ticket or PR, which code touches a table — or when search has found a seed and you need its neighborhood.
Querying the graph
bonez:query runs BGQ — the org's graph query language — over the whole indexed org: code symbols, files, PRs, tickets, docs, people, knowledge, and the edges between them.
The loop
bonez:search → bonez:schema → bonez:query → bonez:fetch
searchfinds seeds by intent when you don't have one.schematells you the graph's real shape when you don't know it.querytraverses.fetchdereferences result handles into full records.
The one hard rule: never guess node types or edges
The ontology is data, not convention. An invented edge or node type doesn't error — it returns empty, and empty looks exactly like "no results". If you are not certain of the shape, call bonez:schema FIRST:
{"search": "how are pull requests linked to tickets"}
or exact-lookup what you think you know:
{"node_types": ["github/pull_request", "ticket"], "edges": ["PART_OF"]}
Writing queries
The authoritative BGQ grammar and the recipe catalog (callers, blast radius, tests-for, importers, data access, knowledge-for, …) live in the bonez:query tool description — read it there; it is updated server-side and outranks anything remembered here. Seeds accept ~handles straight from search/fetch results:
{"q": "from ~a1b2c3d4 callers", "repos": ["harness-ui"]}
Judgment
- Empty result + unverified schema = suspect the query, not the graph. Verify the shape with
schema, correct, retry once. Only then report emptiness — and report it as "this traversal found nothing", not "nothing exists". - Scope deliberately. Omitting
reposqueries the whole org — that is the superpower (cross-repo edges grep can't see) and the noise source. Narrow to the working repo for repo-local questions. - The graph lags your working tree.
refpins a branch/commit; the default is the indexed default branch. Uncommitted or just-pushed changes are invisible — for "what does the code say right now", read the file; for "how is the org wired", query the graph. - Big traversals need summarizing. Hundreds of results are a distribution, not a list — report counts and clusters, fetch only representatives.
Hand-offs
- Change-safety questions with ready-made recipes →
impact-analysis. - No seed yet →
finding-prior-artfor the search-first workflow.
Install
Add Querying The Graph to your client. Pick the one you use.
npx skills add bonez-io/ai-pluginInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add bonez-io/ai-pluginAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/bonez-io/ai-plugin
cp -r codex/skills/querying-the-graph ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
Score
71 / 100
Good