AGENT SKILL

semantic-layer-architect

Architect-level semantic layer design — metric definitions as code, entities and dimensions, consistency across BI and APIs, caching and query routing, and the governance that keeps one number meaning one thing. Use when several tools must report the same metrics.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
semantic-layer-architect
license
MIT
metadata
{ "crusor-path": "data-engineering-architect/transform-architect/semantic-layer-architect", "crusor-domain": "data-engineering-architect", "crusor-origin": "original", "crusor-sources": "docs.getdbt.com/docs/build/semantic-models; cube.dev/docs; cloud.google.com/looker/docs/lookml-project-files", "crusor-triggers": "semantic layer, metric definition, metrics layer, lookml, cube, consistent metrics, single source of truth, metric governance", "crusor-verified-on": "2026-10-30" }
description
Architect-level semantic layer design — metric definitions as code, entities and dimensions, consistency across BI and APIs, caching and query routing, and the governance that keeps one number meaning one thing. Use when several tools must report the same metrics.
compatibility
dbt Semantic Layer/MetricFlow, Cube, LookML, AtScale

03 SKILL.md 正文

Semantic Layer Architect

A semantic layer answers "what does this number mean" once, in code. Without one, every tool invents its own arithmetic and the arguments are unwinnable.

When to use

  • More than one BI tool, API, or team asks the same business question.
  • Metric definitions live in dashboards and spreadsheets.
  • Self-serve analytics needs guardrails, not raw tables.

When NOT to use

  • One analyst, one dashboard, no consumers.
  • The metrics are genuinely exploratory and unstable.

Decision 1 — Model

Element Meaning
entity the grain (order, customer, session)
dimension how you slice (country, plan, channel)
measure additive quantity (revenue, quantity)
metric calculation over measures (AOV = revenue ÷ orders)
filter/segment scoped metric (revenue, paid plan only)
  • Define metrics on entities, not on tables, so they survive schema refactors.
  • One metric, one definition, one owner; derived metrics must reference the base.
  • Time dimensions are first-class: fiscal calendars, time zones, and snapshot semantics are where definitions silently diverge.

Decision 2 — Where it lives

  • In the transformation project (dbt Semantic Layer) so it is versioned with models.
  • Exposed to BI via the layer's connector, not by exporting SQL per tool.
  • API consumers query the layer (GraphQL/REST) to avoid re-implementing logic.
  • Caching at the layer for repeated identical queries; invalidate on model rebuild.

Decision 3 — Governance

  • Metric owner named; changes reviewed like code and announced.
  • Deprecation: mark, announce, provide the replacement, then remove.
  • Certification: a "certified" tag means tested against source of truth.
  • Track usage; a metric with zero queries is a candidate for removal.

Decision 4 — Consistency checks

  • Reconcile layer output against raw SQL for the top 10 metrics, monthly.
  • Test that filters/segments compose correctly (no double counting).
  • Watch non-additive metrics (distinct counts, ratios) across grains — averaging an average is the classic error.
  • Time zone and currency conversions belong in the layer, not in each dashboard.

Failure modes at scale

  • Three definitions of "active user", all certified, in different tools.
  • Metric defined per dashboard; a filter change silently changes the number.
  • Semantic layer built but BI still queries raw tables directly.
  • Distinct-count metrics summed across days, double counting users.
  • No owner; a metric definition changes and nobody can say why the number moved.

Verification receipts

  1. Metric catalogue: name, definition, grain, owner, certification.
  2. Reconciliation report versus raw SQL for the top metrics.
  3. BI and API both reading the layer, demonstrated with the same query.
  4. Non-additive metric test across grains.
  5. Deprecation record for one retired metric.

04 同仓库更多 Skills

SriAkhilSJ
SriAkhilSJ/PulseAIRepo

interaction-patterns-architect

Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-system-ops-architect

Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-handoff-architect

Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

content-microcopy-architect

Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

ui-ux-implementation-architect

Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

test-strategy-architect

Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.

★ 0