技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
data-analytics-engineering【数据与研究】Builds analytics engineering layers for metrics, contracts, and BI-ready models. Use when shaping dbt or SQLMesh marts, metric governance, lineage, or data quality.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Code-defined marts, metrics as APIs, contracts on critical interfaces, semantic layers only where they improve reuse or AI/BI consumption, and metadata systems that expose owners, lineage, quality, and governance to both humans and agents.
Primary sources: data/sources.json. Refresh time-sensitive claims against official docs before giving definitive recommendations.
dbt, SQLMesh, Coalesce)dbt Semantic Layer, Lightdash, Cube, warehouse-native)marketing-product-analyticsRun through these before any recommendation:
dbt, SQLMesh, visual tooling, or warehouse SQL only?Release stage, adapter coverage, licence, and corporate ownership of these tools change between releases and deals. Do not state them from memory; look them up for the decision they feed. Other files in this skill point here instead of restating tool status.
| Before you recommend... | Look up | Primary source |
|---|---|---|
| A dbt engine change (dbt Core or Fusion, local or platform) | Release stage and per-adapter availability for the user's warehouse and deployment mode | dbt release notes and the dbt upgrade guide for the target version |
| dbt Semantic Layer / MetricFlow | Current semantic YAML spec, release, and BI integrations | dbt Semantic Layer docs; MetricFlow release history on PyPI |
| SQLMesh | Release, licence, and governance body | SQLMesh repository and its foundation project page |
| Vendor risk as a reason to pick one tool | Current owner, licence, and governance body of each candidate | Vendor press pages; each project's LICENSE file and foundation page |
dbt or SQLMesh before debating semantic-layer tooling (references/tool-comparison.md)staging -> intermediate -> marts layers, pick final shape (star, wide, or activity schema) with references/modeling-patterns.mdreferences/contracts-catalogs-lineage.md)references/semantic-layer-patterns.md to decide between dbt-native, Lightdash, Cube, or warehouse-nativereferences/data-quality-testing.md and references/release-and-ci-patterns.md)references/metric-governance.md and assets/ownership-catalog-worksheet.md)What does your team care about most?
Plan-based deployment, environment isolation, backfill control
-> SQLMesh
Broadest ecosystem, contracts, semantic layer, dbt-native CI
-> dbt (dbt Core or the dbt platform)
Visual metadata-driven development, enterprise onboarding speed
-> Coalesce
Already on dbt and want faster compile + typed SQL
-> Evaluate dbt Fusion, only on adapters that are GA for your deployment mode (see Stack Lookups)
Are the same business metrics reimplemented in 3+ places?
NO -> Governed marts only; revisit when the answer flips to YES
YES ->
Most consumers are dbt-native?
YES -> dbt Semantic Layer (MetricFlow) or Lightdash
Need embedded analytics or product-facing APIs?
YES -> Cube
Single warehouse platform?
Snowflake -> Snowflake Semantic Views
Databricks -> Unity Catalog Metric Views
Consumers need a business-friendly metric catalog as much as a query layer?
YES -> Lightdash (or semantic layer + OpenMetadata/DataHub catalog)
| Change class | Examples | Required release path |
|---|---|---|
| Additive | New metric, dimension, or optional field | Validate grain and source coverage; publish owner and definition before exposing it |
| Corrective | Bug fix that changes historical values | Dual-run old/new logic over a representative window; quantify affected periods and consumers; issue a change notice |
| Breaking | Rename, removal, grain change, or semantic redefinition | Version the metric or field; keep a compatibility window; migrate named consumers; define rollback |
For corrective and breaking changes, reconciliation must compare totals and segment-level results at the intended grain. A matching grand total can hide offsetting errors, fan-out, or a changed population. Do not cut over until the owner accepts the measured delta, downstream consumers are enumerated, and the old definition remains recoverable for the agreed window.
| Task | Resource | When to Load |
|---|---|---|
| Choose dbt vs SQLMesh vs Coalesce | references/tool-comparison.md | New stack selection or migration |
| Pick star vs wide vs activity schema | references/modeling-patterns.md | Designing marts and semantic boundaries |
| Decide whether to add a semantic layer | references/semantic-layer-patterns.md | Metrics reuse, NLQ, API, or BI serving |
| Add contracts, ownership, lineage, catalog | references/contracts-catalogs-lineage.md | Shared marts and governed datasets |
| Add tests, audits, anomaly checks, CI gates | references/data-quality-testing.md | Prevent regressions and stale data |
| Define metric lifecycle and deprecation | references/metric-governance.md | Executive metrics and shared KPI programs |
| Plan rollout, dual-run, backfills | references/release-and-ci-patterns.md | Safe deployment and migration |
| PII separation, vault pattern, pseudonymisation | references/pii-vault-and-pseudonymisation.md | LLM/AI-facing query surfaces or GDPR scope |
| Draft metric definitions | assets/metric-dictionary.md | New KPIs or metric refactors |
| Draft semantic layer design | assets/semantic-layer-spec.md | Serving layer design review |
| Draft quality coverage | assets/data-quality-test-plan.md | Model-by-model test planning |
| Start a SQLMesh project or model | assets/transformation/sqlmesh/template-sqlmesh-project.md, assets/transformation/sqlmesh/template-sqlmesh-model.md | SQLMesh setup or model definition; see all SQLMesh templates below |
| Communicate metric changes | assets/metric-change-notice.md | Breaking or non-breaking metric updates |
| Document owners and catalog fields | assets/ownership-catalog-worksheet.md | Governance and discoverability setup |
| Migrate to a semantic layer | assets/semantic-layer-migration-checklist.md | Ad-hoc SQL to governed metrics |
| Handle data quality incidents | assets/data-quality-incident-runbook.md | Failures, stale data, or contract breaks |
dbt projects (PR checks):
dbt deps
dbt parse
# prod-artifacts/ holds the production manifest.json (or set DBT_ENGINE_STATE)
dbt build --select state:modified+ --defer --state ./prod-artifacts
SQLMesh projects (PR/preview checks):
sqlmesh plan --no-prompts dev
sqlmesh test
sqlmesh audit # SQLMesh has no state: selector; audit specific models with --model <name> (repeatable)
apply| Anti-Pattern | Root Cause | Fix |
|---|---|---|
| KPI logic in dashboards or notebooks | No governed mart | Define in mart or semantic model first |
| Multiple grains in one mart | Dashboard convenience | Create separate models per grain |
| Contracts on every staging model | Misapplied governance | Contract only shared, high-stakes interfaces |
| Semantic layer before marts are stable | Premature abstraction | Stabilize marts before defining entities/measures |
| Same 360 table for every request | No modeling discipline | One model, one grain, one purpose |
| Allowing AI/NLQ access to undocumented marts | Missing metadata | Require grain, owner, freshness contract before AI access |
| Script | Purpose |
|---|---|
scripts/analytics_linter.py | Validate, lint, and health-score a metric dictionary JSON file |
# Validate required fields, duplicate names, and undefined data sources
python scripts/analytics_linter.py validate --input data/valid-metric-dictionary.json
# Lint metric quality: missing owners, undocumented dimensions, naming, SLAs
python scripts/analytics_linter.py lint --input data/valid-metric-dictionary.json
# Generate a Markdown metric dictionary health report
python scripts/analytics_linter.py report \
--input data/sample-metric-dictionary.json \
--output metric-health-report.md
| File | Description |
|---|---|
data/sources.json | Curated reference sources for this skill |
data/valid-metric-dictionary.json | Production-valid 15-metric dictionary for smoke tests and quickstart examples |
data/sample-metric-dictionary.json | Realistic 15-metric dictionary with intentional gaps for linting demos |
| File | Load When |
|---|---|
| references/tool-comparison.md | Choosing or comparing dbt, SQLMesh, Coalesce, or semantic-layer tools |
| references/modeling-patterns.md | Designing mart layers, grain, star/wide/activity schemas |
| references/semantic-layer-patterns.md | Deciding on and implementing a semantic serving layer |
| references/contracts-catalogs-lineage.md | Adding data contracts, catalog metadata, and lineage on shared assets |
| references/data-quality-testing.md | Building test suites, freshness checks, and anomaly monitoring |
| references/metric-governance.md | Governing, versioning, and deprecating shared KPIs |
| references/release-and-ci-patterns.md | CI/CD pipelines, dual-run validation, backfills, safe cutovers |
| references/pii-vault-and-pseudonymisation.md | Separating PII from analytical facts for LLM/AI or GDPR-scoped surfaces |
| references/transformation-patterns.md | Designing dbt or SQLMesh transformation layer (moved from data-lake-platform) |
| references/lake-data-quality-patterns.md | Adding GX/Soda quality contracts on lake-native tables (moved from data-lake-platform) |
Out of scope: causal inference, network science, information theory, and theory-of-constraints analysis. For DAG blast radius, use dbt ls -s model+ or len(nx.descendants(G, node)) on the lineage graph. For pipeline-lag bottlenecks, use foundations-theory-of-constraints. For causal attribution, mutual-information feature selection, or network analysis on analytics data, use foundations-causal-inference, foundations-information-theory, or foundations-network-science.
marketing-product-analytics — event instrumentation and acquisition measurementtrust_tier: primary entries in data/sources.json for vendor capabilities, syntax, pricing, limits, and release-sensitive recommendations.When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.