/dogsled-core:dogsled-author-model-spec-relationshipfrom dogsled-core
Authors a Model Spec relationship YAML file declaring how two models join, including multi-column joins, join type, and cardinality. Used when a query spans more than one model.
Ships in dogsled-core. 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.
Use this skill when a user wants to declare how two Model Spec models join. No SQL is emitted directly — downstream consumers (BI tools, the query planner, a host application) read the relationship spec to plan joins when a query spans more than one model.
For mastered-entity relationships (entity-graph identity edges), see
the entity_relationship type instead — different schema with
confidence scoring, temporal validity, and review thresholds.
Place each relationship in its own file under the project's
relationships/ directory (configurable via relationships_dir in
model-spec.yml, defaults to relationships/). One relationship per file.
spec_version: '0.2'
type: relationship
name: <identifier> # must match identifierRegex; required
description: Short human-readable explanation # optional
left_model: <model_a> # required; the "from" side
right_model: <model_b> # required; the "to" side — must differ from left_model
join_columns: # required; at least one pair, multi-column joins supported
- left: <column_in_left>
right: <column_in_right>
- left: <another_column> # additional pairs AND together in the generated ON clause
right: <another_column>
join_type: inner # 'inner' (default) or 'left'; 'right'/'full' are intentionally not supported
relationship_type: many_to_one # required; one of one_to_one | one_to_many | many_to_one | many_to_many
tags: # optional
- core
- shop-domain
Required: spec_version, type, name, left_model,
right_model, join_columns (≥1 pair), relationship_type.
Self-joins are rejected — left_model must differ from
right_model. If you need a self-referential relationship (manager
of an employee, parent of an account), model it as two Model Spec models
that point at the same underlying table.
left_model and right_model. Order matters for the
cardinality reading — a many_to_one from fct_orders (left) to
dim_customers (right) means "many orders per customer".join_columns:. Multi-column joins list multiple
pairs; each becomes an AND in the generated ON clause.join_type. inner is the default; use left to
preserve rows on the left side when the right side may not match.
right and full are deliberately not supported — reorder the
models for a right, and full is rarely analytically meaningful.relationship_type. Be explicit about cardinality:
one_to_one, one_to_many, many_to_one, many_to_many. This
drives the Data Estate UI and helps the query planner reason
about join fan-out before generating SQL.dogsled model validate --integration <handle>
checks that both models exist; column existence inside the join
pairs is not validated (see caveats below).spec_version: '0.2'
type: relationship
name: orders_to_customers
description: Each order belongs to exactly one customer.
left_model: fct_orders
right_model: dim_customers
join_columns:
- left: customer_id
right: customer_id
join_type: inner
relationship_type: many_to_one
tags:
- core
- shop-domain
A multi-column composite-key example:
spec_version: '0.2'
type: relationship
name: line_items_to_orders
description: Order line items link to orders by tenant + order id.
left_model: fct_order_items
right_model: fct_orders
join_columns:
- left: tenant_id
right: tenant_id
- left: order_id
right: order_id
join_type: inner
relationship_type: many_to_one
validateMetadataReferences is a structural check: it
confirms left_model / right_model resolve, but does not
check that each join_columns.left / join_columns.right exists
in the referenced model's schema.columns. A column typo slips
through and fails only at query time.dogsled-author-model-spec-model — author the models being joined.dogsled-author-model-spec-metric — multi-model metrics rely on relationships to
plan their joins.dogsled-author-model-spec-vq — verified queries that hand-write joins can be
treated as ground truth for ad-hoc shapes the relationship doesn't
cover.For programmatic edits to an existing relationship, see dogsled-model-spec-edit
— updateRelationship() is the validated entry point.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bobsled-inc/dogsled-core --plugin dogsled-coreOther plugins' skills for the same job
65 skills in this plugin
/add-custom-api-integrationAuthor a generic custom_api source for any REST/GraphQL API purely in YAML — inline transport (base_url + auth), one declarative resource per endpoint, then validate/verify/extract. Use when the API isn't in the bundled catalog./add-custom-mcp-integrationAuthor a custom_mcp source for any remote MCP server (Model Context Protocol over streamable HTTP) purely in YAML — inline mcp_http transport (url + auth + auth_env_vars), one resource_kind mcp resource per tool, then validate/verify/extract. Use when the MCP server isn't in the bundled catalog./add-database-destination