Agent skill

Datajunction API

by DataJunction in 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.

MITAuto-check passedBackend & APIs

Install Datajunction API

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

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

GitHub CLI
$ gh skill install DataJunction/dj datajunction-api --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-api .claude/skills/datajunction-api && 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-api
GitHub stars
161
Token cost
~1.8k tokens
SKILL.md length
397 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

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.

  • Tasks that involve Prototyping
  • SKILL.md covers When to Use the API Approach, Checking if a Namespace Is…, Creating a Metric and Creating Other Node Types via…, plus 1 more section
  • Calls curl and git
  • Tasks that involve REST APIs

What it does

Datajunction API is an agent skill from 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. 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

Its SKILL.md is about 1.8k 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 Prototyping and REST APIs. It works with Git. The licence is MIT.

When your agent uses it

  • Tasks that involve Prototyping
  • Tasks that involve REST APIs

Example prompts

  • “/datajunction-api”

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

    Shell commands in SKILL.md call:

    • curl
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use curl and git, which can reach the network depending on how they are called.

    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 API loads about 1.8k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 397 words of instructions outside code blocks.

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

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). 397 words, ~1,777 tokens.

Download SKILL.mdSave it as .claude/skills/datajunction-api/SKILL.md (or your agent's skills folder).
name
datajunction-api
description
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. 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
user-invocable
false

DataJunction Direct API Authoring

Direct REST API authoring for DJ nodes. Use this skill for quick exploration, prototyping, or working in namespaces that don't use the repo-backed workflow.

For the modeling work upstream of any authoring (decomposition, naming, ratio decomposition, etc.), see datajunction-semantic-model. For the production-path equivalent of these patterns in YAML, see datajunction-repo.

When to Use the API Approach

✅ MUST use repo workflow instead (datajunction-repo) for:

  • Namespaces configured as repo-backed and read-only (git_only: true) — direct API changes are rejected

✅ Should use repo workflow for:

  • Production changes (review required)
  • Multi-node changes (related metrics/dimensions)
  • Team environments (multiple contributors)
  • Audit-trail requirements
  • Complex refactoring

✅ API workflow is appropriate for:

  • Quick exploration and prototyping
  • Ad-hoc analysis
  • Single-user, non-production namespaces
  • Temporary metrics
  • Non-production experiments
  • Only when the target namespace is NOT read-only repo-backed

Checking if a Namespace Is Repo-Backed

Before authoring via API, verify the target namespace allows it.

Best approach — get_node_details MCP tool (datajunction-query skill):

get_node_details(name="finance.total_revenue")

The response will include git repository information:

Git Repository:
  Repo: owner/dj-finance
  Branch: main
  Default Branch: main
  → This namespace is repo-backed (use git workflow for changes)

Alternative — REST API (shows read-only status):

bash
curl -b ~/.dj/cookies.txt -X GET $DJ_URL/namespaces/finance/git

# Response:
{
  "github_repo_path": "owner/dj-finance",
  "git_branch": "main",
  "default_branch": "main",
  "git_path": "nodes/",
  "git_only": true    ← If true, namespace is read-only (API changes blocked)
}

Decision tree:

  • If git info is present AND git_only: true: MUST use repo workflow (API changes will fail)
  • If git info is present AND git_only: false: Can use either workflow
  • If git info is null: Use API workflow (direct POST/PATCH)

Creating a Metric

Metric Structure
sql
SELECT <aggregation_expression> AS <metric_name>
FROM <single_node>

Metrics select a single expression from a single source, transform, or dimension node. They cannot contain WHERE clauses — use CASE WHEN instead. See datajunction-semantic-model for the modeling rationale.

Show full SKILL.md (160 more words)Show less
Metric Metadata Fields

Required:

  • name — Fully qualified metric name (e.g., finance.total_revenue)
  • query — SQL aggregation expression

Recommended:

  • description — Human-readable description
  • metric_metadata.direction — higher_is_better / lower_is_better / neutral
  • metric_metadata.unit — dollar / unitless (⚠️ NOT count — server rejects)
  • mode — draft / published
  • required_dimensions — Dimensions required for this metric to make sense
  • owners — List of email addresses (prefer team emails)
Examples

COUNT:

bash
curl -b ~/.dj/cookies.txt -X POST $DJ_URL/nodes/metric/ \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "finance.num_transactions",
    "description": "Total number of transactions",
    "query": "SELECT COUNT(transaction_id) AS num_transactions FROM finance.transactions",
    "owners": ["data-platform-team@company.com"],
    "mode": "published"
  }'

SUM:

bash
curl -b ~/.dj/cookies.txt -X POST $DJ_URL/nodes/metric/ \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "finance.total_revenue",
    "description": "Total revenue from all transactions",
    "query": "SELECT SUM(amount_usd) AS total_revenue FROM finance.transactions",
    "metric_metadata": {
      "direction": "higher_is_better",
      "unit": "dollar"
    },
    "owners": ["finance-data-team@company.com"],
    "mode": "published"
  }'

Conditional aggregation (CASE WHEN, not WHERE):

bash
curl -b ~/.dj/cookies.txt -X POST $DJ_URL/nodes/metric/ \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "finance.completed_revenue",
    "description": "Revenue from completed non-refund transactions",
    "query": "
      SELECT SUM(
        CASE
          WHEN status = '\''completed'\'' AND refund_flag = false
          THEN amount_usd
          ELSE 0
        END
      ) AS completed_revenue
      FROM finance.transactions
    ",
    "metric_metadata": {
      "direction": "higher_is_better",
      "unit": "dollar"
    },
    "owners": ["finance-data-team@company.com"],
    "mode": "published"
  }'

Ratio over base metrics (decompose first, then derive — see datajunction-semantic-model):

