Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"group": "Developer guides",
"icon": "list-check",
"pages": [
"guides/developer/agentic-coding",
"guides/developer/dbt-model-best-practices",
"guides/developer/preview-projects",
"guides/developer/dbt-write-back",
Expand Down
111 changes: 111 additions & 0 deletions guides/developer/agentic-coding.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: "Agentic coding"
description: "Use AI coding agents like Cursor, Claude Code, Codex, and Antigravity to build and maintain your Lightdash semantic layer."
---

AI coding agents can help you build and maintain your Lightdash semantic layer more efficiently. By installing Lightdash skills, you enable these agents to understand your semantic layer structure and use the latest Lightdash features correctly.

## What are skills?

Skills are context files that teach AI coding agents about Lightdash's YAML configuration, metrics, dimensions, and best practices. They're powered by [agentskills.io](https://agentskills.io) and provide agents with the knowledge they need to:

- Generate correct YAML configurations for metrics and dimensions
- Follow Lightdash naming conventions and best practices
- Understand table relationships and joins
- Use the latest Lightdash features and syntax

## Supported tools

Lightdash skills work with popular AI coding assistants:

- **Cursor** - AI-powered code editor
- **Claude Code** - Anthropic's coding assistant
- **Codex** - OpenAI's code generation model
- **Antigravity** - AI development platform
- Other tools that support the skills format

## Installing skills

Use the Lightdash CLI to install skills for your preferred AI coding agent.

### Prerequisites

- [Lightdash CLI installed](/guides/cli/how-to-install-the-lightdash-cli)

### Install for your project

Install skills at the project level (recommended for team collaboration):

```bash
# Install for Claude (default)
lightdash install-skills

# Install for Cursor
lightdash install-skills --agent cursor

# Install for Codex
lightdash install-skills --agent codex
```

This creates a skills directory at your git root:
- `.claude/skills/` for Claude
- `.cursor/skills/` for Cursor
- `.codex/skills/` for Codex

### Install globally

Install skills globally to use them across all your projects:

```bash
# Install globally for Claude
lightdash install-skills --global

# Install globally for Cursor
lightdash install-skills --agent cursor --global
```

Global skills are installed to your home directory (e.g., `~/.claude/skills/`).

### Install to a custom path

Specify a custom installation path:

```bash
lightdash install-skills --path ./my-project
```

## Using skills with your agent

Once installed, your AI coding agent automatically picks up the Lightdash skills. You can then ask your agent to:

- Create new metrics and dimensions
- Generate YAML configurations for dbt models
- Fix validation errors in your semantic layer
- Refactor existing metric definitions
- Add joins between tables

### Example prompts

```
Create a revenue metric that sums the amount field from the orders table
```

```
Add a customer_segment dimension based on the lifetime_value field
```

```
Generate the Lightdash YAML configuration for my users dbt model
```

The agent uses the installed skills to generate correct, up-to-date Lightdash configurations.

## Keeping skills updated

Re-run the install command to get the latest skills:

```bash
lightdash install-skills
```

This downloads the newest skill definitions from the Lightdash repository, ensuring your agent knows about the latest features and best practices.