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 agentmods add commands/upstash/skills/queryinggit clone --depth 1 https://github.com/upstash/skillsWhat 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 | $0.00000 | $0.01919 |
| Opus 5 | $0.00000 | $0.00959 |
| Sonnet 5 | $0.00000 | $0.00384 |
| Haiku 4.5 | $0.00000 | $0.00192 |
Grade A, and why
querying 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- querying — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 316 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Querying & Counting
Overview
Query documents from a search index using type-safe filters with support for pagination, sorting, field selection, scoring, and highlighting. Count matching documents efficiently without returning results.
Good For
- Full-text search with fuzzy matching and phrase queries
- Filtering by numeric ranges, dates, booleans, keywords
- Paginated results with sorting
- Highlighting search terms in results
- Counting documents matching a filter
Examples
Basic Query
import { Redis, s } from "@upstash/redis";
const redis = Redis.fromEnv();
const index = await redis.search.createIndex({
name: "products",
prefix: "product:",
dataType: "json",
schema: s.object({
name: s.string(),
price: s.number("F64"),
category: s.keyword(),
inStock: s.boolean(),
}),
});
// Insert data
await redis.json.set("product:1", "$", {
name: "Gaming Laptop",
price: 1299.99,
category: "electronics",
inStock: true,
});
await redis.json.set("product:2", "$", {
name: "Wireless Mouse",
price: 29.99,
category: "electronics",
inStock: true,
});
await redis.json.set("product:3", "$", {
name: "Laptop Stand",
price: 49.99,
category: "accessories",
inStock: false,
});
await index.waitIndexing();
// Query with filter and return data
const results = await index.query({
filter: { category: { $eq: "electronics" } },
select: { name: true, price: true },
});
// [
// { key: "product:1", score: ..., data: { name: "Gaming Laptop", price: 1299.99 } },
// { key: "product:2", score: ..., data: { name: "Wireless Mouse", price: 29.99 } },
// ]
Keys Only (No Data)
// Set select to {}
const keysOnly = await index.query({
filter: { inStock: { $eq: true } },
select: {},
});
// [{ key: "product:1", score: ... }, { key: "product:2", score: ... }]
Pagination
const page2 = await index.query({
filter: { category: { $eq: "electronics" } },
select: { name: true },
limit: 10,
offset: 10, // skip first 10 results
});
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 First seen · 316 lines · 0 tokens per session scan A 40e38f2bfb44
querying is a command published in the GitHub repository upstash/skills (23 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,919 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-30.
Other commands, from other repositories
semantic-change-check
Audit changes to dbt Semantic Layer definitions for breaking changes and aggregation risks.
add-migration
Create a new Alembic database migration for the backend.
create-drizzle-repository
Scaffold a new Drizzle-backed repository by defining a domain port, implementing it with typed Drizzle queries, and wiring it into DI to provide consistent, testable persistence whenever a use case needs read/write access to a new or refactored table.
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.