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.
npx skills add yaniv-golan/affinity-sdk --skill query-languagegit clone --depth 1 https://github.com/yaniv-golan/affinity-sdkWrote 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/skills/yaniv-golan/affinity-sdk/query-language)<a href="https://agentmods.dev/skills/yaniv-golan/affinity-sdk/query-language"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/query-language/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/skills/yaniv-golan/affinity-sdk/query-language"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/query-language.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.00027 | $0.03992 |
| Opus 5.5 | $0.00011 | $0.01597 |
| Sonnet 5.5 | $0.00005 | $0.00798 |
| Haiku 4.5 | $0.00003 | $0.00399 |
Grade A, and why
query-language 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 3d 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 — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Affinity Query Language
Structured query language for the query MCP tool. For simple lookups, prefer execute-read-command with individual CLI commands.
Before running queries, complete these pre-flight steps:
- Read the data model:
read-xaffinity-resource(uri: "xaffinity://data-model")- Discover relevant commands:
discover-commands(query: "your task keywords")- State what you learned from each step before proceeding
When to Use Query vs CLI Commands
| Need | Use |
|---|---|
| Simple lookup by name/email/ID | execute-read-command with person get / company get |
| Quick search | execute-read-command with person ls --query "..." |
| List metadata | execute-read-command with list ls / field ls |
| Write operations | execute-write-command |
| Complex AND/OR/NOT filtering | query |
| Aggregation / groupBy | query |
| Cross-entity filtering (quantifiers) | query |
| Include related entities | query |
| Computed data (interaction dates, unreplied) | query |
| Preview API cost before running | query with dryRun: true |
Quick Start
// Simplest query - get 10 persons
{"from": "persons", "limit": 10}
// Add a filter (companies/persons: filter on a field)
{"from": "companies", "where": {"path": "fields.Industry", "op": "eq", "value": "Software"}, "limit": 10}
// Include related companies
{"from": "persons", "include": ["companies"], "limit": 10}
// Query list entries (MUST filter by listName or listId)
{"from": "listEntries", "where": {"path": "listName", "op": "eq", "value": "Dealflow"}, "limit": 10}
Query Structure
{
"$version": "1.0",
"from": "persons",
"where": {"and": [
{"path": "fields.Seniority", "op": "eq", "value": "Executive"},
{"path": "primaryEmailAddress", "op": "contains", "value": "@acme.com"}
]},
"select": ["id", "firstName", "lastName", "primaryEmailAddress"],
"include": ["companies", "opportunities"],
"expand": ["interactionDates"],
"groupBy": "fields.Status",
"aggregate": {"count": {"count": true}, "total": {"sum": "fields.Deal Value"}},
"having": {"path": "count", "op": "gte", "value": 5},
"orderBy": [{"field": "lastName", "direction": "asc"}],
"limit": 100
}
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3d ago Changed 5d5153502201
- 24d ago Changed · +22 lines b42517e1734a
- 2mo ago First seen · 298 lines · 27 tokens per session scan A abd1f2d4d162
query-language is a skill published in the GitHub repository yaniv-golan/affinity-sdk (2 stars, last pushed 3d ago), licensed MIT. It adds 27 tokens to every session and 3,992 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.
query-language compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| query-languageyaniv-golan/affinity-sdk | Skill | 2 | 3d ago | MIT | A | 27 | Claude Code |
| merit-lhvElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 227 | Claude Code |
| merit-payments-bankElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 215 | Claude Code |
| merit-tsdElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 298 | Claude Code |
| merit-purchase-invoicesElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 199 | Claude Code |
| merit-stripeElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 201 | Claude Code |
| merit-vat-kmdElnora-AI/elnora-merit-aktiva | Skill | 10 | 5d ago | Apache-2.0 | A | 213 | Claude Code |