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 divinevideo/divine-mobile --skill ndk-batch-event-queriesgit clone --depth 1 https://github.com/divinevideo/divine-mobileWrote 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/divinevideo/divine-mobile/ndk-batch-event-queries)<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/ndk-batch-event-queries"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/ndk-batch-event-queries/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/divinevideo/divine-mobile/ndk-batch-event-queries"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/ndk-batch-event-queries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00109 | $0.01070 |
| Opus 5.5 | $0.00044 | $0.00428 |
| Sonnet 5.5 | $0.00022 | $0.00214 |
| Haiku 4.5 | $0.00011 | $0.00107 |
Grade A, and why
ndk-batch-event-queries 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 1mo 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 — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
NDK Batch Event Queries
Problem
When checking if many Nostr events exist (e.g., 300 videos for a user), querying one-by-one causes hundreds of sequential relay round-trips, making the operation extremely slow (minutes instead of seconds).
Context / Trigger Conditions
- Loop with
await fetchEvents()inside, checking events individually - Processing takes minutes when it should take seconds
- Checking existence of addressable events (Kind 30000-39999) by d-tag
- Need to find which items from a list already exist on a relay
Solution
NDK's fetchEvents filter accepts arrays for most fields. Instead of:
// SLOW: 300 sequential queries
for (const id of vineIds) {
const exists = await ndk.fetchEvents({
kinds: [34236],
authors: [pubkey],
"#d": [id], // Single value
});
}
Use a batch query:
// FAST: 1-3 queries (chunked if needed)
const CHUNK_SIZE = 100; // Relays may limit query size
const existingIds = new Set<string>();
for (let i = 0; i < vineIds.length; i += CHUNK_SIZE) {
const chunk = vineIds.slice(i, i + CHUNK_SIZE);
const events = await ndk.fetchEvents({
kinds: [34236],
authors: pubkeys, // Can also be an array
"#d": chunk, // Array of d-tag values
});
for (const event of events) {
const dTag = event.tags.find(t => t[0] === "d");
if (dTag?.[1]) existingIds.add(dTag[1]);
}
}
// O(1) lookup in processing loop
for (const id of vineIds) {
if (existingIds.has(id)) continue; // Skip existing
// Process new items...
}
Key Points
- Array filters:
#d,#p,#e,authorsall accept arrays - Chunk size: Use 50-100 items per query to avoid relay limits
- Multiple authors: Pass array of pubkeys if checking across users
- Extract results: Parse the d-tag from returned events to build a Set
Verification
- Processing time drops from minutes to seconds
- Total relay connections decrease dramatically
- Same results as individual queries (verified by comparison)
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.
- 1mo ago First seen · 134 lines · 109 tokens per session scan A 5ff60c67bc82
ndk-batch-event-queries is a skill published in the GitHub repository divinevideo/divine-mobile (264 stars, last pushed today), licensed MPL-2.0. It adds 109 tokens to every session and 1,070 once invoked, about $0.0004 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-09-03.
Other skills, from other repositories
web3-fullstack-packaged-build
Systematic full-stack Web3 build with mandatory packaging and delivery phase.
web3-fullstack-systematic-build
Systematic approach to building full-stack Web3 applications layer by layer.
devtools-event-client
Create typed EventClient for a library. Define event maps with typed payloads, pluginId auto-prepend namespacing, emit()/on()/onAll()/onAllPluginEvents() API. Connection lifecycle (5 retries, 300ms), event queuing, enabled/disabled state, SSR fallbacks, singleton pattern. Unique pluginId requirement to avoid event…
solana-dev
Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "fuzz my Solana program", "deploy to devnet", "send a v1 transaction", "support larger transactions", "fix maxSupportedTransactionVersion", or "explain…
walkeros-create-destination
Use when creating a new walkerOS destination to send events to a vendor or API (GA4/gtag, Meta/Facebook Pixel, Mixpanel, Amplitude, a custom HTTP API, Measurement Protocol), web or server-side. Example-driven workflow: research the vendor SDK and define step examples before implementing the destination interface, env…
walkeros-create-source
Use when creating a new walkerOS source to capture events (browser source, dataLayer interception, server/HTTP source, webhook receiver, event capture), web or server-side. Example-driven workflow: research the input format and define step examples before implementing the push interface, createTrigger, and env pattern.