write-nql

write-nql is a skill for Claude Code from narrative-io/narrative-skills-marketplace. It costs 133 tokens per session (9,438 once invoked), scanned A, original, MIT.

A skill for writing and checking NQL, the query language used to ask questions of Narrative datasets.

In plain words
What is it for?
It helps turn natural-language questions into validated NQL queries, explain those queries, and run them only when the user approves.
Why use it?
It prevents unsupported fields or functions from being used and checks that a query compiles before showing it, while explaining cost and data limitations.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the AskUserQuestion tool; mentions Claude Code.

Part of the narrative-common plugin — 7 skills shipped together

Good fit It helps turn natural-language questions into validated NQL queries, explain those queries, and run them only when the user approves.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/narrative-io/narrative-skills-marketplace/write-nql
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 narrative-io/narrative-skills-marketplace --skill write-nql
Clone the repo
git clone --depth 1 https://github.com/narrative-io/narrative-skills-marketplace

Made for: Claude Code.

Or install narrative-common, the plugin that ships this one along with the rest of its 7 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 write-nql

README.md
[![agentmods](https://agentmods.dev/badge/skills/narrative-io/narrative-skills-marketplace/write-nql/github.svg)](https://agentmods.dev/skills/narrative-io/narrative-skills-marketplace/write-nql)
Your own site
<a href="https://agentmods.dev/skills/narrative-io/narrative-skills-marketplace/write-nql"><img src="https://agentmods.dev/badge/skills/narrative-io/narrative-skills-marketplace/write-nql/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 write-nql

Your own site · 80×15
<a href="https://agentmods.dev/skills/narrative-io/narrative-skills-marketplace/write-nql"><img src="https://agentmods.dev/badge/skills/narrative-io/narrative-skills-marketplace/write-nql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,438 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high System Prompt Leakage · line 92
    Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
    Fix: Remove any instructions that reveal, print, or output system prompts or internal rules. System instructions should never be exposed to end users.
  • medium Excessive Agency · line 814
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Excessive Agency · line 819
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00133 $0.09438
Opus 5 $0.00067 $0.04719
Sonnet 5 $0.00027 $0.01888
Haiku 4.5 $0.00013 $0.00944

Measured 11d ago against content hash 143ec08ef134, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

write-nql 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 11d 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.

plugins/narrative-common/skills/write-nql/SKILL.md · 840 lines

How it starts

The opening of the file, as written. The whole thing — 840 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write NQL

Persona

You are a senior data analyst who turns natural-language questions into NQL queries against Narrative datasets. You optimize for:

  1. Correctness — every query is server-validated before it is shown.
  2. Cost — the cheapest query that answers the question; default to LIMIT and aggregations over raw scans.
  3. Transparency — every query gets a plain-English explanation with data-freshness, approximation, and cost caveats up front.

You never invent a column or function, never display an unvalidated query, and never claim a result until the job reports completed.

Output rules

Don't surface _nio_* field names to the user. Columns and fields whose names start with _nio_ (e.g., _nio_last_modified_at, _nio_sample_128) are platform-managed internals. Handle them silently as this skill instructs — filtering, skipping, or accepting auto-generated mappings — but do not name them in user-facing output: lists, tables, summaries, warnings, status messages, or final responses. Refer to them generically ("platform-managed columns", "reserved internal fields") if you need to acknowledge them at all.

Exception: if the user expressly asks about _nio_* fields, answer normally.

Overview

Turn a natural-language question into a validated NQL query against a Narrative dataset, explain the query back in plain English, and run it when (and only when) the user asks for it.

The validate step is non-negotiable. The execute step is opt-in: either the user passed --run when invoking the skill, or the skill asks explicitly at the end.

Exit criteria — every invocation MUST end in one of these states

This is the acceptance contract for the whole skill. A turn that ends in any other state is a failed invocation, no matter how many steps completed along the way.

  1. Delivered: a validated NQL query in a ```sql block plus its plain-English explanation (plus results, if execution was approved and completed).
  2. Blocked: a blocker report naming (a) which step failed, (b) the tool error verbatim — never paraphrased, and (c) what you already tried. End with the concrete question or retry option the user can act on.
  3. Awaiting input: a specific question to the user, when a genuine decision is theirs (dataset choice, refinement, run approval).
  4. Handed off: the validated NQL (in a ```sql block) passed to another skill or agent that owns the next step — running it, embedding it in a workflow, wrapping it in a materialized view. State plainly which skill or agent received it and what you asked it to do. The query must be validated before handoff; a handoff is not an escape hatch for skipping the validate step.

Read the full file on GitHub · 840 lines

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. 11d ago First seen · 840 lines · 133 tokens per session scan A 143ec08ef134

Subscribe to this mod's changes

write-nql is a skill published in the GitHub repository narrative-io/narrative-skills-marketplace (8 stars, last pushed today), licensed MIT. It adds 133 tokens to every session and 9,438 once invoked, about $0.0007 per session on Opus 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

Other skills, from other repositories

ops-demo

CocoOps demo mode activator — populates .cocoplus/ops/demo/ with realistic mock data and sets cocoplus.toml [demo] enabled = true. Invoked via $ops demo.

Snowflake-Labs/cocoplus · 46 tokens

managing-astro-local-env

Manage local Airflow environment with Astro CLI (Docker and standalone modes). Use when the user wants to start, stop, or restart Airflow, view logs, query the Airflow API, troubleshoot, or fix environment issues. For project setup, see setting-up-astro-project.

astronomer/agents · 63 tokens

agent-teams-simplify-and-harden

Implementation + audit loop using parallel agent teams with structured simplify, harden, and document passes. Spawns implementation agents to do the work, then audit agents to find complexity, security gaps, and spec deviations, then loops until code compiles cleanly, all tests pass, and auditors find zero issues or…

LeoYeAI/openclaw-master-skills · 115 tokens

checking-freshness

Quick data freshness check. Use when the user asks if data is up to date, when a table was last updated, if data is stale, or needs to verify data currency before using it.

astronomer/agents · 44 tokens

agent-team-orchestration

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team of 2+ agents with different specializations, (2) Defining task routing and lifecycle (inbox → spec → build → review → done), (3) Creating handoff protocols between agents, (4)…

LeoYeAI/openclaw-master-skills · 102 tokens

agent-bom-enforce

Enforce security policies on MCP tool calls and block dangerous operations at runtime. Use when: "block risky calls", "apply policy", "proxy", "runtime protection", "policy enforcement", "intercept MCP calls".

LeoYeAI/openclaw-master-skills · 50 tokens