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/arango-solutions/arango-sparql-pyWrote 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/arango-solutions/arango-sparql-py/300-nl2sparql)<a href="https://agentmods.dev/rules/arango-solutions/arango-sparql-py/300-nl2sparql"><img src="https://agentmods.dev/badge/rules/arango-solutions/arango-sparql-py/300-nl2sparql.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/arango-solutions/arango-sparql-py/300-nl2sparql"><img src="https://agentmods.dev/badge/rules/arango-solutions/arango-sparql-py/300-nl2sparql.svg?style=web" alt="Reviewed on agentmods" width="80" height="15"></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.00000 | $0.00621 |
| Opus 5 | $0.00000 | $0.00311 |
| Sonnet 5 | $0.00000 | $0.00124 |
| Haiku 4.5 | $0.00000 | $0.00062 |
Grade A, and why
300-nl2sparql 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 8d 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 — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.
NL→SPARQL rules
Structure (mirror arango_cypher/nl2cypher/)
_core.py— pipeline orchestrator andNL2SparqlResultdataclass.providers.py—LLMProviderprotocol + concreteOpenAIProvider,AnthropicProvider, plus the test-onlyScriptedProvidermock.fewshot.py— BM25-backed few-shot index over a curated corpus.tenant_guardrail.py+tenant_scope.py— same multitenancy posture as Cypher: physical-tenant collection rewriting and prompt-side scope hints, enforced before the AQL ever runs.entity_resolution.py— optional ER hook (mirrors Cypher's)._aql.py— final AQL emission step (translates the LLM's SPARQL through the same parser/visitor/builder pipeline the/translateendpoint uses; never asks the LLM for AQL directly).
Prompt construction
- Always provide the OWL ontology in Turtle (
.ttl) as the schema context. LLMs read Turtle far better than JSON-LD or XML. Generate Turtle fromarango-schema-mapper's OWL output. - Prompt header: pin the SPARQL dialect (
SPARQL 1.1), forbid vendor extensions, require fully-qualified IRIs (no bare prefixes the model invents), and constrain output to a fencedsparqlblock. - Few-shot examples come from the BM25 index over a curated YAML corpus; never inline more than 3 shots — token budget is real.
Result type
NL2SparqlResultcarries:sparql,explanation,confidence,method("llm"|"rule_based"|"cached"),schema_context,prompt_tokens,completion_tokens,total_tokens,cached_tokens,retries. Match Cypher'sNL2CypherResultfield-for-field where the semantics carry over — easier cross-repo telemetry.
Caching / corrections
- Persist user corrections in
nl_corrections.db(SQLite, WAL mode), identical schema shape to Cypher. Lookups happen before any LLM call.
Forbidden
- Asking the LLM to emit AQL directly. The LLM's job is SPARQL only; the deterministic transpiler turns SPARQL into AQL.
- Inlining the entire OWL ontology when a tenant-scoped slice would do — pre-trim the Turtle to the tenant's reachable classes/properties.
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.
- 8d ago First seen · 49 lines · 0 tokens per session scan A 214d952907ee
300-nl2sparql is a cursor rule published in the GitHub repository arango-solutions/arango-sparql-py (2 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 621 tokens. 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
baml
A set of rules for setting up BAML and help with syntax guidance.
co-dialectic
Co-Dialectic prompt sharpening and verification rules for Cursor.
prompt-routing
Route tasks to the correct Universal AI Engineering Prompt.
prompting-for-qe
Soạn/tinh chỉnh prompt cho tác vụ QE (sinh test case, phân tích requirement, tóm tắt tài liệu test, phân tích log) — đặc biệt khi output AI lan man, chung chung, bịa, hoặc muốn chốt prompt thành template tái dùng.
llm-zod-jsonschema
Best Practice for LLM Output Parsing with Zod and JSON Schema.
prompt-evals
Prompt eval fixtures — case design, assertions, versioning, CI gates, no PII in golden data.