query-graph

query-graph is a skill for Claude Code from ayeshakhalid192007-dev/graph-engineering-crash-course. It costs 34 tokens per session (1,278 once invoked), scanned A, original, MIT.

A skill that loads a graph schema into a local SQLite database and answers graph questions with SQL. SQLite is a small database stored in a file.

In plain words
What is it for?
It helps query the nodes and edges tables, build the database when needed, and check relationship metadata while enforcing SQLite foreign-key rules.
Why use it?
It avoids repeatedly reasoning over the original source material and provides database-backed answers about availability and edge provenance.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths; mentions Claude Code.

Good fit It helps query the nodes and edges tables, build the database when needed, and check relationship metadata while enforcing SQLite foreign-key rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph
Install

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.

Any agent
npx skills add ayeshakhalid192007-dev/graph-engineering-crash-course --skill query-graph
Clone the repo
git clone --depth 1 https://github.com/ayeshakhalid192007-dev/graph-engineering-crash-course

Made for: Claude Code.

Wrote 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.

agentmods badge for query-graph

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph/github.svg)](https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph)
Your own site
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph/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.

agentmods 80×15 button for query-graph

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/query-graph.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,278 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.01278
Opus 5.5 $0.00014 $0.00511
Sonnet 5.5 $0.00007 $0.00256
Haiku 4.5 $0.00003 $0.00128

Measured 1mo ago against content hash cfbc8c5f7283, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

query-graph 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 1mo 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.

starters/sqlite-backed-graph/.claude/skills/query-graph/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

query-graph

Turns schema.sql into a queryable graph.db file, then answers a question against the two tables it defines — an availability check on a tool, or a provenance lookup on a specific edge — by running SQL, not by re-reasoning over the Elm Street chat from scratch each time.

Instructions

You are a Claude Code skill implementing the sqlite-backed-graph pattern. Follow these steps in order:

  1. Load the database if it isn't already loaded. Check whether graph.db exists in this kit's root. If it doesn't, build it by running schema.sql against a fresh file: sqlite3 graph.db < schema.sql, or, if the sqlite3 CLI isn't available, the Python equivalent: python3 -c "import sqlite3; sqlite3.connect('graph.db').executescript(open('schema.sql').read())". If graph.db already exists, leave it as is rather than reloading it — this step must be safe to skip on a second run.
  2. Turn on foreign key enforcement for this connection. SQLite does not enforce REFERENCES constraints unless the connection asks for it, so every query in this skill must run PRAGMA foreign_keys = ON; first, even against an already-loaded graph.db.
  3. Resolve the question. Default to this kit's worked question if the user doesn't name one: check whether the stud finder can be borrowed right now, and confirm the ladder's status too — which means running the availability query from step 4 against both tool-ladder and tool-stud-finder.
  4. Run the availability query per tool. For a given tool id, find its most recent borrowed edge by id (edge ids climb in the same order the source messages arrived, so the highest id is the latest borrowed edge):
    SELECT id, from_id FROM edges
    WHERE label = 'borrowed' AND to_id = :tool_id
    ORDER BY id DESC LIMIT 1;
    
    If no row comes back, the tool has never left its owns edge and is available. If a row comes back, check for a matching returned edge with a higher id:
    SELECT id FROM edges
    WHERE label = 'returned' AND to_id = :tool_id AND from_id = :borrower
      AND id > :borrowed_edge_id;
    
    A match means available (the tool came back); no match means still out with :borrower. Name the specific edge id(s) that produced the verdict — never report a verdict without the row backing it.
  5. Run the provenance query on request, or on the edge that grounded step 4's verdict. For a specific edge id:
    SELECT source_doc, extraction_run_id, schema_version FROM edges
    WHERE id = :edge_id;
    
    This is the receipt-per-edge fields doing their job here: naming which source document, which extraction run, and which schema version produced the edge the verdict rests on.
  6. Write the result to output.json (or the path the user requested) in this kit's root, with this shape: queries (an array, one entry per tool or edge checked, each carrying the SQL text run and its raw result), and verdicts (one entry per tool, with tool, available, grounding_edge_id, and — if not available — held_by).
  7. Report a summary alongside the file: each tool's verdict, the edge id(s) it rests on, and that verdict's provenance (source document, run id, schema version) via step 5's lookup.

Read the full file on GitHub · 116 lines

Changes

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.

  1. 1mo ago First seen · 116 lines · 34 tokens per session scan A cfbc8c5f7283

Subscribe to this mod's changes

query-graph is a skill published in the GitHub repository ayeshakhalid192007-dev/graph-engineering-crash-course (5 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 1,278 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.

Related

Other skills, from other repositories

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

mongodb

Use when modeling MongoDB documents (embed versus reference, the 16MB cap, bucket and subset patterns), choosing or fixing indexes (compound order by the ESR rule, partial, TTL, multikey, reading explain), writing aggregation pipelines that stay index-eligible, running multi-document transactions with retry, or…

ericrisco/rsc-harness · 118 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens

aws-essentials

Use when standing up the core AWS surface a small product needs: hardening a fresh account, a private S3 bucket, encrypted RDS Postgres, ECS Fargate vs EC2, CloudFront + OAC, or scoping an IAM policy to least privilege. NOT the CI pipeline that ships the container (that is deployment), NOT app-code access-control…

ericrisco/rsc-harness · 89 tokens

db-migrations

Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is postgresdb), NOT drizzle-kit mechanics (that is…

ericrisco/rsc-harness · 90 tokens

dynamodb

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…

ericrisco/rsc-harness · 82 tokens