No slash command · from datajunction
Explains DataJunction semantic layer concepts: node types (source, transform, dimension, metric, cube), star schema modeling, and dimension links. Activates when DJ is mentioned.
Ships in datajunction. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
DataJunction is a semantic layer that provides a unified interface to query metrics across data sources using dimensional modeling (star schema).
Key capabilities:
Companion skills:
datajunction-query — discovery, SQL generation, fetching data (consumer workflows; also covers the DJ web UI)datajunction-semantic-model — modeling decisions: fact/dim/transform shape, query-to-DJ decomposition, ratio decomposition, ownership, namingdatajunction-repo — authoring DJ nodes via YAML in a git-backed repositorydatajunction-api — authoring DJ nodes via the REST API (exploration / prototyping)DataJunction organizes entities into different node types:
| Node Type | Description | Example |
|---|---|---|
| Source | Physical table or view in your data warehouse | catalog.finance.transactions_table |
| Transform | SQL transformation of other nodes (cleaning, filtering, joining) | events.clean.user_events |
| Dimension | Entity with attributes (users, products, dates, regions) | core.users, core.dates |
| Metric | Aggregated measure (revenue, count, ratios) | finance.total_revenue |
| Cube | Pre-computed metric combinations for performance | finance.revenue_cube |
DJ uses normalized star schema modeling where dimension links connect fact tables to dimension tables, and dimensional entities to other dimensions:
[Fact Table: transactions]
├─ dimension_link: user_id → [Dimension: users]
│ ├─ Attributes: country, signup_date, tier
│ │ └─ dimension_link: signup_date → [Dimension: date]
│ │ └─ Attributes: month, quarter, year
│ └─ Attributes: country, signup_date, tier
├─ dimension_link: product_id → [Dimension: products]
│ └─ Attributes: category, price, brand
└─ dimension_link: date → [Dimension: dates]
└─ Attributes: month, quarter, year
[Metric: revenue]
├─ Defined on: transactions
└─ Auto-inherits dimension links from transactions
├─ users.country (via user_id)
├─ products.category (via product_id)
└─ dates.month (via date)
Key insight: When you define dimension links on a node, any metric built on that node automatically inherits access to all dimension attributes. DJ automatically discovers and generates the necessary joins across the entire dimensions graph.
Dimension links define how nodes join to dimensions. They enable automatic join path discovery.
Basic structure:
dimension_links:
- type: join
dimension_node: common.dimensions.users
join_type: left # Optional: left, right, inner (default: left)
join_on: finance.transactions.user_id = common.dimensions.users.user_id
Join types:
left - Left outer join (default, most common)right - Right outer joininner - Inner join (only matching rows)Dimension links can be defined on three node types:
When the source table cleanly represents a semantic entity.
When source tables don't accurately represent your semantic entity - use transforms to clean data first.
Dimensions can link to other dimensions, creating a rich dimensional graph.
Example dimensional graph:
transactions → users → countries → regions
Metrics on transactions can now group by:
users.country_code (1 hop)countries.country_name (2 hops via users → countries)regions.population (3 hops via users → countries → regions)When a node references the same dimension node multiple times, use roles to disambiguate:
{
"dimension_links": [
{
"dimension": "core.users",
"join_on": "orders.buyer_id = core.users.user_id",
"role": "buyer"
},
{
"dimension": "core.users",
"join_on": "orders.seller_id = core.users.user_id",
"role": "seller"
}
]
}
Query with: buyer.country vs seller.country
DJ uses the role prefix to generate the correct joins.
DJ tracks TWO separate state systems:
Users control this via the mode field:
draft: Work in progress
published: Production-ready
DJ automatically validates nodes and sets status:
valid: Passes all validation checks
invalid: Failed validation
Key insight: mode and status are independent:
| Mode | Status | Meaning |
|---|---|---|
draft | valid | Good draft, not yet published |
draft | invalid | Work in progress, has errors |
published | valid | Production-ready ✅ |
published | invalid | Was working, now broken (upstream change) ⚠️ |
SELECT * is NOT supported
-- ❌ NOT ALLOWED
SELECT * FROM finance.transactions
-- ✅ CORRECT
SELECT transaction_id, user_id, amount_usd, transaction_date
FROM finance.transactions
Column types are auto-inferred from queries
Use CAST() to control types
-- Force specific type
SELECT CAST(user_id AS bigint), CAST(revenue AS decimal(18,2))
FROM finance.transactions
For metric-specific constraints (no WHERE clauses, single-expression rule, cross-metric composition), see the datajunction-semantic-model skill.
| Concept | Description |
|---|---|
| Node | Any entity in DJ (source, dimension, metric, etc.) |
| Dimension Link | Defines how nodes join to dimensions |
| Dimensional Graph | Network of dimensions linked to each other |
| Star Schema | Fact tables at center, dimension tables radiate out |
| Auto-Join | DJ automatically finds join paths via dimension links |
| Mode | User-controlled: draft vs published |
| Status | System-controlled: valid vs invalid |
| Namespace | Logical grouping (finance, core, growth) |
| Repo-Backed | Namespace definitions stored in git as YAML |
| Branch Namespace | DJ namespace pointing to specific git branch |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
datajunction, semantic-layer, star-schema, dimensional-modeling, metrics
npx claudepluginhub datajunction/dj --plugin datajunction5 skills in this plugin
/datajunction-apiActivate 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.
Keywords:
- DJ API, REST API, curl
- POST nodes/metric, POST nodes/dimension
- create a metric via the API, create a dimension via the API
- create a node with curl
- prototyping, exploration
/datajunction-queryActivate 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
/datajunction-repoOther plugins' skills for the same job