Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

developing-in-lightdash在 lightdash 中开发

Agent Skill

developing-in-lightdash 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,769

周安装

76

GitHub Stars

5,664

下载量

620
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:developing-in-lightdash(在 lightdash 中开发)
来源仓库:https://github.com/lightdash/lightdash
仓库路径:skills/developing-in-lightdash
安装命令:
npx skills add https://github.com/lightdash/lightdash --skill developing-in-lightdash
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lightdash/lightdash --skill developing-in-lightdash

简介

developing-in-lightdash 支持 Lightdash 语义层建模与可视化内容开发,打通 dbt 与 BI 工具链路。

  • 核心 YAML 文件包括 metrics.yml(指标定义)、dimensions.yml(维度分组)和 joins.yml(表关联规则)。
  • CLI 命令如 lightdash deploy 自动上传 chart/dashboard 配置,preview 模式支持本地 SQL 预览验证逻辑正确性。
  • 度量计算必须引用已注册的 dbt 模型字段,禁止使用原始 SQL 片段绕过元数据管理系统约束。
  • 仪表板布局采用网格系统自由拖拽组件,但建议保持视觉层次清晰避免信息密度过高影响可读性。

SKILL.md

Developing in Lightdash

Build and deploy Lightdash analytics projects. This skill covers the semantic layer (metrics, dimensions, joins) and content (charts, dashboards).

When to Use

  • Working with Lightdash YAML files (charts, dashboards, models as code)
  • Using the lightdash CLI (deploy, upload, download, preview, lint, sql)
  • Defining metrics, dimensions, joins, or tables in dbt or pure Lightdash projects
  • Creating or editing charts and dashboards as code

Don't use for: Developing the Lightdash application itself (use the codebase CLAUDE.md), general dbt work without Lightdash metadata, or raw SQL unrelated to Lightdash models.

What You Can Do

TaskCommandsReferences
Explore data warehouselightdash sql to execute raw sql, read.csv resultsCLI Reference
Define metrics & dimensionsEdit dbt YAML or Lightdash YAMLMetrics, Dimensions
Create chartslightdash download, edit YAML, lightdash uploadChart Types
Add period comparisonsAdd PoP additional metrics to chart YAMLPeriod over Period
Build dashboardslightdash download, edit YAML, lightdash uploadDashboard Reference
Lint yaml fileslightdash lintCLI Reference
Set warehouse connectionlightdash set-warehouse from profiles.ymlCLI Reference
Deploy changeslightdash deploy (semantic layer), lightdash upload (content)CLI Reference
Test changeslightdash previewWorkflows

Common Mistakes

MistakeConsequencePrevention
Guessing filter valuesCase mismatches ('Payment' vs 'payment') cause charts to silently return no dataAlways run lightdash sql "SELECT DISTINCT column FROM table LIMIT 50" -o values.csv and use exact values
Not updating dashboard tiles after renaming a chartDashboard tile still shows old title — title and chartName are independent overrides that do NOT auto-updateDownload the dashboard, find tiles with matching chartSlug, update title and chartName to match
Including unused dimensions in metricQuery"Results may be incorrect" warning — extra dimensions change SQL grouping and produce wrong numbersEvery dimension in metricQuery.dimensions must appear in the chart config. For cartesian: layout.xField, layout.yField, or pivotConfig.columns
Unsorted YAML keyslightdash upload warns "unsorted YAML keys" and diffs become noisyAlways sort keys alphabetically at every nesting level — the CLI writes with sortKeys: true
Deploying to wrong projectOverwrites production contentAlways run lightdash config get-project before deploying
Missing contentType fieldContent type can't be determined without relying on directory structureAlways include contentType: chart, contentType: dashboard, or contentType: sql_chart at the top level

Before You Start

Check Your Target Project

Always verify which project you're deploying to. Deploying to the wrong project can overwrite production content.

lightdash config get-project        # Show current project
lightdash config list-projects      # List available projects
lightdash config set-project --name "My Project"  # Switch project

Detect Your Project Type

The YAML syntax differs significantly between project types.

