/dogsled-core:dogsled-author-model-spec-metricfrom dogsled-core
Authors a Model Spec metric YAML file — a named semantic measure layered on one or more models. Covers single-model and multi-model metrics, expressions, synonyms, and tags.
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 a named semantic measure (e.g. ARR, gross margin, active users) that downstream consumers — a host application, BI tools, the query planner — should read out of one or more Model Spec models.
Metrics are metadata entities: they don't produce DDL. The
compiler parses them, validates their references, and emits them as
JSON alongside SQL when --include-metadata is set.
Place each metric in its own file under the project's metrics/
directory (configurable via metrics_dir in model-spec.yml, defaults to
metrics/). One metric per file.
spec_version: '0.2'
type: metric
name: <identifier> # must match identifierRegex; required
description: Short human-readable explanation # optional
model: <model_name> # single-model metrics
# — OR —
models: # multi-model metrics (ratios, sums across models)
- <model_a>
- <model_b>
expression: SUM({fct_orders}.order_total) # required; SQL-ish, {ref} tokens resolve to qualified identifiers
synonyms: # optional; alternative phrasings for NL → metric retrieval
- net revenue
- bookings
tags: # optional; surfaced by the Data Estate UI
- finance
- tier-1
Required: spec_version, type, name, expression, and at
least one of model or models.
model: for single-model metrics, models: for
ratios or cross-model aggregates.{model_name} tokens to reference
models. The compiler validates every token resolves to a real
model at dogsled model validate time. Cross-dialect SQL
functions are auto-transpiled (see the dogsled-author-model-spec-model skill
and dogsled-model-spec-expressions reference for the function catalog).mrr metric).finance, growth, core-kpi are typical.dogsled model validate --integration <handle>
checks model refs and basic structure.spec_version: '0.2'
type: metric
name: monthly_recurring_revenue
description: Total active subscription revenue normalized to a monthly cadence.
model: fct_subscriptions
expression: |
SUM(
CASE
WHEN {fct_subscriptions}.billing_cadence = 'yearly'
THEN {fct_subscriptions}.amount / 12
ELSE {fct_subscriptions}.amount
END
)
synonyms:
- mrr
- monthly recurring revenue
- subscription revenue
tags:
- finance
- core-kpi
expression is opaque to the compiler — column references inside
aggregates aren't checked against the model's schema.columns. A
typo like SUM({fct_orders}.totl) slips through validation and
blows up only at query time.models: with >1 entry) don't carry an
implicit join. The expression must include the join logic
explicitly, OR rely on a relationship spec that downstream planners
can use (see dogsled-author-model-spec-relationship).dogsled-author-model-spec-model — author the underlying model the metric reads.dogsled-author-model-spec-relationship — declare the joins between models a
multi-model metric spans.dogsled-author-model-spec-vq — author a verified SQL query that returns the
metric value pre-aggregated.For programmatic edits (mutating an existing metric from code rather
than authoring from scratch), see the dogsled-model-spec-edit skill —
updateMetric() is the validated entry point.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub bobsled-inc/dogsled-core --plugin dogsled-core65 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-destinationAdd a new database load destination (e.g., Snowflake, PostgreSQL, ClickHouse) to the @bobsled-inc/loader package. Implements the DatabaseDestination interface with full append/merge/full_refresh support./add-file-destinationAdd a new file-based load destination (e.g., Azure Blob Storage, R2, MinIO) to the @bobsled-inc/loader package. Walks through class implementation, config schema, factory wiring, CLI options, check command, and tests./add-file-storage-sourceOnboard documents (PDF, DOCX, PPTX, HTML, Markdown, text, email) from an Amazon S3 or Google Cloud Storage bucket — author a file-storage integration (source_type s3|gcs, bucket + auth) plus a document resource that parses and token-chunks each file, and an optional pipeline that embeds the chunks. Use when the user wants to ingest files/documents from cloud object storage rather than from an API./add-integrationAdd a new API integration to the @bobsled-inc/integrations library. Automates OpenAPI spec discovery, YAML generation, curation, and validation.