bash
# Step 1: create the base metrics (one curl each)
curl -X POST $DJ_URL/nodes/metric/ -d '{
  "name": "finance.clicks",
  "query": "SELECT COUNT_IF(event = '\''click'\'') FROM finance.events",
  "owners": ["marketing@company.com"],
  "mode": "published"
}'

curl -X POST $DJ_URL/nodes/metric/ -d '{
  "name": "finance.impressions",
  "query": "SELECT COUNT_IF(event = '\''impression'\'') FROM finance.events",
  "owners": ["marketing@company.com"],
  "mode": "published"
}'

# Step 2: derived ratio metric referencing the base metrics
curl -X POST $DJ_URL/nodes/metric/ -d '{
  "name": "finance.conversion_rate",
  "description": "Click-through rate as percentage",
  "query": "SELECT finance.clicks * 100.0 / NULLIF(finance.impressions, 0)",
  "metric_metadata": {
    "direction": "higher_is_better",
    "unit": "unitless"
  },
  "owners": ["marketing@company.com"],
  "mode": "published"
}'

DJ automatically handles divide-by-zero, but NULLIF() is extra safety.


Creating Other Node Types via API

Same pattern as metrics — POST JSON to the appropriate endpoint:

  • POST /nodes/source/ — source nodes (catalog/schema/table refs)
  • POST /nodes/dimension/ — dimension nodes
  • POST /nodes/transform/ — transform nodes
  • POST /nodes/cube/ — cubes (metric + dimension combinations)

For the YAML-equivalent shapes of each, see datajunction-repo — the field set is the same, just expressed in JSON instead of YAML.


Updating and Deleting Nodes

Update (PATCH):

bash
curl -b ~/.dj/cookies.txt -X PATCH $DJ_URL/nodes/finance.total_revenue/ \
  -H 'Content-Type: application/json' \
  -d '{"description": "Updated description"}'

Deactivate (soft delete):

bash
curl -b ~/.dj/cookies.txt -X DELETE $DJ_URL/nodes/finance.total_revenue/

Deactivated nodes can be revived. For hard-delete (irreversible), use the dj CLI: dj delete-node finance.total_revenue --hard.

© 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-api of DataJunction/dj.

Open the folder on GitHubat commit 519835c

Compare with similar skills

Datajunction API 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 API compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Datajunction API this skillDataJunction/dj161—~1.8kAutomated safety check: PassMIT
Project GeneratorLeoYeAI/openclaw-master-skills2.2k—~4.5kAutomated safety check: PassMIT
Accessing GitHub Reposoaustegard/claude-skills150—~2.2kAutomated safety check: NotesMIT
GitHub IssuesRedWoodOG/Hermes-Desktop1775 repos~2.3kAutomated safety check: NotesMIT
Bitbucket CloudOpenHands/extensions157—~1.1kAutomated safety check: PassMIT
Bitbucket Data CenterOpenHands/extensions157—~993Automated safety check: PassMIT

Similar skills

  • Project Generator

    LeoYeAI/openclaw-master-skills

    Automatically transform requirement documents or natural language descriptions into complete full-stack projects (Java backend + Vue frontend) with MANDATORY interactive tech stack selection.

    2.2k GitHub stars~4.5k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • Accessing GitHub Repos

    oaustegard/claude-skills

    GitHub repository access in containerized environments using REST API and credential detection.

    150 GitHub stars~2.2k tokensUpdated 5 days ago
    Backend & APIsAuto-check: notes
  • GitHub Issues

    RedWoodOG/Hermes-Desktop

    Create, manage, triage, and close GitHub issues. An agent skill from RedWoodOG/Hermes-Desktop.

    177 GitHub starsUsed in 5 repos~2.3k tokens
    DevelopmentAuto-check: notes
  • Bitbucket Cloud

    OpenHands/extensions

    Bitbucket Cloud (bitbucket.org) specifics — authenticate with BITBUCKETTOKEN, use the REST API v2, workspace/reposlug repositories, and the createbitbucketpr tool.

    157 GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Bitbucket Data Center

    OpenHands/extensions

    Bitbucket Data Center (self-hosted Bitbucket Server) specifics — authenticate with BITBUCKETDATACENTERTOKEN, use the REST API 1.0, PROJECT/reposlug repositories, scm/ git remotes, and the…

    157 GitHub stars~993 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • GitHub Code Review

    RedWoodOG/Hermes-Desktop

    Review code changes by analyzing git diffs, leaving inline comments on PRs, and performing thorough pre-push review.

    177 GitHub starsUsed in 5 repos~3.4k tokens
    DevelopmentAuto-check: notes

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 Query

    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.

    161 GitHub stars~2k 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 API

What does Datajunction API do?

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. Datajunction API is an agent skill from 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.

When should I use Datajunction API?

Datajunction API fits situations like: tasks that involve Prototyping; tasks that involve REST APIs.

How do I install Datajunction API in Claude Code?

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

How do I install Datajunction API in Codex?

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

Can I use Datajunction API 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-api -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-api, .gemini/skills/datajunction-api, .github/skills/datajunction-api and .opencode/skills/datajunction-api in your project.

What does Datajunction API need to run?

Going by SKILL.md and its folder, Datajunction API needs the command-line tools its instructions call (curl and git).

Does Datajunction API access the network?

SKILL.md contains no URLs. Its commands use curl and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Datajunction API 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 API use?

Datajunction API 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 API use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 API?

Skills that share tags, products or a category with Datajunction API: Project Generator (LeoYeAI/openclaw-master-skills, 2.2k stars), Accessing GitHub Repos (oaustegard/claude-skills, 150 stars), GitHub Issues (RedWoodOG/Hermes-Desktop, 177 stars) and Bitbucket Cloud (OpenHands/extensions, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Datajunction API?

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.