warehouse-analysis

warehouse-analysis is a skill for Claude Code, Codex from tam159/next-role. It costs 91 tokens per session (1,199 once invoked), scanned A, original, MIT.

A guided method for answering questions with SQL against a ClickHouse data warehouse. A data warehouse stores organised records about activity, usage, reliability, and costs for analysis.

In plain words
What is it for?
Use it to investigate product usage, activity, reliability, or LLM costs with small, verified queries and summaries.
Why use it?
It reduces mistakes from querying unfamiliar tables or using the wrong date fields and SQL rules. It checks table structure, sample values, filters, and surprising results before reporting an answer.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to investigate product usage, activity, reliability, or LLM costs with small, verified queries and summaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tam159/next-role/warehouse-analysis
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 tam159/next-role --skill warehouse-analysis
Clone the repo
git clone --depth 1 https://github.com/tam159/next-role

Made for: Claude Code, Codex.

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 warehouse-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/tam159/next-role/warehouse-analysis/github.svg)](https://agentmods.dev/skills/tam159/next-role/warehouse-analysis)
Your own site
<a href="https://agentmods.dev/skills/tam159/next-role/warehouse-analysis"><img src="https://agentmods.dev/badge/skills/tam159/next-role/warehouse-analysis/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 warehouse-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/tam159/next-role/warehouse-analysis"><img src="https://agentmods.dev/badge/skills/tam159/next-role/warehouse-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,199 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 pass 7 Sept 2026
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.00091 $0.01199
Opus 5.5 $0.00036 $0.00480
Sonnet 5.5 $0.00018 $0.00240
Haiku 4.5 $0.00009 $0.00120

Measured 1mo ago against content hash 3848f948b67f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

warehouse-analysis 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.

backend/agents/analytics_agent/skills/analytics-agent/warehouse-analysis/SKILL.md · 98 lines

How it starts

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

Warehouse analysis

The loop

Work in small steps and let each one inform the next. Do not write a long query against a table you have not inspected.

  1. Orient. describe_data() once per conversation. It lists the marts, what one row of each means, how large they are, and the syntax rules below.
  2. Inspect. describe_data("<table>") before querying a table for the first time. Read the sort key and the caveats; they decide both correctness and speed.
  3. Count. SELECT count() FROM <table> WHERE <your filter> — a cheap check that your filter matches anything at all, before you build on it.
  4. Sample. SELECT * FROM <table> WHERE <filter> LIMIT 5. Actual values settle what enums contain, how dates are shaped, and where NULLs live.
  5. Aggregate. Now write the real query, with an explicit date window and an ORDER BY.
  6. Verify. Check a surprising result from a second angle before reporting it: a different grain, a neighbouring week, or a total that should match.

Writing queries that stay fast

  • Always filter on the table's sort key — the date column on every fact.
  • Always qualify names: nextrole_marts.fct_run.
  • Select the columns you need; SELECT * on a fact wastes the scan.
  • Aggregate in the warehouse. Do not pull rows out to count them.
  • The connection is capped at 30 seconds and 10,000 rows. Hitting either means the query is too broad, not that the cap is wrong.

ClickHouse syntax that differs from other dialects

Your memory carries the full list. The two that cause most failures:

  • Never alias to a name that is already a column. For any column x, sum(x) AS x makes every other mention of that name resolve to the alias, nesting one aggregate inside another (code 184). Use AS total_x, and check every aliased aggregate in the select list, not just the first.
  • "found in WHERE" is usually that same alias problem, not a WHERE/HAVING mistake: min(d) AS d with WHERE d >= '...' reports it, and the fix is to rename the alias. Only move a condition to HAVING when you really meant to filter on an aggregate — otherwise it silently filters the aggregate instead of each row.

Read the full file on GitHub · 98 lines

Files

What ships with it

2 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. 1mo ago First seen · 98 lines · 91 tokens per session scan A 3848f948b67f

Subscribe to this mod's changes

warehouse-analysis is a skill published in the GitHub repository tam159/next-role (62 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 1,199 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-06.

Related

Other skills, from other repositories

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

deepagents-thread-inspector

Inspect and explain conversations in the local Deep Agents Code SQLite session store. Use to look up the current thread's title or name, as a fallback when LangSmith trace tooling is unavailable, for offline or untraced sessions, or when asked to identify or summarize a local dcode thread, inspect checkpoint metadata…

langchain-ai/deepagents · 93 tokens

omni-db-backups

Trigger system backups, restore from backup files, and manage the SQLite database lifecycle. Supports export, import, and incremental snapshot strategies.

diegosouzapw/OmniRoute · 32 tokens

query-writing

Writes and executes SQL queries from simple SELECTs to complex multi-table JOINs, aggregations, and subqueries. Use when the user asks to query a database, write SQL, run a SELECT statement, retrieve data, filter records, or generate reports from database tables.

langchain-ai/deepagents · 57 tokens

ontology

Manage ontology schemas, concepts, alignments, and SHACL/OWL validation for Semantica knowledge graphs. Uses OntologyEngine and OntologyValidator.

semantica-agi/semantica · 33 tokens

query

Query Semantica knowledge graphs — in-memory ContextGraph search, SPARQL over RDF triple stores, and Cypher over LPG backends.

semantica-agi/semantica · 31 tokens