query-language

query-language is a skill for Claude Code from yaniv-golan/affinity-sdk. It costs 27 tokens per session (3,992 once invoked), scanned A, original, MIT.

A way to run structured JSON queries against Affinity, a customer-relationship management system for tracking people, companies, and interactions.

In plain words
What is it for?
Filtering records with combined conditions, grouping and counting data, searching through related entities, including connected records, calculating relationship details, and previewing query cost.
Why use it?
It handles complex filters, summaries, related records, and calculated information that simple individual lookups cannot provide.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the affinity-crm-mcp-unofficial plugin — 3 skills shipped together , and of affinity-crm-mcp-unofficial

Good fit Filtering records with combined conditions, grouping and counting data, searching through related entities, including connected records, calculating relationship details, and previewing query cost.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yaniv-golan/affinity-sdk/query-language
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 yaniv-golan/affinity-sdk --skill query-language
Clone the repo
git clone --depth 1 https://github.com/yaniv-golan/affinity-sdk

Made for: Claude Code.

Or install affinity-crm-mcp-unofficial, the plugin that ships this one along with the rest of its 3 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/query-language/github.svg)](https://agentmods.dev/skills/yaniv-golan/affinity-sdk/query-language)
Your own site
<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.

agentmods 80×15 button for query-language

Your own site · 80×15
<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>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,992 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.00027 $0.03992
Opus 5.5 $0.00011 $0.01597
Sonnet 5.5 $0.00005 $0.00798
Haiku 4.5 $0.00003 $0.00399

Measured 3d ago against content hash 5d5153502201, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

mcp/.claude-plugin/skills/query-language/SKILL.md · 320 lines

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:

  1. Read the data model: read-xaffinity-resource(uri: "xaffinity://data-model")
  2. Discover relevant commands: discover-commands(query: "your task keywords")
  3. 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
}

Read the full file on GitHub · 320 lines

Files

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.

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. 3d ago Changed 5d5153502201
  2. 24d ago Changed · +22 lines b42517e1734a
  3. 2mo ago First seen · 298 lines · 27 tokens per session scan A abd1f2d4d162

Subscribe to this mod's changes

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.

Related

query-language compared with skills from other repositories

query-language next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
query-languageyaniv-golan/affinity-sdkSkill23d agoMITA27Claude Code
merit-lhvElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A227Claude Code
merit-payments-bankElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A215Claude Code
merit-tsdElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A298Claude Code
merit-purchase-invoicesElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A199Claude Code
merit-stripeElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A201Claude Code
merit-vat-kmdElnora-AI/elnora-merit-aktivaSkill105d agoApache-2.0A213Claude Code