datajunction/dj/datajunction-repo
Claude Code and agent skill by datajunction/dj
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Activate this skill when authoring DataJunction (DJ) nodes via YAML files in a git repository — the repo-backed workflow. Covers YAML schemas per node type, branch-based development, temporal partitions on cubes, registering pre-aggregations / aggregate awareness, and the full PR-driven deployment flow. Keywords: - YAML nodes, YAML definitions - repo-backed namespace, repo-backed workflow - git workflow, branch development, feature branch - cube YAML, metric YAML, dimension YAML, transform YAML…
Install
npx vskill@latest install datajunction/dj/datajunction-repoSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as datajunction/dj/datajunction-repo.
DataJunction Repo-Backed Workflow
YAML-and-git authoring for DJ. Use this skill when working in a repo-backed namespace — node definitions are YAML files, changes go through PRs, CI/CD deploys.
For modeling decisions (whether to make something a metric, dim, or transform; how to decompose a query), see datajunction-semantic-model. This skill assumes the modeling decisions are made and you're translating them into YAML.
Overview
DataJunction supports repo-backed namespaces where node definitions are stored as YAML files in a git repository. This enables:
- ✅ Version control for your semantic layer
- ✅ Pull request review workflows for changes
- ✅ Branch-based development (feature branches, environments)
- ✅ Declarative configuration (infrastructure as code)
- ✅ Audit trail of all changes
- ✅ Team collaboration with code review
Repository Structure
There is no required layout under `nodes/`. DJ walks the tree recursively (rglob("nodes/**/*.yaml")) and takes the namespace from each YAML's name: field. The folder path is purely organizational. Files can be flat, nested by type, nested by domain, or any mix — DJ doesn't care, and reorganizing later is a free git mv.
That said, you should still choose a layout for your repo so contributors know where to add things. A few common patterns:
By node type (good when most contributors are adding metrics across one domain):
By domain (good when multiple teams/areas share one repo):
Flat (small projects, <30 nodes):
Deciding on a layout
For an existing repo: look at the current nodes/ tree and match it. Consistency within a repo matters more than any specific scheme. Don't introduce a new style alongside an established one.
For a new repo: ask the user a few questions before committing to a layout:
- How many contributors / teams will use this repo?
- Roughly how many nodes do you expect (10? 100? 1000?)
- Are most nodes going to be metrics on top of a few shared transforms, or many independent fact/dim chains?
Defaults from those answers:
- 1 team + <30 nodes → flat is fine
- 1 team + larger → by node type
- Multiple teams → by domain, with optional type subdirs inside each domain folder when a domain itself grows past ~30 nodes
The right call almost never matters as much as it feels like it does — folder layout has zero effect on deployed namespaces, so optimize for "where would a new contributor look for X" and accept that you'll reorganize as the repo grows.
Branch-Based Development
Understanding Branch-Based Namespaces
When you create a branch in a repo-backed namespace, DJ creates a corresponding namespace that points to that branch.
Naming convention:
Examples:
finance.main→ points tomainbranch of finance repofinance.feature-new-metrics→ points tofeature-new-metricsbranchfinance.staging→ points tostagingbranch
Creating a Feature Branch
Option A: Via DJ API
Option B: Manually in Git
YAML Node Definitions
All node types can be defined as YAML files in the repository.
Column-Level Configuration
Column types are auto-inferred from queries
- DJ analyzes your SQL and automatically determines column types
- No need to manually specify types in the
columnssection
Use CAST() to control specific types
Column attributes
primary_key— Marks column as part of the primary keydimension— Marks column as available for grouping (transforms/facts only)
Optional column fields
display_name— Human-readable name for UI display
```yaml columns:
- name: ad_account_id
display_name: "Ad Account ID" attributes:
- dimension
```
Important constraints:
- ❌ SELECT * is NOT supported — always explicitly list columns
- ✅ Column order in YAML should match SELECT order
- ✅ Use descriptive display names for better UX
Source Node YAML
Notes:
- Column types are auto-inferred from the source table schema
display_nameprovides human-readable labels for UIjoin_typecan beleft,right, orinner(defaults toleft)
Dimension Node YAML
Notes:
- Dimension node columns don't need
dimensionattribute (all are dimensions by nature) display_nameimproves readability in query builders and dashboards
Metric Node YAML
Important metric rules (see datajunction-semantic-model for full discussion):
- ✅ ALWAYS specify owners — critical for governance
- ❌ No WHERE clauses in metric queries (use CASE WHEN instead)
- ✅ Include required_dimensions for time-based metrics
- ✅ Add metric_metadata for direction and unit
- ✅ Use `required_filters` and `recommended_filters` to say which dimension attributes a query must or should filter. Give an entry a
defaultfilter if callers should not have to send one; without it, a query that omits the filter is rejected
Transform Node YAML
Notes:
primary_keyfield lists the primary key column(s)dimensionattribute marks columns available for grouping in metrics- Column types are auto-inferred from the query
- Columns without
dimensionattribute are typically measures/facts
Cube YAML
When to use cubes:
- Frequently queried metric combinations
- Pre-compute for performance (materialization)
- Dashboard metric sets
Critical: All metrics in a cube MUST share ALL dimensions in the cube. Use get_common_dimensions MCP tool (see datajunction-query) to check first.
Temporal Partitions on Cubes
Temporal partitions enable automatic partition filtering for performance optimization. When configured, DJ automatically adds partition filters to SQL queries, dramatically improving query performance on large datasets.
How Partitions Work
A partition is always declared on a column. When that column is a dimension attribute on a cube, DJ uses it as the partition boundary and pushes the filter down to all upstream nodes that link to that same dimension.
Partition field format:
Declaring a Partition on a Cube
In a cube, declare the partition in the `columns:` section using the full dimension attribute path as the column name:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/datajunction/skills/datajunction-repo/SKILL.md
Popularity
- Repository stars
- 166
- Repository forks
- 34
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/datajunction/dj/datajunction-repo)