TypeDetectionKey Difference
dbt ProjectHas dbt_project.ymlMetadata nested under meta:
dbt Fusion / dbt 1.10+Has dbt_project.yml, uses dbt Fusion or dbt >= 1.10Metadata nested under config: meta:
Pure LightdashHas lightdash.config.yml, no dbtTop-level properties
ls dbt_project.yml 2>/dev/null && echo "dbt project" || echo "Not dbt"
ls lightdash.config.yml 2>/dev/null && echo "Pure Lightdash" || echo "Not pure Lightdash"
dbt Fusion / dbt 1.10+: Lightdash metadata must be nested under config: meta: instead of meta:. The properties are identical — only the nesting changes. Example: ``yaml models: - name: orders config: meta: metrics: total_revenue: type: sum sql: "${TABLE}.amount" ``

Syntax Comparison

dbt YAML (metadata under meta:):

models:
  - name: orders
    meta:
      metrics:
        total_revenue:
          type: sum
          sql: "${TABLE}.amount"
    columns:
      - name: status
        meta:
          dimension:
            type: string

Pure Lightdash YAML (top-level):

type: model
name: orders
sql_from: 'DB.SCHEMA.ORDERS'

metrics:
  total_revenue:
    type: sum
    sql: ${TABLE}.amount

dimensions:
  - name: status
    sql: ${TABLE}.STATUS
    type: string

Setting Up Warehouse Connection

If the project needs a different warehouse connection (e.g., switching from Postgres to BigQuery), update it from your profiles.yml:

lightdash set-warehouse --project-dir ./dbt --profiles-dir ./profiles --assume-yes

This reads credentials from profiles.yml, updates the warehouse connection on the currently selected project, and triggers a recompile. Run this before lightdash deploy.

To target a specific project:

lightdash set-warehouse --project-dir ./dbt --profiles-dir ./profiles --project <uuid> --assume-yes

Core Workflows

Verify Filter Values Before Using Them

CRITICAL: Never guess filter values. Case mismatches (e.g., 'Payment' vs 'payment') cause charts to silently return no data.

Before writing any string filter, query actual values from the warehouse:

lightdash sql "SELECT DISTINCT category FROM payments LIMIT 50" -o category_values.csv

Read the CSV and use the exact values in your filter YAML. This applies to all equals/notEquals filters with string values — in charts and dashboards.

