query-pkg

query-pkg is a skill for Claude Code, Codex from sparq-org/sparq. It costs 188 tokens per session (6,229 once invoked), scanned A, original, MIT.

A method for answering questions about a project by querying its Project Knowledge Graph, a searchable store of facts from project documents, skills, and tasks.

In plain words
What is it for?
Use it to find what the repository says about a topic, where a decision was recorded, the status or origin of a fact, unexplored sources, or task dependencies.
Why use it?
It avoids reading whole documents when the needed fact can be retrieved as a small, focused result, while returning no answer when the graph has no matching information.

Skill for Claude CodeCodex

Part of the sparq plugin — 55 skills, 20 agents, 2 hooks shipped together

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.

agentmods
npx agentmods add skills/sparq-org/sparq/query-pkg
Any agent
npx skills add sparq-org/sparq --skill query-pkg
Clone the repo
git clone --depth 1 https://github.com/sparq-org/sparq

Made for: Claude Code, Codex.

Or install sparq, the plugin that ships this one along with the rest of its 55 skills, 20 agents, 2 hooks.

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-pkg

README.md
[![agentmods](https://agentmods.dev/badge/skills/sparq-org/sparq/query-pkg.svg)](https://agentmods.dev/skills/sparq-org/sparq/query-pkg)
Your own site
<a href="https://agentmods.dev/skills/sparq-org/sparq/query-pkg"><img src="https://agentmods.dev/badge/skills/sparq-org/sparq/query-pkg.svg" alt="Measured on agentmods" height="20"></a>
Per session 188 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,229 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00188 $0.06229
Opus 5 $0.00094 $0.03114
Sonnet 5 $0.00038 $0.01246
Haiku 4.5 $0.00019 $0.00623

Measured 5d ago against content hash b7a661cac57f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

query-pkg 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 5d 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.

.claude/skills/query-pkg/SKILL.md · 397 lines

How it starts

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

Query the PKG — introspect → ground → ask

[OPUS-4.8] Bead sq-2m6zm.3 (epic sq-2m6zm). Design record: research/dogfooding-sparq-knowledge-graph.md (§4.1 frontier queries, §6 worked questions). 🤖 SPARQ agent — dogfooding sparq as a project knowledge graph.

The PKG is sparq's own knowledge stored as RDF triples: pkg:Findings (sourced, confidence-tagged discoveries from AGENTS.md), pkg:Sources (skills / docs with an explored-status), pkg:Techniques (the surfaces), and pkg:Tasks (the bd backlog projected to RDF with pkg:dependsOn edges). Instead of Read-ing a whole document to find one fact, run a SPARQL query and read the answer-sized result. The answer is computed by sparq's own engine over the ingested graph — within the store the agent cannot fabricate a fact the data does not contain (the engine bounds the result set), and an empty result is the honest "I don't know / none outstanding" answer.

Honesty. This skill is the mechanism. The cost saving versus reading the source document is now MEASURED (bead sq-zbyo7, the agent-flavour cheap-model NL-tool: ≈ 30× cheaper in $ than read-docs at equal quality on PKG-answerable tasks); the full table, method, and honest caveats live in bench/pkg-dogfood/RESULTS.md (the sanctioned measurement record) — this file only points at the headline. The win is scoped to PKG-answerable questions by construction. The PKG is a Phase-1 head slice (the AGENTS.md finding set + a mechanical bd→Task projection + the heaviest skills' front-matter + the trust-graph admission-program provenance tier of sq-7utko — sourced, caveat-carrying findings from research/trust-graph-authorisation-2026-07.md, e.g. "unlinkability is NOT a v1 guarantee, gated on sq-qhy4"), not the whole corpus — a miss means "not in the head slice yet", so fall back to Read/Grep.

The helper

One command, in crates/sparq-kb, behind the default-OFF query feature (keeps the lean default build a pure data crate):

Read the full file on GitHub · 397 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. 5d ago First seen · 397 lines · 188 tokens per session scan A b7a661cac57f

Subscribe to this mod's changes

query-pkg is a skill published in the GitHub repository sparq-org/sparq (10 stars, last pushed today), licensed MIT. It adds 188 tokens to every session and 6,229 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-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 tokens