Agent skill

Datajunction Query

by DataJunction in DataJunction/dj

Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs.

MITAuto-check passedBackend & APIs

Install Datajunction Query

skills CLI
$ npx skills add DataJunction/dj --skill datajunction-query -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install DataJunction/dj datajunction-query --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/DataJunction/dj.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/datajunction/skills/datajunction-query .claude/skills/datajunction-query && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
datajunction-query
GitHub stars
161
Token cost
~2k tokens
SKILL.md length
800 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs.

  • Tasks that involve GraphQL
  • SKILL.md covers DJ UI (Web), Discovery & Exploration (Use…, Querying & SQL Generation (Use… and API Reference (Educational…
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve SQL

What it does

Datajunction Query is an agent skill from DataJunction/dj. Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs. Keywords: - query metric, query metrics - generate SQL - available dimensions, common dimensions - searchnodes, getnodedetails, getnodelineage - getcommon, buildmetricsql, getmetricdata - visualize metrics - MCP tools, GraphQL - DJ UI

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering GraphQL, SQL and MCP servers. It works with SQL and GraphQL. The licence is MIT.

When your agent uses it

  • Tasks that involve GraphQL
  • Tasks that involve SQL
  • Tasks that involve MCP servers

Example prompts

  • “/datajunction-query”

What it can do on your machine

Read from SKILL.md and the folder at commit 519835c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and graphql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Datajunction Query loads about 2k tokens when it runs. Until then it costs about 115 tokens; SKILL.md has 800 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from DataJunction/dj at commit 519835c, republished under its MIT licence (© DataJunction). 800 words, ~1,960 tokens.

Download SKILL.mdSave it as .claude/skills/datajunction-query/SKILL.md (or your agent's skills folder).
name
datajunction-query
description
Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs. Keywords: - query metric, query metrics - generate SQL - available dimensions, common dimensions - search_nodes, get_node_details, get_node_lineage - get_common, build_metric_sql, get_metric_data - visualize metrics - MCP tools, GraphQL - DJ UI
user-invocable
false

DataJunction Query

Consumer-side workflow for DJ: find existing nodes, build SQL to query them, fetch data, visualize results. For the underlying concepts (node types, dimension links, star schema), invoke the datajunction skill.

DJ UI (Web)

For interactive exploration — browsing namespaces, inspecting a node's lineage / SQL / available dimensions, building queries by clicking dimensions on/off — the DJ web UI is usually the fastest path. It's hosted at the same URL as the DJ server (e.g. https://your-dj-server.example.com/).

Use the UI when:

  • The user wants to look around — browse what exists, read a node's description, explore lineage visually
  • They want to build a query interactively and copy the SQL out
  • They're sharing a node or query with a teammate (UI URLs are shareable links)

Use the MCP tools / API (below) when:

  • You need programmatic access — pulling node names into a script, generating SQL as part of a workflow, fetching data into a notebook
  • The interaction is "give me this answer," not "let me explore"

Suggest opening the UI when the user's question is exploratory and you don't yet know the right node name. Suggest MCP tools when you have a name in hand and need data, lineage, or generated SQL.

Discovery & Exploration (Use MCP Tools)

When you need to explore the DJ semantic layer, use these MCP tools:

Find Available Nodes

Use MCP tool: search_nodes

  • Search for metrics, dimensions, cubes by name or namespace
  • Filter by node type
  • Returns list of matching nodes

Example: search_nodes(query="revenue", node_type="metric", namespace="finance")

Get Node Details

Use MCP tool: get_node_details

  • Get comprehensive information about a specific node
  • Returns: SQL definition, description, available dimensions, lineage, tags
  • Input: Full node name (e.g., "finance.total_revenue")

Example: get_node_details(name="finance.total_revenue")

What you get:

  • Description and SQL definition
  • All available dimensions (via dimension links)
  • Metric metadata (unit, direction, required dimensions)
  • Upstream dependencies
  • Tags and collections
Check Common Dimensions

Use MCP tool: get_common

  • Find dimensions shared across multiple metrics, or metrics shared across multiple dimensions (bidirectional)
  • Essential before querying multiple metrics together
  • Returns only entries shared by ALL of the specified inputs

Example: get_common(metrics=["finance.total_revenue", "growth.daily_active_users"])

When to use: Always check this before building queries with multiple metrics!

Get Node Lineage

Use MCP tool: get_node_lineage

  • Get upstream dependencies (what data sources this uses)
  • Get downstream dependencies (what will break if you change this)
  • Direction: "upstream", "downstream", or "both"

Example: get_node_lineage(node_name="finance.total_revenue", direction="both")


Querying & SQL Generation (Use MCP Tools)

When you need to query metrics or generate SQL, use these MCP tools:

Build Metric SQL

Use MCP tool: build_metric_sql

  • Generate executable SQL for querying metrics
  • Supports filters, dimensions, ordering, limits
  • Returns SQL query and metadata

Example:

build_metric_sql(
  metrics=["finance.total_revenue"],
  dimensions=["core.date.date"],
  filters=["core.date.date >= '2024-01-01'"],
  orderby=["core.date.date ASC"],
  limit=100,
  dialect="trino",
)

Returns:

  • Generated SQL for specified engine
  • Output columns with types
  • Cube name (if materialized cube used)

Performance: always pass a filter on a date/time dimension. When the upstream cube has a temporal partition declared on that dimension, DJ pushes the filter down to the partition column, limiting the data scanned. Without a time filter, queries scan the full underlying table.

(Don't pass include_temporal_filters=True here — that's a parameter on get_query_plan for inspecting partition templates in materialization-plan SQL, not for live queries.)

Show full SKILL.md (296 more words)Show less
Get Metric Data

Use MCP tool: get_metric_data

  • Execute query and get actual data
  • Returns query results as rows
  • Scan-cost guardrail: materialized cubes always run; ad-hoc queries (e.g. against Trino) run only if DJ's scan estimate is under the safety threshold. Over-threshold queries are refused up front and the estimate is surfaced so you can narrow the query (tighter date range, fewer dimensions, lower limit) and retry.

Example:

get_metric_data(
  metrics=["finance.total_revenue", "finance.transaction_count"],
  dimensions=["core.date.date", "core.region.region_name"],
  filters=["core.date.date >= '2024-01-01'"],
  orderby=["core.date.date ASC"],
  limit=1000
)

Best practices:

  • Always set a reasonable limit
  • Use specific date range filters — they drive partition pushdown and keep the scan estimate below the guardrail threshold
  • Check common dimensions first for multi-metric queries
  • If you're not sure how heavy a query will be, run get_query_plan first (see below) — it returns the scan estimate without executing
Visualize Metrics

Use MCP tool: visualize_metrics

  • Query metrics and generate ASCII chart visualization
  • Creates terminal-friendly charts (line, bar, scatter)
  • Same scan-cost guardrails as get_metric_data

Example:

visualize_metrics(
  metrics=["finance.total_revenue"],
  dimensions=["core.date.date"],
  filters=["core.date.date >= '2024-01-01'"],
  orderby=["core.date.date ASC"],
  limit=90,
  chart_type="line"
)

Chart types:

  • line: Time series (default)
  • bar: Categorical comparisons
  • scatter: Correlation analysis
Pre-Flight: Get Query Plan

Use MCP tool: get_query_plan

  • Returns how DJ decomposes the requested metrics into grain groups and components, AND the scan estimate, without executing anything
  • Use it before get_metric_data / visualize_metrics if you suspect the query might be expensive — the same scan estimate that drives the refusal guardrail is surfaced here, so you can iterate on filters until the estimate is reasonable

Example:

get_query_plan(
  metrics=["finance.total_revenue"],
  dimensions=["core.date.date"],
  filters=["core.date.date >= '2024-01-01'"],
)

When to use:

  • "Will this query work?" — check before fetching
  • "Why is this fetch refused?" — re-run the same args here to see the estimate
  • "What grain group will this go through?" — useful for understanding multi-metric queries

API Reference (Educational Context)

The MCP tools call the DJ REST and GraphQL APIs under the hood. Here's what they're doing:

REST API Endpoints

Node discovery:

bash
GET /nodes?node_type=metric&namespace=finance
GET /nodes/{node_name}

SQL generation (⚠️ Always use V3):

bash
GET /sql/metrics/v3    # Generate query SQL
GET /sql/measures/v3   # Generate pre-aggregation SQL

Dimension compatibility:

bash
GET /metrics/common/dimensions
GraphQL API

Available at /graphql:

graphql
query {
  nodes(nodeType: METRIC, namespace: "finance") {
    name
    description
    dimensions { name type }
  }

  commonDimensions(nodes: ["finance.revenue", "growth.users"]) {
    name
    type
  }
}

© DataJunction, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/datajunction/skills/datajunction-query of DataJunction/dj.

Open the folder on GitHubat commit 519835c

Compare with similar skills

Datajunction Query next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Datajunction Query compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Datajunction Query this skillDataJunction/dj161—~2kAutomated safety check: PassMIT
Pp Jobbermvanhorn/printing-press-library2.1k—~3kAutomated safety check: NotesApache-2.0
Operate Sqlmapcyberful/cyberful134—~1.1kAutomated safety check: PassAGPL-3.0
Aurora Dsqlaws/agent-toolkit-for-aws2.8k—~9.6kAutomated safety check: PassApache-2.0
SpikardGoldziher/spikard123—~799Automated safety check: PassMIT
QA Find Bugs MCPbex-co/beancount-io294—~3kAutomated safety check: PassMIT

Similar skills

  • Pp Jobber

    mvanhorn/printing-press-library

    Read-only Jobber CLI for offline analysis — every GraphQL surface synced to SQLite, every relationship queryable.

    2.1k GitHub stars~3k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • Operate Sqlmap

    cyberful/cyberful

    Use sqlmap to confirm and characterize suspected SQL injection with faithful requests and bounded evidence.

    134 GitHub stars~1.1k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Aurora Dsql

    aws/agent-toolkit-for-aws

    Official

    Provisions and manages Aurora DSQL clusters, connects via psql or DSQL Connectors, manages schemas, runs queries, migrates from MySQL, diagnoses query plans, and develops apps on serverless…

    2.8k GitHub stars~9.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Spikard

    Goldziher/spikard

    Scaffold Spikard projects and generate code from OpenAPI, AsyncAPI, OpenRPC, GraphQL, and Protobuf schemas using the Spikard CLI or its MCP server.

    123 GitHub stars~799 tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • QA Find Bugs MCP

    bex-co/beancount-io

    Hunt bugs in the Beancount.io remote MCP server by driving the real POST /api-gateway/mcp endpoint with JSON-RPC and real MCP clients, checking transport, discovery, credential boundaries, tool and…

    294 GitHub stars~3k tokensUpdated today
    Backend & APIsAuto-check passed
  • Shopify

    asgeirtj/system_prompts_leaks

    Set up and operate a Shopify store with Shopify's official MCP server (the installed shopify command, NOT the npm Shopify CLI).

    69k GitHub stars~2k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from DataJunction/dj

  • Datajunction

    DataJunction/dj

    Activate this skill whenever working with DataJunction (DJ) semantic layer.

    161 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Datajunction API

    DataJunction/dj

    Activate this skill when authoring DataJunction (DJ) nodes via the REST API directly (curl, HTTP clients) — typically for exploration, ad-hoc prototyping, or namespaces that aren't repo-backed.

    161 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Activate this skill for DataJunction (DJ) semantic modeling decisions — choosing the right node shape (fact, dimension, transform, metric, cube), turning a draft SQL query into well-designed nodes…

    161 GitHub stars~4.3k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Datajunction Query

What does Datajunction Query do?

Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs. Datajunction Query is an agent skill from DataJunction/dj. Activate this skill for querying DataJunction (DJ) — finding nodes, generating SQL, fetching metric data, exploring lineage, visualizing results — via the DJ UI, MCP tools, or REST/GraphQL APIs.

When should I use Datajunction Query?

Datajunction Query fits situations like: tasks that involve GraphQL; tasks that involve SQL; tasks that involve MCP servers.

How do I install Datajunction Query in Claude Code?

Run `npx skills add DataJunction/dj --skill datajunction-query -a claude-code`. Or copy the skill folder (plugins/datajunction/skills/datajunction-query in DataJunction/dj) into .claude/skills/datajunction-query in your project. Claude Code loads it when a task matches its description.

How do I install Datajunction Query in Codex?

Run `npx skills add DataJunction/dj --skill datajunction-query -a codex`. Or copy the skill folder (plugins/datajunction/skills/datajunction-query in DataJunction/dj) into .agents/skills/datajunction-query in your project. Codex loads it when a task matches its description.

Can I use Datajunction Query in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add DataJunction/dj --skill datajunction-query -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/datajunction-query, .gemini/skills/datajunction-query, .github/skills/datajunction-query and .opencode/skills/datajunction-query in your project.

What does Datajunction Query need to run?

SKILL.md names no scripts, command-line tools or credentials: Datajunction Query is instructions for the agent only.

Does Datajunction Query access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Datajunction Query safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Datajunction Query use?

Datajunction Query is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Datajunction Query use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Datajunction Query?

Skills that share tags, products or a category with Datajunction Query: Pp Jobber (mvanhorn/printing-press-library, 2.1k stars), Operate Sqlmap (cyberful/cyberful, 134 stars), Aurora Dsql (aws/agent-toolkit-for-aws, 2.8k stars) and Spikard (Goldziher/spikard, 123 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Datajunction Query?

DataJunction (a GitHub organization) maintains it in DataJunction/dj, which has 161 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 5, 2026.

Source: DataJunction/dj on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.