Editing Metrics & Dimensions

  1. Find the model YAML file (dbt: models/*.yml, pure Lightdash: lightdash/models/*.yml)
  2. Edit metrics/dimensions using the appropriate syntax for your project type
  3. Validate: lightdash lint (pure Lightdash) or dbt compile (dbt projects)
  4. Deploy: lightdash deploy

See Metrics Reference and Dimensions Reference for configuration options.

Editing Charts

  1. Download: lightdash download --charts chart-slug
  2. Edit the YAML file in lightdash/ directory
  3. Verify filter values: If you added or changed filters, use lightdash sql to check actual column values (see Common Mistakes)
  4. Update dashboard tiles: If you changed the chart's name or purpose, download any dashboards that reference it and update their tile title and chartName properties to match (see Common Mistakes)
  5. Lint: lightdash lint to validate before uploading
  6. Upload: lightdash upload --charts chart-slug (and any modified dashboards)

Dashboard tiles have their own titles. A saved_chart tile's title and chartName properties are independent overrides — they do NOT auto-update when you rename the chart. If you change a chart from "Total Revenue" to "Gross Profit" but don't update the dashboard tile, the dashboard will still display "Total Revenue". Always download the dashboard, find tiles with matching chartSlug, and update their title and chartName to match.

# Dashboard tile — title and chartName must be updated manually when chart changes
tiles:
  - type: saved_chart
    properties:
      chartSlug: total-revenue-kpi
      title: "Gross Profit"        # ← Update this when chart name/purpose changes
      chartName: "Gross Profit"    # ← Update this too

Editing Dashboards

  1. Download: lightdash download --dashboards dashboard-slug
  2. Edit the YAML file in lightdash/ directory
  3. Verify filter values: If you added or changed filters, use lightdash sql to check actual column values (see Common Mistakes)
  4. Lint: lightdash lint to validate before uploading
  5. Upload: lightdash upload --dashboards dashboard-slug

Creating New Content

Charts and dashboards are typically created in the UI first, then managed as code:

  1. Create in UI
  2. lightdash download to pull as YAML
  3. Edit and version control
  4. lightdash lint to validate before uploading
  5. lightdash upload to sync changes

Testing with Preview

For larger changes, test in isolation:

lightdash preview --name "my-feature"
# Make changes and iterate
lightdash stop-preview --name "my-feature"

CLI Quick Reference

CommandPurpose
lightdash deploySync semantic layer (metrics, dimensions)
lightdash uploadUpload charts/dashboards
lightdash downloadDownload charts/dashboards as YAML
lightdash lintValidate YAML locally
lightdash previewCreate temporary test project
lightdash sql "..." -o file.csvRun SQL queries against warehouse
lightdash run-chart -p chart.ymlExecute chart YAML query against warehouse

See CLI Reference for full command documentation.

Semantic Layer

The semantic layer defines your data model. See individual references for full configuration:

Chart Types

All charts share a common base structure:

chartConfig:
  config: {}        # Type-specific — see individual references
  type: <type>
contentType: chart              # Required: chart, dashboard, or sql_chart
dashboardSlug: my-dashboard  # Optional: scopes chart to dashboard (won't appear in space)
metricQuery:
  dimensions:
    - my_explore_category
  exploreName: my_explore     # Required: which explore to query
  filters: {}
  limit: 500
  metrics:
    - my_explore_total_sales
  sorts: []
name: "Chart Name"
slug: unique-chart-slug
spaceSlug: target-space
tableConfig:
  columnOrder: []
tableName: my_explore           # Required: top-level explore/table name
version: 1

Key ordering: All YAML keys must be sorted alphabetically at every nesting level. The CLI writes files with sortKeys: true and warns on upload if keys are unsorted. When writing or editing YAML by hand, keep keys in alphabetical order to avoid warnings and noisy diffs.

Chart scoping: Use spaceSlug only for shared charts. Add dashboardSlug to scope a chart to a specific dashboard (it won't appear in the space).

Choosing the Right Chart Type

Data PatternRecommended ChartWhy
Trends over timeLine or area (cartesian)Shows continuous change with time on X-axis
Category comparisonsBar (cartesian)Easy visual comparison between discrete categories
Part-of-whole relationshipspie or treemapShows proportions summing to 100%
Single KPI metricbig_numberFocuses attention on one important value
Conversion stagesfunnelVisualizes drop-off between sequential steps
Progress toward targetgaugeShows current value relative to goal
Geographic datamapPlots data points or regions on a map
Detailed recordstableDisplays raw data with sorting and formatting
Advanced custom needscustomFull Vega-Lite spec for custom visualizations
TypeUse CaseReference
cartesianBar, line, area, scatterCartesian
pieParts of wholePie
tableData tablesTable
big_numberKPIsBig Number
funnelConversion funnelsFunnel
gaugeProgress indicatorsGauge
treemapHierarchical dataTreemap
mapGeographic dataMap
customVega-LiteCustom Viz

Dashboards

Dashboards arrange charts and content in a grid layout. See Dashboard Reference for YAML structure, tile types, tabs, and filters.

Exploring the Warehouse

Use lightdash sql to explore data when building models:

# Preview table structure
lightdash sql "SELECT * FROM orders LIMIT 5" -o preview.csv

# Check distinct values for a dimension
lightdash sql "SELECT DISTINCT status FROM orders" -o statuses.csv

# Test metric calculations
lightdash sql "SELECT SUM(amount) FROM orders" -o test.csv

Workflow Patterns

PatternWhen to Use
Direct (deploy + upload)Solo dev, rapid iteration
Preview-FirstTeam, complex changes
CI/CDAutomated on merge

See Workflows Reference for detailed examples and CI/CD configurations.

Resources

Semantic Layer

Charts

Dashboards & Workflows

External

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.11%
按下载量换算205

Claude

27.84%
按下载量换算173

Cursor

20.7%
按下载量换算128

Gemini CLI

9.38%
按下载量换算58

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills